Received: by 10.223.176.46 with SMTP id f43csp4063401wra; Tue, 23 Jan 2018 03:45:11 -0800 (PST) X-Google-Smtp-Source: AH8x224C3mJI80KnTFN5rt+CmQEf3SZhL4zz3MnB0qzwZtI8LKw/AwWcS0hfqfSsSKHFrhAb0OFy X-Received: by 2002:a17:902:20c8:: with SMTP id v8-v6mr5348641plg.226.1516707911708; Tue, 23 Jan 2018 03:45:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516707911; cv=none; d=google.com; s=arc-20160816; b=XYtq+zbV/UgoUogUOYM0N4yjq9hfu/okhtitW0bMTdHZeJkZwMbdQGOSRnV6lfot6d STcJt+v/Ft+kDM1tCPcV8R0GO1nFce7Hq8NA8K3Gg/o7kCSuxphhwpy3Q7TK0oCUYfdI DVEy1CyRdaunxifFHXaKfUHgJXOhmnX3c2X0EWnF9I/zbOG6mC15hGlvzpHVbgpYcPZH BTQsUzReyK9T1kwWPuun+73gfxtfIsSAb5grMQFhaNURZCd8VnqBO3P9/9dgEuC3EL85 363NsTRJSBmNbLzxo8hEVc+XDaW/88kHT6Y3Ii+R0OmIELJwRJuNXWwSfbzFk6y4lIb6 e4lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject:arc-authentication-results; bh=tL4YnkNFCWECmKCTn+2D01tWr+JiimMfW8x/L7+kZIY=; b=IMLoflCqXIrI3+NQ/ERg6+evZ30SVcdRatGK1U1YEZ28zSdb6B/QyPsTS+WerUkFyS L+4jPhcoZynUkMDcn/z2Uz8ZbUK/ewnjPd/YSvll8VXnK3t5CQE18lM9NCMs0p71JCsC pj9B2e8CW9X6E9L8xYvmfNXnTIwsX/4xHSM1kt0ViC7yBrYIt1V14msBeKn6pC1iofn+ LzqrNyQWhjBEMJbKItbbasGwop9164BBAl7cFMCTGmdRk97tD1RYkJVpE+GJtF+pn2gF huSkKQHFseA6zvJthWwa9rvyLiEY+09OIgW0jFf1Co+BdOgQ0cgPeaxLiH1rlpxHnNDh wgug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6-v6si4552215plo.800.2018.01.23.03.44.57; Tue, 23 Jan 2018 03:45:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751386AbeAWLoL (ORCPT + 99 others); Tue, 23 Jan 2018 06:44:11 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49572 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751309AbeAWLoJ (ORCPT ); Tue, 23 Jan 2018 06:44:09 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0NBhflZ009143 for ; Tue, 23 Jan 2018 06:44:08 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fp2vv4603-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 Jan 2018 06:44:08 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jan 2018 11:44:06 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jan 2018 11:44:02 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0NBi1k649414160; Tue, 23 Jan 2018 11:44:01 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F287EA4040; Tue, 23 Jan 2018 11:37:41 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87289A4057; Tue, 23 Jan 2018 11:37:41 +0000 (GMT) Received: from oc0447013845.ibm.com (unknown [9.152.222.219]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 23 Jan 2018 11:37:41 +0000 (GMT) Subject: Re: [PATCH v2] smc: return booleans instead of integers To: Joe Perches , "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" References: <20180119205450.GA10785@embeddedgus> <1516667515.8378.24.camel@perches.com> From: Ursula Braun Date: Tue, 23 Jan 2018 12:44:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1516667515.8378.24.camel@perches.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18012311-0040-0000-0000-00000407D8C3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012311-0041-0000-0000-0000260B5A17 Message-Id: <032c06a8-e9ce-9c06-d142-70bfeae2117a@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-23_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801230162 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/23/2018 01:31 AM, Joe Perches wrote: > 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; > This would be shorter, but is it really better readable/understandable? Do you have a reference for us confirming your proposed style is the way to go?