Re: [RFC PATCH 0/3] Mark literal strings in __init / __exit code

From: Joe Perches
Date: Wed Jun 25 2014 - 07:22:51 EST


On Wed, 2014-06-25 at 10:34 +0200, Mathias Krause wrote:
> On 25 June 2014 09:48, Joe Perches <joe@xxxxxxxxxxx> wrote:
> > On Wed, 2014-06-25 at 09:35 +0200, Rasmus Villemoes wrote:
> >> Speaking of dangling pointers: A similar disaster would happen if some
> >> code containing pi_* calls gets copy-pasted to some non-__init
> >> function.
> >
> > This is my biggest issue with adding these new,
> > somewhat obscure macros.
>
> modpost will handle these cases.

If so, then I don't see a problem.

> >> Could checkpatch learn to warn about calling these functions
> >> from the wrong context?
> >
> > It's not possible. checkpatch works on patch chunks.
> > Any patch chunk may not contain the function attributes.
>
> checkpatch.pl -f might detect them, though :/

Something like your awk script would be easier.


--
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/