[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241031072746.12897-1-xiqi2@huawei.com>
Date: Thu, 31 Oct 2024 15:27:46 +0800
From: Qi Xi <xiqi2@...wei.com>
To: <bobo.shaobowang@...wei.com>, <xiqi2@...wei.com>, <bhe@...hat.com>,
<vgoyal@...hat.com>, <dyoung@...hat.com>, <holzheu@...ux.vnet.ibm.com>,
<akpm@...ux-foundation.org>, <kexec@...ts.infradead.org>,
<linux-fsdevel@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>
Subject: [PATCH] fs/proc: Fix compile warning about variable 'vmcore_mmap_ops'
When build with !CONFIG_MMU, the variable 'vmcore_mmap_ops'
is defined but not used:
>> fs/proc/vmcore.c:458:42: warning: unused variable 'vmcore_mmap_ops'
458 | static const struct vm_operations_struct vmcore_mmap_ops = {
Fix this by declaring it __maybe_unused.
Fixes: 9cb218131de1 ("vmcore: introduce remap_oldmem_pfn_range()")
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/lkml/202410301936.GcE8yUos-lkp@intel.com/
Signed-off-by: Qi Xi <xiqi2@...wei.com>
---
fs/proc/vmcore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 1fb213f379a5..9651f105c25b 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -455,7 +455,7 @@ static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf)
#endif
}
-static const struct vm_operations_struct vmcore_mmap_ops = {
+static const struct vm_operations_struct __maybe_unused vmcore_mmap_ops = {
.fault = mmap_vmcore_fault,
};
--
2.33.0
Powered by blists - more mailing lists