From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ursula Braun Subject: Re: [PATCH v2] smc: return booleans instead of integers Date: Mon, 22 Jan 2018 12:58:10 +0100 Message-ID: References: <20180119205450.GA10785@embeddedgus> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" To: "Gustavo A. R. Silva" , "David S. Miller" Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57154 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030AbeAVL6R (ORCPT ); Mon, 22 Jan 2018 06:58:17 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0MBsFQL027181 for ; Mon, 22 Jan 2018 06:58:17 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fne9e331e-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 22 Jan 2018 06:58:16 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Jan 2018 11:58:14 -0000 In-Reply-To: <20180119205450.GA10785@embeddedgus> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 > index 0bee9d1..6328565 100644 > --- 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; > } > #else > static inline bool using_ipsec(struct smc_sock *smc) > { > - return 0; > + return false; > } > #endif > Thanks, Gustavo. I have added the patch to our local repository. It will be part of one of my next patch sets to be sent to Dave Miller. Regards, Ursula