Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2438721rwb; Sun, 6 Aug 2023 18:51:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfx46QeNnGT59Wykf3cWYWIlIbYhYRBpeFn4hGuXUMVwFU3Em0d1DfhWAjIY+mWsbPNFMm X-Received: by 2002:a05:620a:4711:b0:767:e993:5918 with SMTP id bs17-20020a05620a471100b00767e9935918mr11600869qkb.55.1691373105353; Sun, 06 Aug 2023 18:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691373105; cv=none; d=google.com; s=arc-20160816; b=Y0Q4RZEt9Q4GaiZvyWw0RoPibaHAA8AuXAFHXE6cM1b80NBrsydW3Ue6excM5nnmDU GgmEYupUE4okrTAqrELO+LY9YTqJb7d35+2Sl7E4Pupsznkc2G1VC1VbuYHckOBOBBdS CecLUXCAYaxg8yH6GD2Koesrgu35dd1DtJ+KhIXkG7JNNLaDsQwK94wiZo4h8F+/5YyR 4LeDAfMNnoBbeM0GHnTl7C+BWZO7JFodMBOBh5M0LkuoKdISv3lrE/AY5fqMILJJe+cH mFHvnGO2obkM/FfOA86+FqCs1j/+7jrKEpq5Paj+4jLROAMU1QMapZfZTf8D8ysMQHPu w1eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:authenticated-by; bh=LQQyhpVHIAc0X4FDFmi+vlObwrOCWeklkL9kE7kt9Yo=; fh=uz7MiSJGc5cuF2sjOIxjDJUBT+wTZwENfah4LPkd3Pg=; b=OBK0f3iNWQye8uSw8EzuBBnlf6uPVfv7QRg12qqg1XdKVnACt8bShPlMe80gzmzmOJ 6+lVLx+HDz7okPj5VVYZ38r0yFX5C7mSutUfv8MlOjq6/pCnjt3jjwyUr2R34a5pWfTP hDxjr7WB0ljV1TV6fFQ5PYs5AmDEzFA7fAOs8HM74bRitvS+nAZunp2qxZ1vJ2IgelAL 5BVQ89L+Bhw2M/aKWfd5RpVThIws3/rnFjMCLFrsVzZrnbMkQTgHbxK5ZgiVplvONfpR xLAcWwNH+l88WxPdX30IyM2Z6UYzNfPbSpOCqn/lsWTal5mwTVSOHDONYs2fwLcXsBdI Clxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 7-20020a630d47000000b00563da455862si4785780pgn.311.2023.08.06.18.51.37; Sun, 06 Aug 2023 18:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbjHGBng convert rfc822-to-8bit (ORCPT + 56 others); Sun, 6 Aug 2023 21:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjHGBna (ORCPT ); Sun, 6 Aug 2023 21:43:30 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B51F1713; Sun, 6 Aug 2023 18:43:26 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3771dYi55025316, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 3771dYi55025316 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Mon, 7 Aug 2023 09:39:35 +0800 Received: from RTEXMBS03.realtek.com.tw (172.21.6.96) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Mon, 7 Aug 2023 09:39:51 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS03.realtek.com.tw (172.21.6.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 7 Aug 2023 09:39:50 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d]) by RTEXMBS04.realtek.com.tw ([fe80::e138:e7f1:4709:ff4d%5]) with mapi id 15.01.2375.007; Mon, 7 Aug 2023 09:39:50 +0800 From: Ping-Ke Shih To: Ruan Jinjie , "sgoutham@marvell.com" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "jesse.brandeburg@intel.com" , "anthony.l.nguyen@intel.com" , "tariqt@nvidia.com" , "s.shtylyov@omp.ru" , "aspriel@gmail.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@kernel.org" , "richardcochran@gmail.com" , "yoshihiro.shimoda.uh@renesas.com" , "u.kleine-koenig@pengutronix.de" , "mkl@pengutronix.de" , "lee@kernel.org" , "set_pte_at@outlook.com" , "linux-arm-kernel@lists.infradead.org" , "netdev@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , "linux-rdma@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-wireless@vger.kernel.org" , "brcm80211-dev-list.pdl@broadcom.com" , "SHA-cyfmac-dev-list@infineon.com" Subject: RE: [PATCH -next 1/6] net: thunderx: Remove unnecessary ternary operators Thread-Topic: [PATCH -next 1/6] net: thunderx: Remove unnecessary ternary operators Thread-Index: AQHZxoduaAYTDJlTBUyphtGbEFvm5q/eErLw Date: Mon, 7 Aug 2023 01:39:50 +0000 Message-ID: <15759f98483947999393a25b857bc4fe@realtek.com> References: <20230804035346.2879318-1-ruanjinjie@huawei.com> <20230804035346.2879318-2-ruanjinjie@huawei.com> In-Reply-To: <20230804035346.2879318-2-ruanjinjie@huawei.com> Accept-Language: en-US, zh-TW Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.69.188] x-kse-serverinfo: RTEXMBS03.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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-wireless@vger.kernel.org > -----Original Message----- > From: Ruan Jinjie > Sent: Friday, August 4, 2023 11:54 AM > To: sgoutham@marvell.com; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; > jesse.brandeburg@intel.com; anthony.l.nguyen@intel.com; tariqt@nvidia.com; s.shtylyov@omp.ru; > aspriel@gmail.com; franky.lin@broadcom.com; hante.meuleman@broadcom.com; kvalo@kernel.org; > richardcochran@gmail.com; yoshihiro.shimoda.uh@renesas.com; ruanjinjie@huawei.com; > u.kleine-koenig@pengutronix.de; mkl@pengutronix.de; lee@kernel.org; set_pte_at@outlook.com; > linux-arm-kernel@lists.infradead.org; netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org; > linux-rdma@vger.kernel.org; linux-renesas-soc@vger.kernel.org; linux-wireless@vger.kernel.org; > brcm80211-dev-list.pdl@broadcom.com; SHA-cyfmac-dev-list@infineon.com > Subject: [PATCH -next 1/6] net: thunderx: Remove unnecessary ternary operators > > Ther are a little ternary operators, the true or false judgement > of which is unnecessary in C language semantics. > > Signed-off-by: Ruan Jinjie > --- > drivers/net/ethernet/cavium/thunder/nic_main.c | 2 +- > drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c > b/drivers/net/ethernet/cavium/thunder/nic_main.c > index 0ec65ec634df..b7cf4ba89b7c 100644 > --- a/drivers/net/ethernet/cavium/thunder/nic_main.c > +++ b/drivers/net/ethernet/cavium/thunder/nic_main.c > @@ -174,7 +174,7 @@ static void nic_mbx_send_ready(struct nicpf *nic, int vf) > if (mac) > ether_addr_copy((u8 *)&mbx.nic_cfg.mac_addr, mac); > } > - mbx.nic_cfg.sqs_mode = (vf >= nic->num_vf_en) ? true : false; > + mbx.nic_cfg.sqs_mode = vf >= nic->num_vf_en; > mbx.nic_cfg.node_id = nic->node; > > mbx.nic_cfg.loopback_supported = vf < nic->num_vf_en; > diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c > b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c > index a317feb8decb..9e467cecc33a 100644 > --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c > +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c > @@ -957,7 +957,7 @@ static void bgx_poll_for_sgmii_link(struct lmac *lmac) > goto next_poll; > } > > - lmac->link_up = ((pcs_link & PCS_MRX_STATUS_LINK) != 0) ? true : false; > + lmac->link_up = (pcs_link & PCS_MRX_STATUS_LINK) != 0; lmac->link_up = !!(pcs_link & PCS_MRX_STATUS_LINK); > an_result = bgx_reg_read(lmac->bgx, lmac->lmacid, > BGX_GMP_PCS_ANX_AN_RESULTS); > > -- > 2.34.1 > > > ------Please consider the environment before printing this e-mail.