[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZC1jx1LIwENgzTaO@ziepe.ca>
Date: Wed, 5 Apr 2023 09:04:23 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Steven Price <steven.price@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Hellstrom <thellstrom@...are.com>,
Christoph Hellwig <hch@....de>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2] smaps: Fix defined but not used smaps_shmem_walk_ops
On Wed, Apr 05, 2023 at 11:38:19AM +0100, Steven Price wrote:
> When !CONFIG_SHMEM smaps_shmem_walk_ops is defined but not used,
> triggering a compiler warning. To avoid the warning remove the #ifdef
> around the usage. This has no effect because shmem_mapping() is a stub
> returning false when !CONFIG_SHMEM so the code will be compiled out,
> however we now need to also provide a stub for shmem_swap_usage().
>
> Fixes: 7b86ac3371b7 ("pagewalk: separate function pointers from iterator data")
> Reported-by: kernel test robot <lkp@...el.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202304031749.UiyJpxzF-lkp@intel.com/
> Signed-off-by: Steven Price <steven.price@....com>
> ---
> I've implemented Jason's suggestion of removing the #ifdef around the
> usage and prodiving a stub for shmem_swap_usage() instead.
This seems OK
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
> extern bool shmem_is_huge(struct inode *inode, pgoff_t index, bool shmem_huge_force,
> struct mm_struct *mm, unsigned long vm_flags);
> +#ifdef CONFIG_SHMEM
> extern unsigned long shmem_swap_usage(struct vm_area_struct *vma);
> +#else
> +static inline unsigned long shmem_swap_usage(struct vm_area_struct *vma)
> +{
> + return 0;
> +}
> +#endif
Though it would be nice if this file didn't have so many ifdef blocks
Jason
Powered by blists - more mailing lists