Re: [PATCH v2] fpga: dfl: afu: use PFN_DOWN() and PFN_PHYS() helper macros

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

 



On Tue, Jun 27, 2023 at 02:26:27PM +0800, Xu Yilun wrote:
> On 2023-06-19 at 15:56:34 -0400, Peter Colberg wrote:

...

> > -	int npages = region->length >> PAGE_SHIFT;
> > +	int npages = PFN_DOWN(region->length);
> 
> I don't much prefer this change, it is not doing the phy addr to pfn
> convertion. The macro name doesn't match what is doing here.

This macro converts length to pages. And it's not about phy addr.

...

> > -	long npages = region->length >> PAGE_SHIFT;
> > +	long npages = PFN_DOWN(region->length);
> 
> ditto

Ditto.

...

> > -	int npages = region->length >> PAGE_SHIFT;
> > +	int npages = PFN_DOWN(region->length);
> 
> ditto

Ditto.

...

> > -	offset = vma->vm_pgoff << PAGE_SHIFT;
> > +	offset = PFN_PHYS(vma->vm_pgoff);
> 
> ditto. The variables are offsets within file, not phys addr & pfn.

Here I probably can agree.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux