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

From: Cornelia Huck
Date: Thu May 08 2008 - 03:35:19 EST


On Thu, 08 May 2008 07:43:41 +1000,
Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote:

> You prefer a crippled ABI or a machine that doesn't boot with no console
> at all to see what happened because the console driver refused to
> initialize due to such a sysfs file conflict ?

So it really depends on the driver, doesn't it?

If the file isn't vital, ignore the return code (sysfs will already
complain). If things will break, fail the device registration.

> What I'm saying is basically that rather than have a test & printk in
> every bloody driver, we are better off having it once in the function
> itself (bloat ?)

A centralized printk makes sense, sure (and it is already in place for
duplicate entries).

>
> In addition, in most cases, failure of initializing the driver is -not-
> the right solution, so the driver should probably just warn, which can
> as well be done by ... having sysfs_create_file() itself do the warning.

sysfs_add_one() does it :)

I was under the impression that failing the initialization was usually
the right thing to do, since we end up with an un-configurable,
un-usable device. But that may be coloured by my experience with s390
devices, where we rely on sysfs attributes extensively. If indeed most
sysfs files are non-vital, removing the __must_check and relying on a
scary warning in the core may be fine. (OTOH, adding checks to the core
has helped us to find some lurking bugs.)

> > Which of the current __must_check functions do you think should have
> > the __must_check removed?
>
> sysfs_create_file is a good candidate imho :-)

:)

I was thinking more about functions like bus_rescan_devices(). Any
others?
--
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/