[PATCH 10/10] riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id'

From: Kefeng Wang
Date: Sun May 10 2020 - 22:23:40 EST


In file included from ./../include/linux/compiler_types.h:68,
from <command-line>:
../include/asm-generic/mmiowb.h: In function âmmiowb_set_pendingâ:
../include/asm-generic/percpu.h:34:38: error: implicit declaration of function âsmp_processor_idâ; did you mean âraw_smp_processor_idâ? [-Werror=implicit-function-declaration]
#define my_cpu_offset per_cpu_offset(smp_processor_id())
^~~~~~~~~~~~~~~~
../include/linux/compiler-gcc.h:58:26: note: in definition of macro âRELOC_HIDEâ
(typeof(ptr)) (__ptr + (off)); \
^~~
../include/linux/percpu-defs.h:249:2: note: in expansion of macro âSHIFT_PERCPU_PTRâ
SHIFT_PERCPU_PTR(ptr, my_cpu_offset); \
^~~~~~~~~~~~~~~~
../include/asm-generic/percpu.h:34:23: note: in expansion of macro âper_cpu_offsetâ
#define my_cpu_offset per_cpu_offset(smp_processor_id())
^~~~~~~~~~~~~~
../include/linux/percpu-defs.h:249:24: note: in expansion of macro âmy_cpu_offsetâ
SHIFT_PERCPU_PTR(ptr, my_cpu_offset); \
^~~~~~~~~~~~~
../include/asm-generic/mmiowb.h:30:26: note: in expansion of macro âthis_cpu_ptrâ
#define __mmiowb_state() this_cpu_ptr(&__mmiowb_state)
^~~~~~~~~~~~
../include/asm-generic/mmiowb.h:37:28: note: in expansion of macro â__mmiowb_stateâ
struct mmiowb_state *ms = __mmiowb_state();
^~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
---
arch/riscv/include/asm/mmiowb.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/riscv/include/asm/mmiowb.h b/arch/riscv/include/asm/mmiowb.h
index bb4091ff4a21..0b2333e71fdc 100644
--- a/arch/riscv/include/asm/mmiowb.h
+++ b/arch/riscv/include/asm/mmiowb.h
@@ -9,6 +9,7 @@
*/
#define mmiowb() __asm__ __volatile__ ("fence o,w" : : : "memory");

+#include <linux/smp.h>
#include <asm-generic/mmiowb.h>

#endif /* _ASM_RISCV_MMIOWB_H */
--
2.26.2