From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1259C04A94 for ; Tue, 1 Aug 2023 11:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232676AbjHAL3G (ORCPT ); Tue, 1 Aug 2023 07:29:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232810AbjHAL3B (ORCPT ); Tue, 1 Aug 2023 07:29:01 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12FA6E4 for ; Tue, 1 Aug 2023 04:28:56 -0700 (PDT) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RFXrb4L7vzVjs7 for ; Tue, 1 Aug 2023 19:27:11 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 1 Aug 2023 19:28:54 +0800 Message-ID: <6b2a52c8-041b-5dfc-8087-36b1d31c8dff@huawei.com> Date: Tue, 1 Aug 2023 19:28:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators Content-Language: en-US To: , References: <20230801112409.304564-1-ruanjinjie@huawei.com> From: Ruan Jinjie In-Reply-To: <20230801112409.304564-1-ruanjinjie@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry!the patch has sent incorrectly. On 2023/8/1 19:24, Ruan Jinjie wrote: > There are a little ternary operators, the true or false judgement > of which is unnecessary in C language semantics. So remove it > to clean Code. > > Signed-off-by: Ruan Jinjie > Reviewed-by: Simon Horman > --- > v2: > - Fix the subject prefix and commit message issue. > --- > drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 4 ++-- > drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c > index 0ee420a489fc..c55c2c441a1a 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c > +++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c > @@ -61,12 +61,12 @@ static const struct pci_device_id ptp_id_table[]; > > static bool is_ptp_dev_cnf10kb(struct ptp *ptp) > { > - return (ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_B_PTP) ? true : false; > + return ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_B_PTP; > } > > static bool is_ptp_dev_cn10k(struct ptp *ptp) > { > - return (ptp->pdev->device == PCI_DEVID_CN10K_PTP) ? true : false; > + return ptp->pdev->device == PCI_DEVID_CN10K_PTP; > } > > static bool cn10k_ptp_errata(struct ptp *ptp) > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c > index 9551b422622a..61f62a6ec662 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c > @@ -2027,7 +2027,7 @@ u16 otx2_select_queue(struct net_device *netdev, struct sk_buff *skb, > #endif > int txq; > > - qos_enabled = (netdev->real_num_tx_queues > pf->hw.tx_queues) ? true : false; > + qos_enabled = netdev->real_num_tx_queues > pf->hw.tx_queues; > if (unlikely(qos_enabled)) { > /* This smp_load_acquire() pairs with smp_store_release() in > * otx2_qos_root_add() called from htb offload root creation