Re: [PATCH v3 08/14] drivers: fix duplicate extern declarations

From: Florian Fainelli

Date: Mon Nov 16 2026 - 12:31:47 EST


On 11/14/26 08:55, Safocl Stollmannovic wrote:
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>

I applied v2 which was not different to this tree:

https://github.com/Broadcom/stblinux/commit/0cab822bca7a59667774725b83e948b71462290f

the subject was reworded because yours was not specific enough and did not match contributions made to this file previously.
--
Florian