Re: [PATCH] pop previous section in alternative.c

From: Steven Rostedt
Date: Thu Apr 10 2008 - 10:11:41 EST




On Thu, 10 Apr 2008, Andy Whitcroft wrote:
> >
> > BTW it looks like the problem was added with 121d7bf5a246d282ba91234d03a4edf9ccc9c940,
> > signed off by me, sorry for not catching it in review.
> >
> > Perhaps that is something that would make sense adding to checkpatch.pl?
> > Complain for .section in inline assembler without .previous or popsection
> > (cc Andy). I think such a check would make sense.
>
> Do you have an example of such a bad thing? My only concern is this
> sounds like a check which could potentially need to see more lines than are
> available in the patch context and so the test might be rather unreliable.
>

>From commit 121d7bf5a246d282ba91234d03a4edf9ccc9c940:

get them easily into strings. */
-asm("\t.data\nintelnops: "
+asm("\t.section .rodata, \"a\"\nintelnops: "
GENERIC_NOP1 GENERIC_NOP2 GENERIC_NOP3 GENERIC_NOP4 GENERIC_NOP5 GENERIC
GENERIC_NOP7 GENERIC_NOP8);
-extern unsigned char intelnops[];


I would say anytime there's a "^+.*\.section" there had better be a
"^-.*\.section" or a "+.*.previous" matching it. Off hand I can't think of
any exceptions to this rule although I may be wrong.

-- Steve


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