Re: [PATCH 1/2] dma-mapping: introduce dma_get_seg_boundary_nr_pages()

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

 





Le 03/09/2020 à 18:12, Christoph Hellwig a écrit :
On Thu, Sep 03, 2020 at 01:57:39PM +0300, Andy Shevchenko wrote:
+{
+       if (!dev)
+               return (U32_MAX >> page_shift) + 1;
+       return (dma_get_seg_boundary(dev) >> page_shift) + 1;

Can it be better to do something like
   unsigned long boundary = dev ? dma_get_seg_boundary(dev) : U32_MAX;

   return (boundary >> page_shift) + 1;

?

I don't really see what that would buy us.


I guess it would avoid the duplication of    >> page_shift) + 1

Christophe



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux