Message ID | 20221104030313.81670-1-yang.lee@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp137033wru; Thu, 3 Nov 2022 20:13:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kjhSpkzRs84a+Na8bOx59DxGrXfqxnfHnmJoVFcCoZGU7VD2DaIH/7vSOSa40pUgd7bFL X-Received: by 2002:a17:903:2489:b0:187:3a59:570a with SMTP id p9-20020a170903248900b001873a59570amr15721220plw.35.1667531613996; Thu, 03 Nov 2022 20:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667531613; cv=none; d=google.com; s=arc-20160816; b=Pa1Q94K6sKLgms7T38cmdnTYt66xm1g/sCJzgF+NyOGbK/yRT2Dw3peZ6XzQ6vyvUI KT6nwQ+sVn52hkLdhd3waGVoQ3ypQ6qXVVv7J+8VNCXPK5wjvUoQ2QrO+vigrgPWaPy6 4jQ2AbBnUIftISKjL92qjnexCDD8jKc58nWDMseiOmyH4e+BbvXuUhDO8O2QZvNEa1fK NzPuCOsbm3cuOKo8/pYR2wA5oz+D+HVghl5irxYPXxvXUipeNecE0X6bF/at19t9+9V7 sD8g1Oaiiz9TbxGrXehA1JcNyaJ13ukXtHwA0KBygBzADgYCD0cVgemwRhFweVwSadKI i3rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1S+AfTGBMMCeL4Yv4MF3AT2Mt8qnqk2ydzD8tA/6gI4=; b=G3TwjYBspWjBNB4+bxiTFE4eYXugC56OTB+8lTcVNAqS63omhaFvaa8eYO3rgoNNQ3 IO2ztSg/99CxQzOJwmQvl9XSACFOAu2ZT4awpK4NZ9vdpzAdfSWZGVnj69t7cIFsgCFI 5gn6xGJyW/Nfw2MHLwl74yu1OFbavVkr9sZhvS0Q0bQdMeJht0Hgcm3Sj7+SEGUzyXd9 mz2otWH7OSxduJRkB9Oobf9/ZkD4YnUUyI8HTFvELZIzUrT/tKsxcRSxK4YwPW2xsheJ v4aQpxQliQfcxwOZqBaB0sMBXY9iSi8pCC0D+It5i+k2XS51CxgEFcpuBiqStCk6RU+i ULcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020aa790d0000000b005627f4b21absi2884481pfk.296.2022.11.03.20.13.20; Thu, 03 Nov 2022 20:13:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbiKDDD0 (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Thu, 3 Nov 2022 23:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbiKDDDW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 23:03:22 -0400 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCCB61F2DD; Thu, 3 Nov 2022 20:03:18 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VTv7Wur_1667530994; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VTv7Wur_1667530994) by smtp.aliyun-inc.com; Fri, 04 Nov 2022 11:03:15 +0800 From: Yang Li <yang.lee@linux.alibaba.com> To: bagasdotme@gmail.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH -next v2] net: ethernet: Simplify bool conversion Date: Fri, 4 Nov 2022 11:03:13 +0800 Message-Id: <20221104030313.81670-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748533629866294393?= X-GMAIL-MSGID: =?utf-8?q?1748533629866294393?= |
Series |
[-next,v2] net: ethernet: Simplify bool conversion
|
|
Commit Message
Yang Li
Nov. 4, 2022, 3:03 a.m. UTC
The result of 'scaled_ppm < 0' is Boolean, and the question mark
expression is redundant, remove it to clear the below warning:
./drivers/net/ethernet/renesas/rcar_gen4_ptp.c:32:40-45: WARNING: conversion to bool not needed here
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2729
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
change in v2:
--According to Bagas's suggestion, describe what this patch does to fix this warning.
drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Nov 04, 2022 at 11:03:13AM +0800, Yang Li wrote: > diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c > index c007e33c47e1..37f7359678e5 100644 > --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c > +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c > @@ -29,7 +29,7 @@ static const struct rcar_gen4_ptp_reg_offset s4_offs = { > static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) > { > struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp); > - bool neg_adj = scaled_ppm < 0 ? true : false; > + bool neg_adj = scaled_ppm < 0; > s64 addend = ptp_priv->default_addend; > s64 diff; Please preserve reverse Christmas tree order. Thanks, Richard
On Fri, Nov 04, 2022 at 11:03:13AM +0800, Yang Li wrote: > The result of 'scaled_ppm < 0' is Boolean, and the question mark > expression is redundant, remove it to clear the below warning: > > ./drivers/net/ethernet/renesas/rcar_gen4_ptp.c:32:40-45: WARNING: conversion to bool not needed here > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2729 > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> > --- > > change in v2: > --According to Bagas's suggestion, describe what this patch does to fix this warning. The Subject line is too generic. It is a good idea to run git log on the file you are changing and see how it is generally referred to: b48b89f9c189 net: drop the weight argument from netif_napi_add 0140a7168f8b Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 6a1dbfefdae4 net: sh_eth: Fix PHY state warning splat during system resume 4924c0cdce75 net: ravb: Fix PHY state warning splat during system resume 1089877ada8d ravb: Add RZ/G2L MII interface support 949f252a8594 net: ravb: Add R-Car Gen4 support e1154be73153 ravb: Add support for RZ/V2M 72069a7b2821 ravb: Use separate clock for gPTP b0265dcba3d6 ravb: Support separate Line0 (Desc), Line1 (Err) and Line2 (Mgmt) irqs cb99badde146 ravb: Separate handling of irq enable/disable regs into feature 91398a960edf ravb: Use GFP_KERNEL instead of GFP_ATOMIC when possible 9a90986efcff sh_eth: kill useless initializers in sh_eth_{suspend|resume}() e7d966f9ea52 sh_eth: sh_eth_close() always returns 0 be94a51f3e5e ravb: ravb_close() always returns 0 Without something specific like ravb, you won't get the right people noticing the patch. Andrew
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c index c007e33c47e1..37f7359678e5 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c @@ -29,7 +29,7 @@ static const struct rcar_gen4_ptp_reg_offset s4_offs = { static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) { struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp); - bool neg_adj = scaled_ppm < 0 ? true : false; + bool neg_adj = scaled_ppm < 0; s64 addend = ptp_priv->default_addend; s64 diff;