Re: [PATCH 2/3] x86, cpu: Clean up and unify the NOP selectioninfrastructure

From: Steven Rostedt
Date: Mon Apr 18 2011 - 19:59:09 EST


On Mon, 2011-04-18 at 16:39 -0700, H. Peter Anvin wrote:
> On 04/18/2011 04:31 PM, Steven Rostedt wrote:
> >
> > Can we please add a comment to this. The original (above) was confusing
> > enough, but at least it used asm() so it wasn't that bad to figure out.
> > Or at least the asm() usage would trigger in one's mind to think "Damn!
> > They chose to use 'asm', it must be some kind of nasty trick. Let's take
> > a better look at WTF they are doing!".
> >
> > Now the use a normal character array actual makes this even more subtle.
>
> OK... I never thought it was particularly subtle, but okay.

It took me 2 minutes to figure out what it was doing, but then maybe I'm
slow ;) But having a comment may save a minute or two of frustration
from other reviewers as well.

>
> A much bigger issue with this particular patch is that the
> __init{data,const}_or_module presumably needs to be removed from these
> structures, right?

Ah, as you have this:


> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -260,9 +260,9 @@ do_ftrace_mod_code(unsigned long ip, void
> *new_code)
> return mod_code_status;
> }
>
> -static unsigned char *ftrace_nop_replace(void)
> +static const unsigned char *ftrace_nop_replace(void)
> {
> - return ideal_nop5;
> + return ideal_nops[NOP_ATOMIC5];
> }
>
I would say, yes get rid of the init annotations.

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