From e22defeb9810d98dfffe9d84e036559af1742d96 Mon Sep 17 00:00:00 2001 From: Kirtika Ruchandani Date: Thu, 24 Nov 2016 17:12:00 -0800 Subject: [PATCH] drivers/base/memory.c: Remove unused 'first_page' variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 71fbd556adde ("memory-hotplug: remove redundant call of page_to_pfn") introduced an optimization that rendered 'struct page* first_page' useless in memory_block_action(). Compiling with W=1 gives the following warning, fix it. drivers/base/memory.c: In function ‘memory_block_action’: drivers/base/memory.c:229:15: warning: variable ‘first_page’ set but not used [-Wunused-but-set-variable] struct page *first_page; ^ This is a harmeless warning and is only being fixed to reduce the noise with W=1 in the kernel. The call to pfn_to_page() has no side effects and is safe to remove. Fixes: 71fbd556adde ("memory-hotplug: remove redundant call of page_to_pfn") Cc: Zhang Zhen Cc: Andrew Morton Cc: Linus Torvalds Signed-off-by: Kirtika Ruchandani Signed-off-by: Greg Kroah-Hartman --- drivers/base/memory.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 62c63c0c5c22..bb69e58c29f3 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -226,11 +226,9 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t { unsigned long start_pfn; unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; - struct page *first_page; int ret; start_pfn = section_nr_to_pfn(phys_index); - first_page = pfn_to_page(start_pfn); switch (action) { case MEM_ONLINE: -- GitLab