]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/cacheflush: fix variable set but not used
authorQian Cai <cai@lca.pw>
Thu, 6 Jun 2019 13:58:13 +0000 (09:58 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:24:44 +0000 (07:24 +0200)
[ Upstream commit 04db3ede40ae4fc23a5c4237254c4a53bbe4c1f2 ]

The powerpc's flush_cache_vmap() is defined as a macro and never use
both of its arguments, so it will generate a compilation warning,

lib/ioremap.c: In function 'ioremap_page_range':
lib/ioremap.c:203:16: warning: variable 'start' set but not used
[-Wunused-but-set-variable]

Fix it by making it an inline function.

Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/include/asm/cacheflush.h

index 74d60cfe8ce5b59bd736fe40994470dc421e5cfc..fd318f7c3eed413d650f778bc25ff67ab540aeb7 100644 (file)
  * not expect this type of fault. flush_cache_vmap is not exactly the right
  * place to put this, but it seems to work well enough.
  */
-#define flush_cache_vmap(start, end)           do { asm volatile("ptesync" ::: "memory"); } while (0)
+static inline void flush_cache_vmap(unsigned long start, unsigned long end)
+{
+       asm volatile("ptesync" ::: "memory");
+}
 #else
-#define flush_cache_vmap(start, end)           do { } while (0)
+static inline void flush_cache_vmap(unsigned long start, unsigned long end) { }
 #endif
 
 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1