All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Silva <edsiper@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] kernel: Fix ftrace.c compiler warning when calling ftrace_nop_replace()
Date: Sun, 22 May 2011 21:19:08 -0400	[thread overview]
Message-ID: <1306113548.29789.2.camel@monotop> (raw)

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@gmail.com>
---
 arch/x86/kernel/ftrace.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 0ba15a6..b44c3c9 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -305,7 +305,7 @@ int ftrace_make_nop(struct module *mod,
 	unsigned long ip = rec->ip;
 
 	old = ftrace_call_replace(ip, addr);
-	new = ftrace_nop_replace();
+	new = (unsigned char *) ftrace_nop_replace();
 
 	return ftrace_modify_code(rec->ip, old, new);
 }
@@ -315,7 +315,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
 	unsigned char *new, *old;
 	unsigned long ip = rec->ip;
 
-	old = ftrace_nop_replace();
+	old = (unsigned char *) ftrace_nop_replace();
 	new = ftrace_call_replace(ip, addr);
 
 	return ftrace_modify_code(rec->ip, old, new);
-- 
1.7.4.1




             reply	other threads:[~2011-05-23  1:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23  1:19 Eduardo Silva [this message]
2011-05-23  1:36 ` [PATCH] kernel: Fix ftrace.c compiler warning when calling ftrace_nop_replace() H. Peter Anvin
2011-05-23  2:27   ` Eduardo Silva
2011-05-23 13:08   ` Steven Rostedt
2011-05-23 20:01     ` John Kacur
2011-05-23 20:05       ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306113548.29789.2.camel@monotop \
    --to=edsiper@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.