From patchwork Thu Dec 15 16:55:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 33740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp481810wrn; Thu, 15 Dec 2022 09:02:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5qMltrHct6kqUu8ikY89UGQ3VrZUKEdocL0Y3UddqqVYJy2tlAcBZuA3xRvMtz8tt29AMQ X-Received: by 2002:a17:906:6d52:b0:7c1:5b5e:4d78 with SMTP id a18-20020a1709066d5200b007c15b5e4d78mr17967428ejt.51.1671123761042; Thu, 15 Dec 2022 09:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671123761; cv=none; d=google.com; s=arc-20160816; b=zMr73GmfX/etsYsEZeCxLtU0H9tkUDhiWRB1V59yssZ/TvOVD342WeSaT78ZG6/16o 84hkjva+hlawkcrHN2PfigShwL7V4kbqpa/XZHJPWkxN8qR6zI2I4ZGFF6Fe5jVNYiPU +DzjvzmbN976nRd35Y+KqX950QfRNmIy8Rt6sqfCkCnBiebXUKCscJhXdhKp0NyXuuja cUdxFbMrLSMzTlhZzTTdG7hvdhOg3a54EDbo6KNrtYcXuqcI+56P16KTBsbjCRS+oAwm NbY8NP051EgV9ohDFav/WuBKA8npnZW74cz4vHQI7efEbzRCxmtYrKfRQZhtwk8whCS7 +29Q== 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:dkim-signature; bh=rwfwawr+0yBhMM2634VZPw1k6oy9S5zm2ZJOKaEKpuU=; b=pTxRuPcHIS8PJknpR4pv9DWlaR5+4pg6qv5WSbeKzoVsZFyKpU25RY5phCBPsz48yW ndG0SkJGTF/wanvbi4PW0bLgaxPiz/kpBwO7/GgMHg+ouJhMoputxmWtWqAwBdq5u5Oc 7LFALkOQ7RNpNq1E/MCflQk3wA7HOWWsjGTyFi8Yr6nucWMG5UD8p58mYXWu3+GyK9wd +P3RrYmgHPZbG0b2a8tMTOKi1y2sgEAo1o1F3pK1fZtFv42grnjtd6fqJrfcQBshEAy7 yIOkWcVPBE8zOVJBHkba2EAmb2fZTmI1yEhDCsixg7ceNr92Us7oDbgbwtBbSCvBEB+o JGIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LXoIjw5r; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gw9-20020a170906f14900b007c0ea5a7ca4si11904830ejb.858.2022.12.15.09.02.17; Thu, 15 Dec 2022 09:02:41 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LXoIjw5r; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230398AbiLOQ4M (ORCPT + 99 others); Thu, 15 Dec 2022 11:56:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbiLOQ4C (ORCPT ); Thu, 15 Dec 2022 11:56:02 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97CE6E088; Thu, 15 Dec 2022 08:56:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D5C1B81C03; Thu, 15 Dec 2022 16:56:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69E0BC433EF; Thu, 15 Dec 2022 16:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671123359; bh=tVhkH/FcY9gESy+V3xeK947kCGObkEYr+sAE3pHakis=; h=From:To:Cc:Subject:Date:From; b=LXoIjw5ra7kHRbvYTXP6NigITE4JtnJBxLDqJvA4kbg7jKh7PCVIvaWKZXXlEpAA+ Ha1v4BRa9Gnf6/ruDAN2j/Y/EXBz65z2x77sh3ozb/BZoeP263lObyomW2MW75Rqcr vd0uZ6dtjPt3xtmRkG5sSdNQ3v+0FWP8UtQ9YCYnXzb+5QzogKJOfxyaLbZ1thQayo lWfWdEIsOCy8HMjoI+z68/JlRbUVoxxgC2y8rFRfUZ7ofb3ujdTtH90M0KxjoJ8rXb wqQ1Qj5F2Uni/kMo6MwlxGch9dneycHhG96i0Qglyy8DH+ufc+U6+CH3Vqcsz2/qUh 2Yumvup4npcjw== From: Arnd Bergmann To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Kalle Valo , Pavel Skripkin Cc: Arnd Bergmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Tetsuo Handa , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ath9k: use proper statements in conditionals Date: Thu, 15 Dec 2022 17:55:42 +0100 Message-Id: <20221215165553.1950307-1-arnd@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752300268733431893?= X-GMAIL-MSGID: =?utf-8?q?1752300268733431893?= From: Arnd Bergmann A previous cleanup patch accidentally broke some conditional expressions by replacing the safe "do {} while (0)" constructs with empty macros. gcc points this out when extra warnings are enabled: drivers/net/wireless/ath/ath9k/hif_usb.c: In function 'ath9k_skb_queue_complete': drivers/net/wireless/ath/ath9k/hif_usb.c:251:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 251 | TX_STAT_INC(hif_dev, skb_failed); Make both sets of macros proper expressions again. Fixes: d7fc76039b74 ("ath9k: htc: clean up statistics macros") Signed-off-by: Arnd Bergmann Acked-by: Toke Høiland-Jørgensen --- drivers/net/wireless/ath/ath9k/htc.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 30f0765fb9fd..237f4ec2cffd 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -327,9 +327,9 @@ static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb) } #ifdef CONFIG_ATH9K_HTC_DEBUGFS -#define __STAT_SAFE(hif_dev, expr) ((hif_dev)->htc_handle->drv_priv ? (expr) : 0) -#define CAB_STAT_INC(priv) ((priv)->debug.tx_stats.cab_queued++) -#define TX_QSTAT_INC(priv, q) ((priv)->debug.tx_stats.queue_stats[q]++) +#define __STAT_SAFE(hif_dev, expr) do { ((hif_dev)->htc_handle->drv_priv ? (expr) : 0); } while (0) +#define CAB_STAT_INC(priv) do { ((priv)->debug.tx_stats.cab_queued++); } while (0) +#define TX_QSTAT_INC(priv, q) do { ((priv)->debug.tx_stats.queue_stats[q]++); } while (0) #define TX_STAT_INC(hif_dev, c) \ __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c++) @@ -378,10 +378,10 @@ void ath9k_htc_get_et_stats(struct ieee80211_hw *hw, struct ethtool_stats *stats, u64 *data); #else -#define TX_STAT_INC(hif_dev, c) -#define TX_STAT_ADD(hif_dev, c, a) -#define RX_STAT_INC(hif_dev, c) -#define RX_STAT_ADD(hif_dev, c, a) +#define TX_STAT_INC(hif_dev, c) do { } while (0) +#define TX_STAT_ADD(hif_dev, c, a) do { } while (0) +#define RX_STAT_INC(hif_dev, c) do { } while (0) +#define RX_STAT_ADD(hif_dev, c, a) do { } while (0) #define CAB_STAT_INC(priv) #define TX_QSTAT_INC(priv, c)