[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTi=fuEzCUnK0Vuc-2WAnKUxEyG_VWw@mail.gmail.com>
Date: Sun, 22 May 2011 22:27:35 -0400
From: Eduardo Silva <edsiper@...il.com>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel: Fix ftrace.c compiler warning when calling ftrace_nop_replace()
On Sun, May 22, 2011 at 9:36 PM, H. Peter Anvin <hpa@...or.com> wrote:
> On 05/22/2011 06:19 PM, Eduardo Silva wrote:
>> the function ftrace_nop_replace() returns a 'static const unsigned char *'
>> value, so when the caller perform a direct assignment to a
>> 'static unsigned char *', the compiler raise the following warning message:
>>
>> ftrace.c:308:6: warning: assignment discards qualifiers from pointer target type
>> ftrace.c:318:6: warning: assignment discards qualifiers from pointer target type
>>
>> Adding the proper casts the message goes away.
>>
>> Signed-off-by: Eduardo Silva <edsiper@...il.com>
>
> This quiets a warning of something that potentially looks like a real
> bug. Perhaps "new" should be const?
The value is returned in the following function:
static const unsigned char *ftrace_nop_replace(void)
{
return ideal_nops[NOP_ATOMIC5];
}
ideal_nops seems to be constant and architecture dependent, so make
sense to return it as a constant pointer... i think that we need more
comments about it.
regards,
>
> -hpa
>
>
> --
> H. Peter Anvin, Intel Open Source Technology Center
> I work for Intel. I don't speak on their behalf.
>
>
--
Eduardo Silva
http://edsiper.linuxchile.cl
http://www.monkey-project.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists