lkml.org 
[lkml]   [2010]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86, dumpstack: Fix unused variable warning.
From
Date
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?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2010-11-25 05:11    [W:0.068 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site