Checkpatch false positive: externs should be avoided in .c files
From: Nam Cao
Date: Mon Feb 02 2026 - 07:05:35 EST
Hi,
checkpatch seems to give a wrong warning about this patch:
https://lore.kernel.org/linux-riscv/20260202115403.2119218-1-namcao@xxxxxxxxxxxxx/T/#u
WARNING: externs should be avoided in .c files
#663: FILE: arch/riscv/kernel/setup.c:49:
+atomic_t hart_lottery __section(".sdata");
I think this is wrong, because 'extern' does not even appear anywhere in
that part of the diff.
I attempted to look into checkpatch, but my perl knowledge is not
sufficient to dig deeper into this issue. Can you please have a look?
Best regards,
Nam