* [PATCH] powerpc/cacheflush: fix variable set but not used
@ 2019-06-06 13:58 Qian Cai
2019-06-27 19:54 ` Qian Cai
2019-07-03 14:27 ` Michael Ellerman
0 siblings, 2 replies; 3+ messages in thread
From: Qian Cai @ 2019-06-06 13:58 UTC (permalink / raw)
To: mpe; +Cc: benh, paulus, akpm, linuxppc-dev, linux-kernel, Qian Cai
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>
---
arch/powerpc/include/asm/cacheflush.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/cacheflush.h b/arch/powerpc/include/asm/cacheflush.h
index 74d60cfe8ce5..fd318f7c3eed 100644
--- a/arch/powerpc/include/asm/cacheflush.h
+++ b/arch/powerpc/include/asm/cacheflush.h
@@ -29,9 +29,12 @@
* 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
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/cacheflush: fix variable set but not used
2019-06-06 13:58 [PATCH] powerpc/cacheflush: fix variable set but not used Qian Cai
@ 2019-06-27 19:54 ` Qian Cai
2019-07-03 14:27 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Qian Cai @ 2019-06-27 19:54 UTC (permalink / raw)
To: mpe; +Cc: benh, paulus, akpm, linuxppc-dev, linux-kernel
Ping.
On Thu, 2019-06-06 at 09:58 -0400, Qian Cai wrote:
> 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>
> ---
> arch/powerpc/include/asm/cacheflush.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/cacheflush.h
> b/arch/powerpc/include/asm/cacheflush.h
> index 74d60cfe8ce5..fd318f7c3eed 100644
> --- a/arch/powerpc/include/asm/cacheflush.h
> +++ b/arch/powerpc/include/asm/cacheflush.h
> @@ -29,9 +29,12 @@
> * 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/cacheflush: fix variable set but not used
2019-06-06 13:58 [PATCH] powerpc/cacheflush: fix variable set but not used Qian Cai
2019-06-27 19:54 ` Qian Cai
@ 2019-07-03 14:27 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2019-07-03 14:27 UTC (permalink / raw)
To: Qian Cai; +Cc: linux-kernel, Qian Cai, paulus, akpm, linuxppc-dev
On Thu, 2019-06-06 at 13:58:13 UTC, Qian Cai wrote:
> 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>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/04db3ede40ae4fc23a5c4237254c4a53bbe4c1f2
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-03 14:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 13:58 [PATCH] powerpc/cacheflush: fix variable set but not used Qian Cai
2019-06-27 19:54 ` Qian Cai
2019-07-03 14:27 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).