[PATCH rdma-next 2/2] kasan: add missing prototypes to fix compilation warnings
From: Leon Romanovsky
Date: Tue May 12 2020 - 02:37:49 EST
From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
Use internal kasan header to declare missing prototypes to fix the
following compilation warnings.
mm/kasan/report.c:457:6: warning: no previous prototype for 'report_enabled' [-Wmissing-prototypes]
457 | bool report_enabled(void)
| ^~~~~~~~~~~~~~
mm/kasan/report.c:482:6: warning: no previous prototype for '__kasan_report' [-Wmissing-prototypes]
482 | void __kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip)
| ^~~~~~~~~~~~~~
Fixes: 57b78a62e7f2 ("x86/uaccess, kasan: Fix KASAN vs SMAP")
Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
---
mm/kasan/common.c | 3 ---
mm/kasan/kasan.h | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/kasan/common.c b/mm/kasan/common.c
index 2906358e42f0..cbb119224330 100644
--- a/mm/kasan/common.c
+++ b/mm/kasan/common.c
@@ -613,9 +613,6 @@ void kasan_free_shadow(const struct vm_struct *vm)
}
#endif
-extern void __kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip);
-extern bool report_enabled(void);
-
bool kasan_report(unsigned long addr, size_t size, bool is_write, unsigned long ip)
{
unsigned long flags = user_access_save();
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index d428e588c700..02d54a1d0b2d 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -153,6 +153,9 @@ bool check_memory_region(unsigned long addr, size_t size, bool write,
void *find_first_bad_addr(void *addr, size_t size);
const char *get_bug_type(struct kasan_access_info *info);
+bool report_enabled(void);
+void __kasan_report(unsigned long addr, size_t size, bool is_write,
+ unsigned long ip);
bool kasan_report(unsigned long addr, size_t size,
bool is_write, unsigned long ip);
void kasan_report_invalid_free(void *object, unsigned long ip);
--
2.26.2