Re: [PATCH 5/9] nvme-pci: merge the simple PRP and SGL setup into a common helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 11, 2025 at 03:03:35PM -0600, Keith Busch wrote:
> On Tue, Jun 10, 2025 at 07:06:43AM +0200, Christoph Hellwig wrote:
> > -	iod->dma_len = bv->bv_len;
> > +		iod->cmd.common.dptr.prp1 = cpu_to_le64(dma_addr);
> > +		iod->cmd.common.dptr.prp2 = 0;
> > +		if (bv.bv_len > first_prp_len)
> > +			iod->cmd.common.dptr.prp2 =
> > +				cpu_to_le64(dma_addr + first_prp_len);
> 
> Nit, set prp2 to 0 in an 'else' case instead of unconditionally before
> overwriting it?

unconditionally setting it actually generates slightly better code,
assuming the compiler won't just optimize the other form to it anyway.
But if you think it is more readable I can change it around.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux