From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933005AbcALAdn (ORCPT ); Mon, 11 Jan 2016 19:33:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36358 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932510AbcALAdl (ORCPT ); Mon, 11 Jan 2016 19:33:41 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20160111225104.GO17997@ZenIV.linux.org.uk> References: <20160111225104.GO17997@ZenIV.linux.org.uk> <1452547845-12039-1-git-send-email-chengang@emindsoft.com.cn> To: Al Viro Cc: dhowells@redhat.com, chengang@emindsoft.com.cn, akpm@linux-foundation.org, nicolas.iooss_linux@m4x.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Chen Gang Subject: Re: [PATCH] fs: dcache: Use bool return value instead of int MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26030.1452558817.1@warthog.procyon.org.uk> Date: Tue, 12 Jan 2016 00:33:37 +0000 Message-ID: <26031.1452558817@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Al Viro 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