lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061012154505.GA6014@dreamland.darkstar.lan>
Date:	Thu, 12 Oct 2006 17:45:05 +0200
From:	Luca Tettamanti <kronos.it@...il.com>
To:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:	linux-kernel@...r.kernel.org, Greg KH <greg@...ah.com>
Subject: Re: [PATCH 2.6.19-rc1] radeonfb: check return value of sysfs_create_bin_file

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!!!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ