From patchwork Fri Nov 4 06:37:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 15386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp210510wru; Thu, 3 Nov 2022 23:47:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6o1ru0gJY+oyxMSYXk0yiULK3tBeX7vQ3lmKX/hvlfVf6qU0mie0VaqhuswOEyUKUEzyqO X-Received: by 2002:aa7:ccd7:0:b0:461:c6e9:8b0 with SMTP id y23-20020aa7ccd7000000b00461c6e908b0mr33906157edt.287.1667544423877; Thu, 03 Nov 2022 23:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667544423; cv=none; d=google.com; s=arc-20160816; b=dktkPjgvNZQ0YdqTBn85iOxGxjnRHbHKByq75sk3ICkMcbhugD/uHcmOMYyQvTaBJ+ T04ZnzuiPaXHF9KDNHEbzXeXvAdQFX4auzg/oDc+7jeZMzAfb4u33XrPCf/TQ3Uuzcvv XfVQnEz0svTn8GaDqQtAQpwgeMXUxmQsA1NmbLsyijFBK6f1hMIlyZt3jh4Fd2/4lovW 8Oi8RQsIlq4PWx3Z7jAoT4m3o1/15zoegsj9HkjPWmOMmCWTiBpd+D/r8UHl7cgELLQo dMdgPhuL1ORjPYk/LIZ97GClZgNUobNCnwDlV+kn/zZDcrZUveqa/yr/isBTpOmLags8 xQ9g== 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=w1h5/wRuVz7RIQWcEvpvsZTjh8/RTtJD0NiJw1Pts74=; b=U0TxRVPvU9HXEb48EzUPBIlWniZGUoDLyCg7E7ee1JB1uX4Ds/g5svp1toAaon8ckQ of/aZEIWSpZISkovHTmA8tlgKW5hKoSrtqEZCsMdJOFsy+gmmI56X7QsjEVDYpsEMSir glVFRgMd14Rng/RI/0Df6DcPAZc8OwCPGiVkoyTlKF9naoJL8/kcQgkmJc3q3EDOmD7l 8DLDI5G2o3/EX87N0dk2SwS5nQrFW/HvnnvWxT5yAsf7ei8uU7v16CpuCPoTaqHGbFNd 0uO4n5SnYTkWrb2eNZIfgJPKbAj2aiYcXgyNizmGq+6C0LUVIKaSFPgp7mVHwubfoBgI ZieA== 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 hz3-20020a1709072ce300b0078a19032c70si4627241ejc.334.2022.11.03.23.46.40; Thu, 03 Nov 2022 23:47:03 -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 S231182AbiKDGhl (ORCPT + 99 others); Fri, 4 Nov 2022 02:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbiKDGhj (ORCPT ); Fri, 4 Nov 2022 02:37:39 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CE821E18; Thu, 3 Nov 2022 23:37:37 -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=ay29a033018045168;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VTvrMNq_1667543853; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VTvrMNq_1667543853) by smtp.aliyun-inc.com; Fri, 04 Nov 2022 14:37:34 +0800 From: Yang Li To: richardcochran@gmail.com, bagasdotme@gmail.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next v3] net: ethernet: Simplify bool conversion Date: Fri, 4 Nov 2022 14:37:31 +0800 Message-Id: <20221104063731.84008-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748547061344301465?= X-GMAIL-MSGID: =?utf-8?q?1748547061344301465?= 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 Signed-off-by: Yang Li --- change in v3: --According to Richard's suggestion, to preserve reverse Christmas tree order. drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c index c007e33c47e1..0dc80f6bbf94 100644 --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c @@ -29,8 +29,8 @@ 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; s64 addend = ptp_priv->default_addend; + bool neg_adj = scaled_ppm < 0; s64 diff; if (neg_adj)