diff options
author | Qian Cai <cai@lca.pw> | 2019-03-29 06:43:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-04 10:21:22 +0300 |
commit | 87eaf3d8ac51577c6123b43245e547c94c54dc06 (patch) | |
tree | 62f446090c4574bea8a5da9a58e49bdf18ec683d /mm | |
parent | 514860ee66333ed2baa99aa2c43ec83320105ed3 (diff) | |
download | linux-87eaf3d8ac51577c6123b43245e547c94c54dc06.tar.xz |
kasan: fix variable 'tag' set but not used warning
[ Upstream commit c412a769d2452161e97f163c4c4f31efc6626f06 ]
set_tag() compiles away when CONFIG_KASAN_SW_TAGS=n, so make
arch_kasan_set_tag() a static inline function to fix warnings below.
mm/kasan/common.c: In function '__kasan_kmalloc':
mm/kasan/common.c:475:5: warning: variable 'tag' set but not used [-Wunused-but-set-variable]
u8 tag;
^~~
Link: http://lkml.kernel.org/r/20190307185244.54648-1-cai@lca.pw
Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/kasan/kasan.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index ea51b2d898ec..c980ce43e3ba 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -164,7 +164,10 @@ static inline u8 random_tag(void) #endif #ifndef arch_kasan_set_tag -#define arch_kasan_set_tag(addr, tag) ((void *)(addr)) +static inline const void *arch_kasan_set_tag(const void *addr, u8 tag) +{ + return addr; +} #endif #ifndef arch_kasan_reset_tag #define arch_kasan_reset_tag(addr) ((void *)(addr)) |