public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: suppress trivial sparse signedness warnings
@ 2008-09-23 22:05 Harvey Harrison
  2008-09-23 23:46 ` Mathieu Desnoyers
  2008-09-24  7:55 ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: Harvey Harrison @ 2008-09-23 22:05 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: Ingo Molnar, LKML

Could just as easily change the three casts to cast to the correct
type...this patch changes the type of ftrace_nop instead.

Supresses sparse warnings:
arch/x86/kernel/ftrace.c:157:14: warning: incorrect type in assignment (different signedness)
arch/x86/kernel/ftrace.c:157:14:    expected long *static [toplevel] ftrace_nop
arch/x86/kernel/ftrace.c:157:14:    got unsigned long *<noident>
arch/x86/kernel/ftrace.c:161:14: warning: incorrect type in assignment (different signedness)
arch/x86/kernel/ftrace.c:161:14:    expected long *static [toplevel] ftrace_nop
arch/x86/kernel/ftrace.c:161:14:    got unsigned long *<noident>
arch/x86/kernel/ftrace.c:165:14: warning: incorrect type in assignment (different signedness)
arch/x86/kernel/ftrace.c:165:14:    expected long *static [toplevel] ftrace_nop
arch/x86/kernel/ftrace.c:165:14:    got unsigned long *<noident>

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 arch/x86/kernel/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 082d996..66d9002 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -22,7 +22,7 @@
 
 
 /* Long is fine, even if it is only 4 bytes ;-) */
-static long *ftrace_nop;
+static unsigned long *ftrace_nop;
 
 union ftrace_code_union {
 	char code[MCOUNT_INSN_SIZE];
-- 
1.6.0.2.471.g47a76




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: suppress trivial sparse signedness warnings
  2008-09-23 22:05 [PATCH] x86: suppress trivial sparse signedness warnings Harvey Harrison
@ 2008-09-23 23:46 ` Mathieu Desnoyers
  2008-09-24  7:55 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2008-09-23 23:46 UTC (permalink / raw)
  To: Steven Rostedt, Harvey Harrison; +Cc: Ingo Molnar, LKML

This should probably go to Steven...

* Harvey Harrison (harvey.harrison@gmail.com) wrote:
> Could just as easily change the three casts to cast to the correct
> type...this patch changes the type of ftrace_nop instead.
> 
> Supresses sparse warnings:
> arch/x86/kernel/ftrace.c:157:14: warning: incorrect type in assignment (different signedness)
> arch/x86/kernel/ftrace.c:157:14:    expected long *static [toplevel] ftrace_nop
> arch/x86/kernel/ftrace.c:157:14:    got unsigned long *<noident>
> arch/x86/kernel/ftrace.c:161:14: warning: incorrect type in assignment (different signedness)
> arch/x86/kernel/ftrace.c:161:14:    expected long *static [toplevel] ftrace_nop
> arch/x86/kernel/ftrace.c:161:14:    got unsigned long *<noident>
> arch/x86/kernel/ftrace.c:165:14: warning: incorrect type in assignment (different signedness)
> arch/x86/kernel/ftrace.c:165:14:    expected long *static [toplevel] ftrace_nop
> arch/x86/kernel/ftrace.c:165:14:    got unsigned long *<noident>
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
>  arch/x86/kernel/ftrace.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index 082d996..66d9002 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -22,7 +22,7 @@
>  
>  
>  /* Long is fine, even if it is only 4 bytes ;-) */
> -static long *ftrace_nop;
> +static unsigned long *ftrace_nop;
>  
>  union ftrace_code_union {
>  	char code[MCOUNT_INSN_SIZE];
> -- 
> 1.6.0.2.471.g47a76
> 
> 
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: suppress trivial sparse signedness warnings
  2008-09-23 22:05 [PATCH] x86: suppress trivial sparse signedness warnings Harvey Harrison
  2008-09-23 23:46 ` Mathieu Desnoyers
@ 2008-09-24  7:55 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-09-24  7:55 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Mathieu Desnoyers, LKML, Steven Rostedt


* Harvey Harrison <harvey.harrison@gmail.com> wrote:

> Could just as easily change the three casts to cast to the correct
> type...this patch changes the type of ftrace_nop instead.
> 
> Supresses sparse warnings:
> arch/x86/kernel/ftrace.c:157:14: warning: incorrect type in assignment (different signedness)
> arch/x86/kernel/ftrace.c:157:14:    expected long *static [toplevel] ftrace_nop
> arch/x86/kernel/ftrace.c:157:14:    got unsigned long *<noident>
> arch/x86/kernel/ftrace.c:161:14: warning: incorrect type in assignment (different signedness)
> arch/x86/kernel/ftrace.c:161:14:    expected long *static [toplevel] ftrace_nop
> arch/x86/kernel/ftrace.c:161:14:    got unsigned long *<noident>
> arch/x86/kernel/ftrace.c:165:14: warning: incorrect type in assignment (different signedness)
> arch/x86/kernel/ftrace.c:165:14:    expected long *static [toplevel] ftrace_nop
> arch/x86/kernel/ftrace.c:165:14:    got unsigned long *<noident>
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

applied to tip/tracing/ftrace, thanks Harvey!

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-24  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-23 22:05 [PATCH] x86: suppress trivial sparse signedness warnings Harvey Harrison
2008-09-23 23:46 ` Mathieu Desnoyers
2008-09-24  7:55 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox