From: Luca Tettamanti <kronos.it@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: [PATCH 2.6.19-rc1] radeonfb: check return value of sysfs_create_bin_file
Date: Thu, 12 Oct 2006 17:45:05 +0200 [thread overview]
Message-ID: <20061012154505.GA6014@dreamland.darkstar.lan> (raw)
In-Reply-To: <1160611646.4792.24.camel@localhost.localdomain>
Il Thu, Oct 12, 2006 at 10:07:26AM +1000, Benjamin Herrenschmidt ha scritto:
> On Thu, 2006-10-12 at 01:53 +0200, Luca Tettamanti wrote:
> > sysfs_create_bin_file() is marked as warn_unused_result but we don't
> > actually check the return value.
> > Error is not fatal, the driver can operate fine without the files so
> > just print a notice on failure.
>
> I find this whole business of must check return value for sysfs files to
> be gratuitous bloat. There are many cases (like this one) where we don't
> really care and a printk will just increase the kernel size for no good
> reason.
>
> Maybe we can have a macro we can use to silence the warning when we
> don't care about the result ? Can gcc do that ?
Ugly macro:
#define UNCHECKED(func) do { if (func) {} } while(0)
maybe it's better to have something like this:
int __sysfs_create_bin_file(...);
inline int sysfs_create_bin_file(...) __attribute__((warn_unused_result));
inline int sysfs_create_bin_file(...) {
return __sysfs_create_bin_file(...);
}
i.e. both checked and uncheck version of the same function.
Luca
--
Un apostolo vedendo Gesu` camminare sulle acque:
- Cazzo se e` buono 'sto fumo!!!
next prev parent reply other threads:[~2006-10-12 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 23:53 Luca Tettamanti
2006-10-12 0:07 ` Benjamin Herrenschmidt
2006-10-12 15:45 ` Luca Tettamanti [this message]
2006-10-12 15:54 ` Andreas Schwab
2006-10-12 16:05 ` Luca Tettamanti
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=20061012154505.GA6014@dreamland.darkstar.lan \
--to=kronos.it@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/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®