* [PATCH] x86, dumpstack: Fix unused variable warning. @ 2010-11-24 9:19 Rakib Mullick 2010-11-24 9:57 ` Jesper Juhl 2010-11-24 13:19 ` Frederic Weisbecker 0 siblings, 2 replies; 12+ messages in thread From: Rakib Mullick @ 2010-11-24 9:19 UTC (permalink / raw) To: Ingo Molnar; +Cc: Frederic Weisbecker, LKML, x86 With allnoconfig, bp becomes unused. So put bp into defination of CONFIG_FRAME_POINTER. arch/x86/kernel/dumpstack.c: In function ‘dump_stack’: arch/x86/kernel/dumpstack.c:200: warning: unused variable ‘bp’ Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> --- diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 8474c99..fc5a253 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -197,10 +197,10 @@ void show_stack(struct task_struct *task, unsigned long *sp) */ void dump_stack(void) { - unsigned long bp = 0; unsigned long stack; #ifdef CONFIG_FRAME_POINTER + unsigned long bp = 0; if (!bp) get_bp(bp); #endif ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 9:19 [PATCH] x86, dumpstack: Fix unused variable warning Rakib Mullick @ 2010-11-24 9:57 ` Jesper Juhl 2010-11-24 10:26 ` Rakib Mullick 2010-11-25 4:07 ` Valdis.Kletnieks 2010-11-24 13:19 ` Frederic Weisbecker 1 sibling, 2 replies; 12+ messages in thread From: Jesper Juhl @ 2010-11-24 9:57 UTC (permalink / raw) To: Rakib Mullick; +Cc: Ingo Molnar, Frederic Weisbecker, LKML, x86 [-- Attachment #1: Type: TEXT/PLAIN, Size: 1187 bytes --] On Wed, 24 Nov 2010, Rakib Mullick wrote: > With allnoconfig, bp becomes unused. So put bp into defination of > CONFIG_FRAME_POINTER. > > arch/x86/kernel/dumpstack.c: In function ‘dump_stack’: > arch/x86/kernel/dumpstack.c:200: warning: unused variable ‘bp’ > > Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> > --- > > diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c > index 8474c99..fc5a253 100644 > --- a/arch/x86/kernel/dumpstack.c > +++ b/arch/x86/kernel/dumpstack.c > @@ -197,10 +197,10 @@ void show_stack(struct task_struct *task, > unsigned long *sp) > */ > void dump_stack(void) > { > - unsigned long bp = 0; > unsigned long stack; > > #ifdef CONFIG_FRAME_POINTER > + unsigned long bp = 0; > if (!bp) > get_bp(bp); > #endif So, now the bp variable does not exist at all if CONFIG_FRAME_POINTER is not defined. That's going to make this line : show_trace(NULL, NULL, &stack, bp); found further down in the dump_stack() function, quite unhappy. -- Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/ Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 9:57 ` Jesper Juhl @ 2010-11-24 10:26 ` Rakib Mullick 2010-11-24 13:01 ` Frederic Weisbecker 2010-11-25 4:07 ` Valdis.Kletnieks 1 sibling, 1 reply; 12+ messages in thread From: Rakib Mullick @ 2010-11-24 10:26 UTC (permalink / raw) To: Jesper Juhl; +Cc: Ingo Molnar, Frederic Weisbecker, LKML, x86 On Wed, Nov 24, 2010 at 3:57 PM, Jesper Juhl <jj@chaosbits.net> wrote: > On Wed, 24 Nov 2010, Rakib Mullick wrote: > > > So, now the bp variable does not exist at all if CONFIG_FRAME_POINTER is > not defined. Yes - right. And its not used outside CONFIG_FRAME_POINTER. > That's going to make this line : > > show_trace(NULL, NULL, &stack, bp); > Not clear what are you trying to say. Would you please, clear it up a bit? > found further down in the dump_stack() function, quite unhappy. > > > -- > Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/ > Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html > Plain text mails only, please. > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 10:26 ` Rakib Mullick @ 2010-11-24 13:01 ` Frederic Weisbecker 2010-11-24 13:53 ` Jesper Juhl 2010-11-25 5:36 ` Rakib Mullick 0 siblings, 2 replies; 12+ messages in thread From: Frederic Weisbecker @ 2010-11-24 13:01 UTC (permalink / raw) To: Rakib Mullick; +Cc: Jesper Juhl, Ingo Molnar, LKML, x86 On Wed, Nov 24, 2010 at 04:26:01PM +0600, Rakib Mullick wrote: > On Wed, Nov 24, 2010 at 3:57 PM, Jesper Juhl <jj@chaosbits.net> wrote: > > On Wed, 24 Nov 2010, Rakib Mullick wrote: > > > > > > So, now the bp variable does not exist at all if CONFIG_FRAME_POINTER is > > not defined. > > Yes - right. And its not used outside CONFIG_FRAME_POINTER. > > > That's going to make this line : > > > > show_trace(NULL, NULL, &stack, bp); > > > Not clear what are you trying to say. Would you please, clear it up a bit? I think Jesper is confused because your patch applies on -tip (tip/master or tip/perf/core) where we have zapped the bp argument from show_trace() lately. But in the mainline, show_trace() still has the bp argument. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 13:01 ` Frederic Weisbecker @ 2010-11-24 13:53 ` Jesper Juhl 2010-11-25 5:36 ` Rakib Mullick 1 sibling, 0 replies; 12+ messages in thread From: Jesper Juhl @ 2010-11-24 13:53 UTC (permalink / raw) To: Frederic Weisbecker; +Cc: Rakib Mullick, Ingo Molnar, LKML, x86 [-- Attachment #1: Type: TEXT/PLAIN, Size: 1086 bytes --] On Wed, 24 Nov 2010, Frederic Weisbecker wrote: > On Wed, Nov 24, 2010 at 04:26:01PM +0600, Rakib Mullick wrote: > > On Wed, Nov 24, 2010 at 3:57 PM, Jesper Juhl <jj@chaosbits.net> wrote: > > > On Wed, 24 Nov 2010, Rakib Mullick wrote: > > > > > > > > > So, now the bp variable does not exist at all if CONFIG_FRAME_POINTER is > > > not defined. > > > > Yes - right. And its not used outside CONFIG_FRAME_POINTER. > > > > > That's going to make this line : > > > > > > show_trace(NULL, NULL, &stack, bp); > > > > > Not clear what are you trying to say. Would you please, clear it up a bit? > > > I think Jesper is confused because your patch applies on -tip (tip/master or > tip/perf/core) where we have zapped the bp argument from show_trace() lately. > > But in the mainline, show_trace() still has the bp argument. Ahh yes, my mistake. I checked the code in mainline. Sorry about the confusion. -- Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/ Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 13:01 ` Frederic Weisbecker 2010-11-24 13:53 ` Jesper Juhl @ 2010-11-25 5:36 ` Rakib Mullick 1 sibling, 0 replies; 12+ messages in thread From: Rakib Mullick @ 2010-11-25 5:36 UTC (permalink / raw) To: Frederic Weisbecker; +Cc: Jesper Juhl, Ingo Molnar, LKML, x86 On Wed, Nov 24, 2010 at 7:01 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote: > On Wed, Nov 24, 2010 at 04:26:01PM +0600, Rakib Mullick wrote: >> On Wed, Nov 24, 2010 at 3:57 PM, Jesper Juhl <jj@chaosbits.net> wrote: > > I think Jesper is confused because your patch applies on -tip (tip/master or > tip/perf/core) where we have zapped the bp argument from show_trace() lately. > Yes, the patch was made against tip/master. > But in the mainline, show_trace() still has the bp argument. > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 9:57 ` Jesper Juhl 2010-11-24 10:26 ` Rakib Mullick @ 2010-11-25 4:07 ` Valdis.Kletnieks 2010-11-25 6:30 ` Frederic Weisbecker 1 sibling, 1 reply; 12+ messages in thread From: Valdis.Kletnieks @ 2010-11-25 4:07 UTC (permalink / raw) To: Jesper Juhl; +Cc: Rakib Mullick, Ingo Molnar, Frederic Weisbecker, LKML, x86 [-- Attachment #1: Type: text/plain, Size: 1016 bytes --] On Wed, 24 Nov 2010 10:57:10 +0100, Jesper Juhl said: > On Wed, 24 Nov 2010, Rakib Mullick wrote: > > diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c > > index 8474c99..fc5a253 100644 > > --- a/arch/x86/kernel/dumpstack.c > > +++ b/arch/x86/kernel/dumpstack.c > > @@ -197,10 +197,10 @@ void show_stack(struct task_struct *task, > > unsigned long *sp) > > */ > > void dump_stack(void) > > { > > - unsigned long bp = 0; > > unsigned long stack; > > > > #ifdef CONFIG_FRAME_POINTER > > + unsigned long bp = 0; > > if (!bp) > > get_bp(bp); > > #endif > > So, now the bp variable does not exist at all if CONFIG_FRAME_POINTER is > not defined. > That's going to make this line : > > show_trace(NULL, NULL, &stack, bp); > > found further down in the dump_stack() function, quite unhappy. OK, I'll bite. Why does the original say 'unsigned long bp = 0;' and then turns around and has an 'if (!bp)' check? Why is the conditional there? [-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-25 4:07 ` Valdis.Kletnieks @ 2010-11-25 6:30 ` Frederic Weisbecker 0 siblings, 0 replies; 12+ messages in thread From: Frederic Weisbecker @ 2010-11-25 6:30 UTC (permalink / raw) To: Valdis.Kletnieks; +Cc: Jesper Juhl, Rakib Mullick, Ingo Molnar, LKML, x86 Le Wed, 24 Nov 2010 23:07:47 -0500, Valdis.Kletnieks@vt.edu a écrit : > On Wed, 24 Nov 2010 10:57:10 +0100, Jesper Juhl said: > > > On Wed, 24 Nov 2010, Rakib Mullick wrote: > > > > diff --git a/arch/x86/kernel/dumpstack.c > > > b/arch/x86/kernel/dumpstack.c index 8474c99..fc5a253 100644 > > > --- a/arch/x86/kernel/dumpstack.c > > > +++ b/arch/x86/kernel/dumpstack.c > > > @@ -197,10 +197,10 @@ void show_stack(struct task_struct *task, > > > unsigned long *sp) > > > */ > > > void dump_stack(void) > > > { > > > - unsigned long bp = 0; > > > unsigned long stack; > > > > > > #ifdef CONFIG_FRAME_POINTER > > > + unsigned long bp = 0; > > > if (!bp) > > > get_bp(bp); > > > #endif > > > > So, now the bp variable does not exist at all if > > CONFIG_FRAME_POINTER is not defined. > > That's going to make this line : > > > > show_trace(NULL, NULL, &stack, bp); > > > > found further down in the dump_stack() function, quite unhappy. > > OK, I'll bite. Why does the original say 'unsigned long bp = 0;' and > then turns around and has an 'if (!bp)' check? Why is the > conditional there? The original check was indeed not necessary. But now the whole block should be removed anyway. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 9:19 [PATCH] x86, dumpstack: Fix unused variable warning Rakib Mullick 2010-11-24 9:57 ` Jesper Juhl @ 2010-11-24 13:19 ` Frederic Weisbecker 2010-11-25 5:35 ` Rakib Mullick 1 sibling, 1 reply; 12+ messages in thread From: Frederic Weisbecker @ 2010-11-24 13:19 UTC (permalink / raw) To: Rakib Mullick; +Cc: Ingo Molnar, LKML, x86 2010/11/24 Rakib Mullick <rakib.mullick@gmail.com>: > With allnoconfig, bp becomes unused. So put bp into defination of > CONFIG_FRAME_POINTER. > > arch/x86/kernel/dumpstack.c: In function ‘dump_stack’: > arch/x86/kernel/dumpstack.c:200: warning: unused variable ‘bp’ > > Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> > --- > > diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c > index 8474c99..fc5a253 100644 > --- a/arch/x86/kernel/dumpstack.c > +++ b/arch/x86/kernel/dumpstack.c > @@ -197,10 +197,10 @@ void show_stack(struct task_struct *task, > unsigned long *sp) > */ > void dump_stack(void) > { > - unsigned long bp = 0; > unsigned long stack; > > #ifdef CONFIG_FRAME_POINTER > + unsigned long bp = 0; > if (!bp) > get_bp(bp); > #endif > Looks like you can even remove that block. bp is not used any more in this function. get_bp() was only loading bp but did not make any use of it. Thanks. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-24 13:19 ` Frederic Weisbecker @ 2010-11-25 5:35 ` Rakib Mullick 2010-11-25 6:32 ` Frederic Weisbecker 2011-01-08 12:06 ` [tip:perf/urgent] " tip-bot for Rakib Mullick 0 siblings, 2 replies; 12+ messages in thread From: Rakib Mullick @ 2010-11-25 5:35 UTC (permalink / raw) To: Frederic Weisbecker; +Cc: Ingo Molnar, LKML, x86, sandmann On Wed, Nov 24, 2010 at 7:19 PM, Frederic Weisbecker <fweisbec@gmail.com> wrote: > 2010/11/24 Rakib Mullick <rakib.mullick@gmail.com>: > > Looks like you can even remove that block. bp is not used any more in > this function. > get_bp() was only loading bp but did not make any use of it. Yes, right. Here is the updated one. In dump_stack function, bp isn't used anymore, which is introduced by commit 9c0729dc8062bed96189bd14ac6d4920f3958743. This patch removes bp completely. Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> --- diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 8474c99..d6fb146 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -197,14 +197,8 @@ void show_stack(struct task_struct *task, unsigned long *sp) */ void dump_stack(void) { - unsigned long bp = 0; unsigned long stack; -#ifdef CONFIG_FRAME_POINTER - if (!bp) - get_bp(bp); -#endif - printk("Pid: %d, comm: %.20s %s %s %.*s\n", current->pid, current->comm, print_tainted(), init_utsname()->release, > > Thanks. > ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] x86, dumpstack: Fix unused variable warning. 2010-11-25 5:35 ` Rakib Mullick @ 2010-11-25 6:32 ` Frederic Weisbecker 2011-01-08 12:06 ` [tip:perf/urgent] " tip-bot for Rakib Mullick 1 sibling, 0 replies; 12+ messages in thread From: Frederic Weisbecker @ 2010-11-25 6:32 UTC (permalink / raw) To: Rakib Mullick; +Cc: Ingo Molnar, LKML, x86, sandmann Le Thu, 25 Nov 2010 11:35:16 +0600, Rakib Mullick <rakib.mullick@gmail.com> a écrit : > On Wed, Nov 24, 2010 at 7:19 PM, Frederic Weisbecker > <fweisbec@gmail.com> wrote: > > 2010/11/24 Rakib Mullick <rakib.mullick@gmail.com>: > > > > Looks like you can even remove that block. bp is not used any more > > in this function. > > get_bp() was only loading bp but did not make any use of it. > > Yes, right. Here is the updated one. > > In dump_stack function, bp isn't used anymore, which is introduced by > commit 9c0729dc8062bed96189bd14ac6d4920f3958743. This patch removes bp > completely. > > > Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> > --- > > diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c > index 8474c99..d6fb146 100644 > --- a/arch/x86/kernel/dumpstack.c > +++ b/arch/x86/kernel/dumpstack.c > @@ -197,14 +197,8 @@ void show_stack(struct task_struct *task, > unsigned long *sp) > */ > void dump_stack(void) > { > - unsigned long bp = 0; > unsigned long stack; > > -#ifdef CONFIG_FRAME_POINTER > - if (!bp) > - get_bp(bp); > -#endif > - > printk("Pid: %d, comm: %.20s %s %s %.*s\n", > current->pid, current->comm, print_tainted(), > init_utsname()->release, > Queued, thanks! ^ permalink raw reply [flat|nested] 12+ messages in thread
* [tip:perf/urgent] x86, dumpstack: Fix unused variable warning 2010-11-25 5:35 ` Rakib Mullick 2010-11-25 6:32 ` Frederic Weisbecker @ 2011-01-08 12:06 ` tip-bot for Rakib Mullick 1 sibling, 0 replies; 12+ messages in thread From: tip-bot for Rakib Mullick @ 2011-01-08 12:06 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, hpa, mingo, rakib.mullick, a.p.zijlstra, fweisbec, sandmann, tglx, mingo Commit-ID: 39a6eebda253aa34d659ca9436e3c32ef60473f1 Gitweb: http://git.kernel.org/tip/39a6eebda253aa34d659ca9436e3c32ef60473f1 Author: Rakib Mullick <rakib.mullick@gmail.com> AuthorDate: Fri, 7 Jan 2011 16:59:49 +0100 Committer: Frederic Weisbecker <fweisbec@gmail.com> CommitDate: Fri, 7 Jan 2011 16:59:49 +0100 x86, dumpstack: Fix unused variable warning In dump_stack function, bp isn't used anymore, which is introduced by commit 9c0729dc8062bed96189bd14ac6d4920f3958743. This patch removes bp completely. Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Cc: Soeren Sandmann <sandmann@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@zytor.com> LKML-Reference: <AANLkTik9U_Z0WSZ7YjrykER_pBUfPDdgUUmtYx=R74nL@mail.gmail.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> --- arch/x86/kernel/dumpstack.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 8474c99..d6fb146 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -197,14 +197,8 @@ void show_stack(struct task_struct *task, unsigned long *sp) */ void dump_stack(void) { - unsigned long bp = 0; unsigned long stack; -#ifdef CONFIG_FRAME_POINTER - if (!bp) - get_bp(bp); -#endif - printk("Pid: %d, comm: %.20s %s %s %.*s\n", current->pid, current->comm, print_tainted(), init_utsname()->release, ^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-01-08 12:07 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-11-24 9:19 [PATCH] x86, dumpstack: Fix unused variable warning Rakib Mullick 2010-11-24 9:57 ` Jesper Juhl 2010-11-24 10:26 ` Rakib Mullick 2010-11-24 13:01 ` Frederic Weisbecker 2010-11-24 13:53 ` Jesper Juhl 2010-11-25 5:36 ` Rakib Mullick 2010-11-25 4:07 ` Valdis.Kletnieks 2010-11-25 6:30 ` Frederic Weisbecker 2010-11-24 13:19 ` Frederic Weisbecker 2010-11-25 5:35 ` Rakib Mullick 2010-11-25 6:32 ` Frederic Weisbecker 2011-01-08 12:06 ` [tip:perf/urgent] " tip-bot for Rakib Mullick
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox