[PATCH] kernel: Fix ftrace.c compiler warning when callingftrace_nop_replace()

From: Eduardo Silva
Date: Sun May 22 2011 - 21:19:50 EST

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@xxxxxxxxx>
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);

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/