Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1405390rwb; Thu, 15 Dec 2022 09:41:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf6c6QQ6S61wTkb1dDDr2CIR1yxjzoeWV5agiP8qjj3FKKUQzvJ7E0SjxedFuhJhG2l0WMho X-Received: by 2002:a17:903:2451:b0:189:f7c8:f3c7 with SMTP id l17-20020a170903245100b00189f7c8f3c7mr43895967pls.28.1671126094353; Thu, 15 Dec 2022 09:41:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671126094; cv=none; d=google.com; s=arc-20160816; b=tv85pXI9tNyrrk/SUGWS/9Vjo+VmoOlr8+36PqlilRbTA71NFIyXtk3VNnOa7HQrN7 iIcOYvy/+hFZVOEgBUmT2jIpgwgxrOixiVdAREhwj6CDpGetiJy0BYE8D6NR7/Qvmg/l Mgih4StoPbDB0zFLSGw59kyeXElOO+40Zo/N5jNt5QSh8Nh1IlN2kZymyINy+xdVevdQ vFaUMEK8xmbuDk2IV7okn2iDIp1QXlQiKF6jHlAfK73KvcV/23G7/f9BGotVRlsnvLOF qAGvnLyA4nRZ7bEMkB6G3eZBiZ6X0M4O6CV+liDIcU9c2nLr12nH0zv1qq+sPzhK6dCm t/rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:from; bh=ieJ4mwu4lH9liaFSkZYZWzMrrrSqpTq6SL5ZuS3jtLc=; b=PZXsuCOJ8dNgSbCmh6h+Rz4TrrRVToWrYPRwcuOVXTnwwbmDtf7ScG27LsZ44kCELF yDMcr7iKX2P+mV4MH8UNRAl9zPm9FRskFMvMxVSMA51bqVKGvKo9Aenf03YCPseLKuAG vWeNgFBDt9xxQNoS8GJ1ZQoZb9Jsmmm6Ziw3UxfJhLzc4BU+vAWHqmIH6iXitO0F92Qi wBy/suOlwgU6tuIcsoAvMMqqYhHUZHmihMTj7l7cZlSYmm4UziZ0W/dsGgIvHhunZZId c9AJrtapHgazZQzbxhyr1zHX1hcPBkHBcaCiTuBhHGNSyfxRHKFAhavmzMVmqYPMwGzQ lGyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=lFYnBSKU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jm24-20020a17090304d800b0018956e3ff71si6046471plb.473.2022.12.15.09.41.21; Thu, 15 Dec 2022 09:41:34 -0800 (PST) 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; dkim=pass header.i=@toke.dk header.s=20161023 header.b=lFYnBSKU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbiLORfl (ORCPT + 67 others); Thu, 15 Dec 2022 12:35:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbiLORfk (ORCPT ); Thu, 15 Dec 2022 12:35:40 -0500 X-Greylist: delayed 596 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 15 Dec 2022 09:35:34 PST Received: from mail.toke.dk (mail.toke.dk [IPv6:2a0c:4d80:42:2001::664]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA7A37213; Thu, 15 Dec 2022 09:35:34 -0800 (PST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1671124565; bh=ywaJJZXUkkSmvUs71ktwaaz2k3Du019540IdT+fmclA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lFYnBSKUda8fTO3gAbCmR7Cm1KVjKu5VJNHbmHUExk5fwnG5SFVcP5G9bkGULjEBI E3qadxDVg2kCO0wVSoNsE6kN+6HdsoZIUM6Rvkm7+UzStBz5jS1FBMPF+udvS5E9Jj 3nrqwJCflvVf6QKrhItD4DCr4hVAe/m5dgH6jJ5vGQ2aUldH4xj6smUmlgJHW5ki+L LNPTWxwTDBC1OLLWu02+yobpeOiUGM0IoeKYCY/UtiTDsR1xQVxLMNVrtaZZq1kHJ3 pK2f5hikWoiiqeIv/2+nUplmo0z23CwM1jesRrGfABsXnjhOUssR/0ZPvw7hCZMgKY 9s1cuzwq01yoA== To: Arnd Bergmann , 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: Re: [PATCH] ath9k: use proper statements in conditionals In-Reply-To: <20221215165553.1950307-1-arnd@kernel.org> References: <20221215165553.1950307-1-arnd@kernel.org> Date: Thu, 15 Dec 2022 18:16:04 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87k02sd1uz.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Arnd Bergmann writes: > 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 > --- > 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) Hmm, is it really necessary to wrap these in do/while constructs? AFAICT they're all simple statements already? -Toke