[PATCH v2 05/10] openrisc: fix duplicate extern declarations

From: Safocl Stollmannovic

Date: Thu Nov 12 2026 - 21:22:15 EST


Compiling a kernel module with a C++ compiler results in a "duplicate
extern specifier" error.
This occurs because the code contains `extern asmlinkage`, and `asmlinkage`
expands to `extern C` when processed by a C++ compiler.
Since the code already contains sections that respond to a C++ compiler,
I believe it is a perfectly valid approach to gradually move toward a state
where kernel modules can be compiled by a C++ compiler without any issues.
The `extern` specifier must be removed.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=222257

Signed-off-by: Safocl Stollmannovic <safocl88@xxxxxxxxx>
---
arch/openrisc/kernel/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index 73ffb9fa3..c46899806 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -129,7 +129,7 @@ void show_regs(struct pt_regs *regs)
* Copy the thread-specific (arch specific) info from the current
* process to the new one p
*/
-extern asmlinkage void ret_from_fork(void);
+asmlinkage void ret_from_fork(void);

/*
* copy_thread
--
2.56.1