From: Safocl Stollmannovic <safocl88@gmail.com>
To: Michal Simek <monstr@monstr.eu>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2 03/10] microblaze: fix duplicate extern declarations
Date: Fri, 13 Nov 2026 05:06:08 +0400 [thread overview]
Message-ID: <20261113010631.139191-4-safocl88@gmail.com> (raw)
In-Reply-To: <20261113010631.139191-1-safocl88@gmail.com>
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@gmail.com>
---
arch/microblaze/include/asm/entry.h | 2 +-
arch/microblaze/kernel/microblaze_ksyms.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h
index 05acf4d7b..f3e4a6eaa 100644
--- a/arch/microblaze/include/asm/entry.h
+++ b/arch/microblaze/include/asm/entry.h
@@ -41,7 +41,7 @@ DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */
DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
-extern asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall);
+asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall);
# endif /* __ASSEMBLER__ */
#endif /* _ASM_MICROBLAZE_ENTRY_H */
diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
index ad7596d7b..40915d400 100644
--- a/arch/microblaze/kernel/microblaze_ksyms.c
+++ b/arch/microblaze/kernel/microblaze_ksyms.c
@@ -51,6 +51,6 @@ extern void xmb_manager_register(uintptr_t phys_baseaddr, u32 cr_val,
void (*callback)(void *data),
void *priv, void (*reset_callback)(void *data));
EXPORT_SYMBOL(xmb_manager_register);
-extern asmlinkage void xmb_inject_err(void);
+asmlinkage void xmb_inject_err(void);
EXPORT_SYMBOL(xmb_inject_err);
#endif
--
2.56.1
next prev parent reply other threads:[~2026-11-13 1:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 1:06 [PATCH v2 00/10] Remove redundant " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 01/10] ARM: fix duplicate " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 02/10] loongarch: " Safocl Stollmannovic
2026-11-13 1:06 ` Safocl Stollmannovic [this message]
2026-11-13 1:06 ` [PATCH v2 04/10] MIPS: " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 05/10] openrisc: " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 06/10] riscv: " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 07/10] x86: " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 08/10] drivers: " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 09/10] sched/preempt: " Safocl Stollmannovic
2026-11-13 1:06 ` [PATCH v2 10/10] kernel: " Safocl Stollmannovic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261113010631.139191-4-safocl88@gmail.com \
--to=safocl88@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=monstr@monstr.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®