diff options
| author | Steven Price <[email protected]> | 2023-04-05 11:38:19 +0100 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-04-18 16:29:54 -0700 |
| commit | b4aca54792e76556bb9f8661bab07b4bf2eb4e5f (patch) | |
| tree | e922972c97dbbf3ac98e326540b2132655c9667f /include | |
| parent | 8666925c498674426de44ecba79fd8bf42d3cda3 (diff) | |
smaps: fix defined but not used smaps_shmem_walk_ops
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().
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 7b86ac3371b7 ("pagewalk: separate function pointers from iterator data")
Signed-off-by: Steven Price <[email protected]>
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Reviewed-by: Jason Gunthorpe <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Thomas Hellström <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/shmem_fs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 3bb8d21edbb3..b9516a9802bf 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -96,7 +96,14 @@ int shmem_unuse(unsigned int type); 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 extern unsigned long shmem_partial_swap_usage(struct address_space *mapping, pgoff_t start, pgoff_t end); |