Commit 9dd979ba authored by Marco Elver's avatar Marco Elver Committed by Paul E. McKenney

kcsan: Silence -Wmissing-prototypes warning with W=1

The functions here should not be forward declared for explicit use
elsewhere in the kernel, as they should only be emitted by the compiler
due to sanitizer instrumentation.  Add forward declarations a line above
their definition to shut up warnings in W=1 builds.

Link: https://lkml.kernel.org/r/202006060103.jSCpnV1g%lkp@intel.comReported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarMarco Elver <elver@google.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 2888557f
...@@ -754,6 +754,7 @@ EXPORT_SYMBOL(__kcsan_check_access); ...@@ -754,6 +754,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
*/ */
#define DEFINE_TSAN_READ_WRITE(size) \ #define DEFINE_TSAN_READ_WRITE(size) \
void __tsan_read##size(void *ptr); \
void __tsan_read##size(void *ptr) \ void __tsan_read##size(void *ptr) \
{ \ { \
check_access(ptr, size, 0); \ check_access(ptr, size, 0); \
...@@ -762,6 +763,7 @@ EXPORT_SYMBOL(__kcsan_check_access); ...@@ -762,6 +763,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
void __tsan_unaligned_read##size(void *ptr) \ void __tsan_unaligned_read##size(void *ptr) \
__alias(__tsan_read##size); \ __alias(__tsan_read##size); \
EXPORT_SYMBOL(__tsan_unaligned_read##size); \ EXPORT_SYMBOL(__tsan_unaligned_read##size); \
void __tsan_write##size(void *ptr); \
void __tsan_write##size(void *ptr) \ void __tsan_write##size(void *ptr) \
{ \ { \
check_access(ptr, size, KCSAN_ACCESS_WRITE); \ check_access(ptr, size, KCSAN_ACCESS_WRITE); \
...@@ -777,12 +779,14 @@ DEFINE_TSAN_READ_WRITE(4); ...@@ -777,12 +779,14 @@ DEFINE_TSAN_READ_WRITE(4);
DEFINE_TSAN_READ_WRITE(8); DEFINE_TSAN_READ_WRITE(8);
DEFINE_TSAN_READ_WRITE(16); DEFINE_TSAN_READ_WRITE(16);
void __tsan_read_range(void *ptr, size_t size);
void __tsan_read_range(void *ptr, size_t size) void __tsan_read_range(void *ptr, size_t size)
{ {
check_access(ptr, size, 0); check_access(ptr, size, 0);
} }
EXPORT_SYMBOL(__tsan_read_range); EXPORT_SYMBOL(__tsan_read_range);
void __tsan_write_range(void *ptr, size_t size);
void __tsan_write_range(void *ptr, size_t size) void __tsan_write_range(void *ptr, size_t size)
{ {
check_access(ptr, size, KCSAN_ACCESS_WRITE); check_access(ptr, size, KCSAN_ACCESS_WRITE);
...@@ -799,6 +803,7 @@ EXPORT_SYMBOL(__tsan_write_range); ...@@ -799,6 +803,7 @@ EXPORT_SYMBOL(__tsan_write_range);
* the size-check of compiletime_assert_rwonce_type(). * the size-check of compiletime_assert_rwonce_type().
*/ */
#define DEFINE_TSAN_VOLATILE_READ_WRITE(size) \ #define DEFINE_TSAN_VOLATILE_READ_WRITE(size) \
void __tsan_volatile_read##size(void *ptr); \
void __tsan_volatile_read##size(void *ptr) \ void __tsan_volatile_read##size(void *ptr) \
{ \ { \
const bool is_atomic = size <= sizeof(long long) && \ const bool is_atomic = size <= sizeof(long long) && \
...@@ -811,6 +816,7 @@ EXPORT_SYMBOL(__tsan_write_range); ...@@ -811,6 +816,7 @@ EXPORT_SYMBOL(__tsan_write_range);
void __tsan_unaligned_volatile_read##size(void *ptr) \ void __tsan_unaligned_volatile_read##size(void *ptr) \
__alias(__tsan_volatile_read##size); \ __alias(__tsan_volatile_read##size); \
EXPORT_SYMBOL(__tsan_unaligned_volatile_read##size); \ EXPORT_SYMBOL(__tsan_unaligned_volatile_read##size); \
void __tsan_volatile_write##size(void *ptr); \
void __tsan_volatile_write##size(void *ptr) \ void __tsan_volatile_write##size(void *ptr) \
{ \ { \
const bool is_atomic = size <= sizeof(long long) && \ const bool is_atomic = size <= sizeof(long long) && \
...@@ -836,14 +842,17 @@ DEFINE_TSAN_VOLATILE_READ_WRITE(16); ...@@ -836,14 +842,17 @@ DEFINE_TSAN_VOLATILE_READ_WRITE(16);
* The below are not required by KCSAN, but can still be emitted by the * The below are not required by KCSAN, but can still be emitted by the
* compiler. * compiler.
*/ */
void __tsan_func_entry(void *call_pc);
void __tsan_func_entry(void *call_pc) void __tsan_func_entry(void *call_pc)
{ {
} }
EXPORT_SYMBOL(__tsan_func_entry); EXPORT_SYMBOL(__tsan_func_entry);
void __tsan_func_exit(void);
void __tsan_func_exit(void) void __tsan_func_exit(void)
{ {
} }
EXPORT_SYMBOL(__tsan_func_exit); EXPORT_SYMBOL(__tsan_func_exit);
void __tsan_init(void);
void __tsan_init(void) void __tsan_init(void)
{ {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment