mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: benh@kernel.crashing.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	tony@bakeyournoodle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Silence 'ignoring return value' warnings in drivers/video/aty/radeon_base.c
Date: Thu, 8 May 2008 09:34:21 +0200	[thread overview]
Message-ID: <20080508093421.31cd735b@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1210196621.1421.5.camel@pasglop>

On Thu, 08 May 2008 07:43:41 +1000,
Benjamin Herrenschmidt <benh@kernel.crashing.org> 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?

  reply	other threads:[~2008-05-08  7:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24  4:34 Tony Breeds
2008-05-06 21:39 ` Andrew Morton
2008-05-06 21:43   ` David Miller
2008-05-06 21:56     ` Andrew Morton
2008-05-07  4:00       ` Arjan van de Ven
2008-05-07  4:12         ` Andrew Morton
2008-05-07  4:15           ` Arjan van de Ven
2008-05-07  4:20             ` Arjan van de Ven
2008-05-07  4:37               ` Benjamin Herrenschmidt
2008-05-07  4:23             ` Andrew Morton
2008-05-07  4:26               ` Andrew Morton
2008-05-07  4:41                 ` Arjan van de Ven
2008-05-07  4:37               ` Arjan van de Ven
2008-05-07  5:40           ` Paul Mackerras
2008-05-07  5:49             ` Benjamin Herrenschmidt
2008-05-07  0:54     ` Benjamin Herrenschmidt
2008-05-07  1:20       ` Andrew Morton
2008-05-07  4:33         ` Benjamin Herrenschmidt
2008-05-07  8:23           ` Cornelia Huck
2008-05-07 21:43             ` Benjamin Herrenschmidt
2008-05-08  7:34               ` Cornelia Huck [this message]
2008-05-08  7:49                 ` Benjamin Herrenschmidt
2008-05-08  8:36                   ` Cornelia Huck
2008-05-08 22:03                     ` Greg KH
2008-05-08 23:06                       ` Benjamin Herrenschmidt
2008-05-08 23:50                       ` Paul Mackerras
2008-05-09  0:02                         ` Harvey Harrison
2008-05-09  5:32                           ` Cornelia Huck
2008-05-09  5:33                           ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080508093421.31cd735b@gondolin.boeblingen.de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@bakeyournoodle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®