Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2946502rwo; Thu, 3 Aug 2023 18:39:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKKn6U/gx5W6QXap4RK6TdKzqKe0p2/pWL3EG3cb2MAWp+b2Y1W5B7mXzf4oNhdXHpzubC X-Received: by 2002:a05:6512:36cd:b0:4f9:571d:c50e with SMTP id e13-20020a05651236cd00b004f9571dc50emr201856lfs.36.1691113150775; Thu, 03 Aug 2023 18:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691113150; cv=none; d=google.com; s=arc-20160816; b=bFizyszQt9s+LBFtpsIwxAS4yxjp5HJFYXbp3129tmCQzPhcjbQnIFfCISXq5iIhx+ tcyBtwkh3QSas/3FSBLILIflU/kok4/tF2N05OjC53KShhmqof5eOCWy+eTcBlbgbCKE LYTg2SQ+W8smBZTAz4F3PL4mo4bBz08sMoa2ga5M4ZIlnq4brj6NQ+rnq2WZ8W9dr2vZ xKeShyJ1kkIRenk8ur37Gu64q+Lk6CxmYx1DOthiCm5Gh6r2qBbpiqrRGX/Zz+pC4rEV Th5rI1OMPHa/j2zsatr0BXtXxPU/8oH0zCzXfpnhxuJTAJtdl8vKwuT0rgQZzmM8OKwU n2CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=V8EU5rIAXdaFlrkVNxMKQS63yILHNFJB70Px+trqzzY=; fh=5LT6T5saJ822Mqw3yJqnrKq7LAE95fr5oCUdvya+iB4=; b=ltJ6K+OzZ5zpY/eR9aGZ89Kq1oUeOPRHnxIqvKP11t2MVIW5n4ayqhW+gja+T3Y8mt 8Q8maUhb3aKXDm8nfu1k2wIrdKT9VOORWdrj0V69PWBjwon+znihcfGyKEXqD3nZlg3/ vsP4MxGmH1JT4MFXaZZR6CS/b9g41uaMJsy7UlOHmSYlKr97qh3mF6d9s8Xu1Lkurgzb 3jFAsybCh7sRuL/OUh1PKTFtPtM6BVw9Y62z/q/4GZCqNxYFln8NWBVkB950MJ/yaoIC nY+CuJNgIRzPOfLF6ehv9nx/MKnhVYy7nWC7I9TJzHg60cpJNyjv7NYgfyINP3acJq0Q 7kIA== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020aa7da50000000b0052257eb6398si386807eds.343.2023.08.03.18.38.54; Thu, 03 Aug 2023 18:39:10 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbjHDBT2 (ORCPT + 58 others); Thu, 3 Aug 2023 21:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjHDBT1 (ORCPT ); Thu, 3 Aug 2023 21:19:27 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98B864204 for ; Thu, 3 Aug 2023 18:19:25 -0700 (PDT) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RH7Bg03gWzrRvm; Fri, 4 Aug 2023 09:18:18 +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; Fri, 4 Aug 2023 09:19:23 +0800 Message-ID: Date: Fri, 4 Aug 2023 09:19:22 +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 -next] ath9k: Remove unnecessary ternary operators Content-Language: en-US To: , , References: <20230731124455.2039184-1-ruanjinjie@huawei.com> From: Ruan Jinjie In-Reply-To: <20230731124455.2039184-1-ruanjinjie@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Ping. On 2023/7/31 20:44, Ruan Jinjie wrote: > 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/wireless/ath/ath9k/eeprom_9287.c | 3 +-- > drivers/net/wireless/ath/ath9k/hif_usb.c | 2 +- > drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- > 3 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c > index 3caa149b1013..fd5312c2a7e3 100644 > --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c > +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c > @@ -572,8 +572,7 @@ static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah, > } > > for (ctlMode = 0; ctlMode < numCtlModes; ctlMode++) { > - bool isHt40CtlMode = > - (pCtlMode[ctlMode] == CTL_2GHT40) ? true : false; > + bool isHt40CtlMode = pCtlMode[ctlMode] == CTL_2GHT40; > > if (isHt40CtlMode) > freq = centers.synth_center; > diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c > index 27ff1ca2631f..e5414435b141 100644 > --- a/drivers/net/wireless/ath/ath9k/hif_usb.c > +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c > @@ -1432,7 +1432,7 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface) > { > struct usb_device *udev = interface_to_usbdev(interface); > struct hif_device_usb *hif_dev = usb_get_intfdata(interface); > - bool unplugged = (udev->state == USB_STATE_NOTATTACHED) ? true : false; > + bool unplugged = udev->state == USB_STATE_NOTATTACHED; > > if (!hif_dev) > return; > diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c > index 51766de5ec3b..44e02cfe2438 100644 > --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c > +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c > @@ -719,7 +719,7 @@ static int ath9k_htc_tx_aggr_oper(struct ath9k_htc_priv *priv, > > aggr.sta_index = ista->index; > aggr.tidno = tid & 0xf; > - aggr.aggr_enable = (action == IEEE80211_AMPDU_TX_START) ? true : false; > + aggr.aggr_enable = action == IEEE80211_AMPDU_TX_START; > > WMI_CMD_BUF(WMI_TX_AGGR_ENABLE_CMDID, &aggr); > if (ret)