Re: [PATCH v2 2/3] mm: Introduce page_shift()

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

 



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@xxxxxxxxx> 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.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux