Skip to contentSkip to conversation

smaps-fix-defined-but-not-used-smaps_shmem_walk_ops.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 18, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: smaps: fix defined but not used smaps_shmem_walk_ops
has been removed from the -mm tree. Its filename was
smaps-fix-defined-but-not-used-smaps_shmem_walk_ops.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Steven Price <[email protected]>
Subject: smaps: fix defined but not used smaps_shmem_walk_ops
Date: Wed, 5 Apr 2023 11:38:19 +0100

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().

---

 fs/proc/task_mmu.c       |    3 +--
 include/linux/shmem_fs.h |    7 +++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
fs/proc/task_mmu.c renamed from fs/proc/task_mmu.c~smaps-fix-defined-but-not-used-smaps_shmem_walk_ops +1 -2
@@ -782,7 +782,6 @@ static void smap_gather_stats(struct vm_
 	if (start >= vma->vm_end)
 		return;
 
-#ifdef CONFIG_SHMEM
 	if (vma->vm_file && shmem_mapping(vma->vm_file->f_mapping)) {
 		/*
 		 * For shared or readonly shmem mappings we know that all
@@ -803,7 +802,7 @@ static void smap_gather_stats(struct vm_
 			ops = &smaps_shmem_walk_ops;
 		}
 	}
-#endif
+
 	/* mmap_lock is held in m_start */
 	if (!start)
 		walk_page_vma(vma, ops, mss);
include/linux/shmem_fs.h renamed from include/linux/shmem_fs.h~smaps-fix-defined-but-not-used-smaps_shmem_walk_ops +7 -0
@@ -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);
 

_

Patches currently in -mm which might be from [email protected] are