From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Xu Yilun <yilun.xu@intel.com>
Cc: Peter Colberg <peter.colberg@intel.com>,
hao.wu@intel.com, gregkh@linuxfoundation.org,
linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org,
aaron.j.grier@intel.com, tianfei.zhang@intel.com,
russell.h.weight@intel.com, matthew.gerlach@linux.intel.com,
marpagan@redhat.com, lgoncalv@redhat.com
Subject: Re: [PATCH v2] fpga: dfl: afu: use PFN_DOWN() and PFN_PHYS() helper macros
Date: Tue, 27 Jun 2023 21:23:03 +0300 [thread overview]
Message-ID: <ZJspBy/imk1qH+s2@smile.fi.intel.com> (raw)
In-Reply-To: <ZJqBE1mCjSaRIvyt@yilunxu-OptiPlex-7050>
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
next prev parent reply other threads:[~2023-06-27 18:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 22:42 [PATCH] fpga: dfl: afu: use PFN_DOWN() and PFN_PHYS() helper macros Peter Colberg
2023-06-19 13:46 ` Greg KH
2023-06-19 13:54 ` Andy Shevchenko
2023-06-19 14:05 ` Greg KH
2023-06-19 19:56 ` [PATCH v2] " Peter Colberg
2023-06-27 6:26 ` Xu Yilun
2023-06-27 18:23 ` Andy Shevchenko [this message]
2023-06-28 5:56 ` Xu Yilun
2023-06-29 0:22 ` [PATCH v3] fpga: dfl: afu: use PFN_DOWN() helper macro Peter Colberg
2023-07-10 6:35 ` Xu Yilun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZJspBy/imk1qH+s2@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=aaron.j.grier@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hao.wu@intel.com \
--cc=lgoncalv@redhat.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marpagan@redhat.com \
--cc=matthew.gerlach@linux.intel.com \
--cc=peter.colberg@intel.com \
--cc=russell.h.weight@intel.com \
--cc=tianfei.zhang@intel.com \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).