diff mbox series

[rdma-next,2/2] kasan: add missing prototypes to fix compilation warnings

Message ID 20200512063728.17785-3-leon@kernel.org (mailing list archive)
State New, archived
Headers show
Series Fix kasan compilation warnings | expand

Commit Message

Leon Romanovsky May 12, 2020, 6:37 a.m. UTC
From: Leon Romanovsky <leonro@mellanox.com>

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@mellanox.com>
---
 mm/kasan/common.c | 3 ---
 mm/kasan/kasan.h  | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

--
2.26.2
diff mbox series

Patch

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);