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: <26031.1452558817@warthog.procyon.org.uk>
Date:	Tue, 12 Jan 2016 00:33:37 +0000
From:	David Howells <dhowells@...hat.com>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	dhowells@...hat.com, chengang@...ndsoft.com.cn,
	akpm@...ux-foundation.org, nicolas.iooss_linux@....org,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Chen Gang <gang.chen.5i5j@...il.com>
Subject: Re: [PATCH] fs: dcache: Use bool return value instead of int

Al Viro <viro@...IV.linux.org.uk> wrote:

> > -static inline int d_unhashed(const struct dentry *dentry)
> > +static inline bool d_unhashed(const struct dentry *dentry)
> >  {
> >  	return hlist_bl_unhashed(&dentry->d_hash);
> >  }
> >  
> > -static inline int d_unlinked(const struct dentry *dentry)
> > +static inline bool d_unlinked(const struct dentry *dentry)
> >  {
> >  	return d_unhashed(dentry) && !IS_ROOT(dentry);
> >  }
> 
> > -static inline int simple_positive(struct dentry *dentry)
> > +static inline bool simple_positive(struct dentry *dentry)
> >  {
> >  	return d_really_is_positive(dentry) && !d_unhashed(dentry);
> >  }
> 
> And these three are harmless, but completely pointless...

gcc-5 does actually produce slightly smaller code when int returns are
replaced by bools under some circumstances within the kernel.

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ