Re: [PATCH 1/4] Extend notifier_call_chain to count nr_calls made.

From: Gautham R Shenoy
Date: Wed Nov 22 2006 - 01:37:35 EST


Hi Andrew,

On Mon, Nov 20, 2006 at 10:19:41PM -0800, Andrew Morton wrote:

> > +
> > + if (nr_calls)
> > + *nr_calls ++;
>
> This gets
>
> kernel/sys.c: In function 'notifier_call_chain':
> kernel/sys.c:164: warning: value computed is not used
>
>
> And indeed, this code doesn't work.
>
> What happened?

I didn't get the warnings because my test box still has the prehistoric
version 3.4.4 of gcc.
I compiled the code with gcc 4.1.1 and got the warnings.

The code does not work because of my carelessness.
It should have been (*nr_calls)++ in the first place. I apologise.

Thanks for fixing it.

Regards
gautham.
--
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"
-
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/