Skip to contentSkip to conversation

scripts/checkpatch.pl: fix false warning of externschecking.

PATCH Joe Perches 1 participant 1 message Oct 11, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · On Wed, 2017-10-11 at 11:21 +0800, [email protected] wrote:
Quoted 7 lines · Jiang Biao
Quoted 3 lines

When adding a function declaration in a .c file without an extern keywork decoration, checkpatch.pl will complain *externs should be avoided in .c files* false warning. This patch fix the bug.

nack.
The point is that external function declarations should be done via #include.

Hi Joe,

Hello Jiang

Quoted 7 lines

Understood. But there are already some external function declarations in .c files in current kernel, for instance line 505 in kernel/stop_machine.c,

extern void sched_set_stop_task(int cpu, struct task_struct *stop);

Should these be fixed? But maybe in some rare cases, external funciton declarations in .c files are necessary.

Perhaps, but in those cases checkpatch messages should be ignored.

cheers, Joe