Re: checkpatch and kernel/sched.c

From: Sam Ravnborg
Date: Mon Oct 01 2007 - 03:49:17 EST


> >
> > > WARNING: externs should be avoided in .c files
> > > #6545: FILE: home/apw/git/linux-2.6/kernel/sched.c:6542:
> > > + extern char __sched_text_start[], __sched_text_end[];
> > >
> > > That one ... dunno. This check is a difficult one. Should it be a
> > > CHECK?
> >
> > no, this is a legitimate warning - externs in .c files should move into
> > the proper .h file. So i'd suggest to keep this a WARNING.
>
> Yes. When the symbol is defined in .S or vmlinux.lds we have
> traditionally declared it in .c.
>
> But why? It _is_ a global symbol. We might as well declare it in .h.
> That's consistent, and prevents duplicated declarations from popping up
> later on.
It would be nice to collect all linker symbol externs in one place..
asm-$(ARCH)/???.h

We could even auto-generate it but thats not worth it I think.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/