From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbeAWAcC (ORCPT ); Mon, 22 Jan 2018 19:32:02 -0500 Received: from smtprelay0147.hostedemail.com ([216.40.44.147]:37585 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751313AbeAWAcA (ORCPT ); Mon, 22 Jan 2018 19:32:00 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2895:3138:3139:3140:3141:3142:3352:3622:3865:3866:3870:4321:5007:7522:7875:7903:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21451:21627:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: tent65_4b4b13402fe48 X-Filterd-Recvd-Size: 2005 Message-ID: <1516667515.8378.24.camel@perches.com> Subject: Re: [PATCH v2] smc: return booleans instead of integers From: Joe Perches To: Ursula Braun , "Gustavo A. R. Silva" , "David S. Miller" Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Date: Mon, 22 Jan 2018 16:31:55 -0800 In-Reply-To: References: <20180119205450.GA10785@embeddedgus> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-01-22 at 12:58 +0100, Ursula Braun wrote: > > On 01/19/2018 09:54 PM, Gustavo A. R. Silva wrote: > > Return statements in functions returning bool should use > > true/false instead of 1/0. > > > > This issue was detected with the help of Coccinelle. > > > > Signed-off-by: Gustavo A. R. Silva > > --- > > Changes in v2: > > - Fix function using_ipsec as suggested by Ursula Braun. > > - Update subject line. > > > > net/smc/smc.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/net/smc/smc.h b/net/smc/smc.h [] > > @@ -253,12 +253,12 @@ static inline int smc_uncompress_bufsize(u8 compressed) > > static inline bool using_ipsec(struct smc_sock *smc) > > { > > return (smc->clcsock->sk->sk_policy[0] || > > - smc->clcsock->sk->sk_policy[1]) ? 1 : 0; > > + smc->clcsock->sk->sk_policy[1]) ? true : false; Generally, any bool return like return condition ? true : false; could be written return condition;