Re: kfifo must_check warning (+ patch)

From: Stefani Seibold
Date: Wed Oct 20 2010 - 16:54:07 EST


The problem should be fixed. I renamed the __kfifo_must_check_helper()
into __kfifo_uint_must_check_helper() and add a new
__kfifo_int_must_check_helper() which is now used for kfifo_alloc().

A kernel linux 2.6.36-rc compiled with gcc 4.4.4 doesn't show the
warning.

There a only two functions which return a int: kfifo_alloc() and
kfifo_init(). The later one does not make use of
__kfifo_int_must_check_helper(), but this could be change if required.

I will send the patch in a separate mail.

Am Mittwoch, den 20.10.2010, 11:56 -0700 schrieb Andrew Morton:
> On Wed, 20 Oct 2010 19:37:02 +0100
> Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > > Some versions of gcc mysteriously report:
> > > drivers/char/n_gsm.c:1580: warning: ignoring return value of '__kfifo_must_check_helper', declared with attribute warn_unused_result
> > >
> > > This warning can be eliminated by using a local variable for the
> > > returned result value, as suggested by Andrew Morton.
> >
> > But that just hides the bug in the helper surely - the helper has type
> > errors so needs fixing - not this. If you apply this then the underlying
> > bug is just going to get forgotten
> >
>
> It won't get forgotten.
>
> I agree that the warning is probably an artifact of the signedness
> thing. So for 2.6.36, disabling __kfifo_must_check_helper() will
> suffice. I'm sure that Stefani will fix up __kfifo_must_check_helper()
> for real for 2.6.37, then we can see if the warning reoccurs.


--
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/