Re: [PATCH] Silence 'ignoring return value' warnings indrivers/video/aty/radeon_base.c

From: Andrew Morton
Date: Tue May 06 2008 - 17:57:34 EST


On Tue, 06 May 2008 14:43:01 -0700 (PDT)
David Miller <davem@xxxxxxxxxxxxx> wrote:

> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Date: Tue, 6 May 2008 14:39:36 -0700
>
> > On Thu, 24 Apr 2008 14:34:01 +1000
> > tony@xxxxxxxxxxxxxxxxxx (Tony Breeds) wrote:
> >
> > > Current kernel builds warn about:
> > > drivers/video/aty/radeon_base.c: In function 'radeonfb_pci_register':
> > > drivers/video/aty/radeon_base.c:2334: warning: ignoring return value of 'sysfs_create_bin_file', declared with attribute warn_unused_result
> > > drivers/video/aty/radeon_base.c:2336: warning: ignoring return value of 'sysfs_create_bin_file', declared with attribute warn_unused_result
> > >
> > > Do minimal checking of these functions and issue a warning if either
> > > fails. They don't seem to be critical..
> >
> > well OK, but I object to the patch title!
> >
> > The point isn't to silence warnings. It is to fix the problem which that
> > warning is drawing our attention to.
> >
> > So I rewrote the title to "drivers/video/aty/radeon_base.c: notify user if
> > sysfs_create_bin_file() failed".
> >
> > And your fix looks appropriate - if sysfs_create_bin_file() fails we will now get
> > reports of this and we can find out what kernel bug caused this to happen.
>
> The last time someone "fixed" this warning in the radeon driver,
> people lost their consoles.
>
> Just giving a heads up...

heh, thanks.

This one just emits a warning:

@@ -2340,9 +2341,12 @@ static int __devinit radeonfb_pci_regist

/* Register some sysfs stuff (should be done better) */
if (rinfo->mon1_EDID)
- sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid1_attr);
+ err |= sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid1_attr);
if (rinfo->mon2_EDID)
- sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr);
+ err |= sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr);
+ if (err)
+ pr_warning("%s() Creating sysfs files failed, continuing\n",
+ __func__);

/* save current mode regs before we switch into the new one
* so we can restore this upon __exit
_


So from what you say, it sounds like we will be seeing that warning. I
wonder why.
--
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/