linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Ira Weiny <ira.weiny@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	kbuild test robot <lkp@intel.com>,
	kbuild-all@01.org, linux-mm@kvack.org
Subject: Re: [PATCH v2 2/3] mm: Introduce page_shift()
Date: Mon, 23 Sep 2019 13:30:01 -0700	[thread overview]
Message-ID: <20190923203001.GD1855@bombadil.infradead.org> (raw)
In-Reply-To: <20190725203011.GA7362@iweiny-DESK2.sc.intel.com>

On Thu, Jul 25, 2019 at 01:30:12PM -0700, Ira Weiny wrote:
> On Wed, Jul 24, 2019 at 05:30:55PM -0700, Andrew Morton wrote:
> > On Wed, 24 Jul 2019 18:40:25 +0800 kbuild test robot <lkp@intel.com> wrote:
> > >    drivers/vfio/vfio_iommu_spapr_tce.c: In function 'tce_page_is_contained':
> > > >> drivers/vfio/vfio_iommu_spapr_tce.c:193:9: error: called object 'page_shift' is not a function or function pointer
> > >      return page_shift(compound_head(page)) >= page_shift;
> > >             ^~~~~~~~~~
> > >    drivers/vfio/vfio_iommu_spapr_tce.c:179:16: note: declared here
> > >       unsigned int page_shift)
> > >                    ^~~~~~~~~~
> > 
> > This?
> 
> Looks reasonable to me.  But checking around it does seem like "page_shift" is
> used as a parameter or variable in quite a few other places.
> 
> Is this something to be concerned with?

Sorry, I missed this earlier.

It's not currently a warning because we don't enable -Wshadow.
For functions which have a parameter or variable named page_shift, the
local definition overrides the global function.  They continue to work
"as expected".  The only reason this particular function has an issue
is that it also wants to call the function page_shift().  The compiler
resolves the symbol 'page_shift' to be the parameter, and says "This is
an int, not a function, you're clearly mistaken".

We don't need to mass-rename all the local variables called page_shift,
unless we want to enable -Wshadow.  Which I would actually like to do,
but I don't have time.


  reply	other threads:[~2019-09-23 20:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-21 10:46 [PATCH v2 0/3] Make working with compound pages easier Matthew Wilcox
2019-07-21 10:46 ` [PATCH v2 1/3] mm: Introduce page_size() Matthew Wilcox
2019-07-23  0:43   ` Ira Weiny
2019-07-23 16:02     ` Matthew Wilcox
2019-07-23 17:58       ` Ira Weiny
2019-07-23 18:14         ` Matthew Wilcox
2019-07-23 20:44           ` Ira Weiny
2019-07-23 21:03             ` Matthew Wilcox
2019-09-20 23:28       ` Andrew Morton
2019-09-21  1:09         ` Matthew Wilcox
2019-09-22  2:13           ` Weiny, Ira
2019-07-21 10:46 ` [PATCH v2 2/3] mm: Introduce page_shift() Matthew Wilcox
2019-07-23  0:44   ` Ira Weiny
2019-07-24 10:40   ` kbuild test robot
2019-07-25  0:30     ` Andrew Morton
2019-07-25 20:30       ` Ira Weiny
2019-09-23 20:30         ` Matthew Wilcox [this message]
2019-07-21 10:46 ` [PATCH v2 3/3] mm: Introduce compound_nr() Matthew Wilcox
2019-07-23  0:46   ` Ira Weiny
2019-07-23 12:55 ` [PATCH v2 0/3] Make working with compound pages easier Kirill A. Shutemov

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=20190923203001.GD1855@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=ira.weiny@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@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).