From patchwork Mon Mar 22 10:43:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406094 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3451364jai; Mon, 22 Mar 2021 03:45:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKPWIJS9elXVEhIXfzUGTBHx9adTs6gCCrfsGmLnYK6SBv/d9QVcP/T7KLusjvZN9DPTPx X-Received: by 2002:a05:6402:4395:: with SMTP id o21mr24451354edc.22.1616409940720; Mon, 22 Mar 2021 03:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616409940; cv=none; d=google.com; s=arc-20160816; b=KT617fHYvhMgs5L7Dsaxox00sY7htwH4l/FW+6wyLWRJ/L7OIOgV68C62T+91Sf2Af TAn0D+C4T/wU2nMdjD8Abd90iCoch8t3GgQuZPUsEPkxhUR2NGzRsFKperYV6Gqban8I JTRfZ35A4RCfhoSUQ//huGWnw1X0QWRpW/5a6nUdQn6OBno5wzbemIOLpLdao7R5TJqS nbEt9rQUXmLlzonNlbWe0KbcTevGSKYKn7dLYfRun01mgazI5hEFBFKfKOJ981GerSAs hLD1CLR8EABufWXmNJ85s8f82Mi8h6MiE3o5/kby4xBDbC18Tad1F28r/trhHQIeW4aj sESw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LWDdlPDFO/2zPsXIXib65Jx6gEYUA5xrAGY8/VHzMWU=; b=BbEES4iKew8Zmaf3jECNWx7RbBr3i5moe6v/Mc41v3Nkwsl2DeDDPJmqArUUOA7KXZ zm6QmDthBVzyFOpPRwi8U05KjrUGpClrgAZyDOF4hmN8L1sTqko/6aZLYWwxcygXyoPZ KJ7AgRGMuSnHO8GcIT92UeNnGZhK010dxK3La8vWArTojEnud7jMrBBannjuexroqV8K jXSOD06o3IdR1D3wt8VU6Zv+D3UYXO1wWgzTUWHNGO8+nQuwebKQvUqNtn47IL8ZTyPU ZoSJggfxaSs+gm/ZopHn1Ier49ghx1D+57DTkQ2RdtWWSDpjBRGuICZWp+NVs8lfs62V Zxkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M7J+pr2z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc39si10809881ejc.125.2021.03.22.03.45.40; Mon, 22 Mar 2021 03:45:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M7J+pr2z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S230290AbhCVKpI (ORCPT + 2 others); Mon, 22 Mar 2021 06:45:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:55294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhCVKpD (ORCPT ); Mon, 22 Mar 2021 06:45:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DAE2761931; Mon, 22 Mar 2021 10:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616409903; bh=zSlzhTb9+O7YX45ZK09VbrHld90WpzlBFw4V1GQ4JBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7J+pr2zXhZare1qLpPeu2g2PTWhQw5yYHBQ2W7k4u9qZK+C4eSmlGHD83+0rs12F 56shnLHZG9zERgEWRgLiGZI4E4HhfjSF1Q58zdo6nuimaUZLA3bTikyt/x3wNp1l5i hg2uQ2Ixb6wFRArR8uHOS0ejrkEOCIKfhSNyKnyovh/1/lgkG9Y5AAN2LunlzwxYkV MFEwGp+7uXBi29JGHdQnzNw35DIJ8hjh31NnJ87M+Ca8OyLBQplv8x9q+rHYa17uXh YeHw7Ajir+/74iLpL0myyjR+dK5o/4grFXdanVXWeO44MktT3lisssE3+aVV/BaNFQ GbPxKt0lWnLjQ== From: Arnd Bergmann To: netdev@vger.kernel.org, Stanislaw Gruszka , Kalle Valo , "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , Lee Jones , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/5] iwlegacy: avoid -Wempty-body warning Date: Mon, 22 Mar 2021 11:43:33 +0100 Message-Id: <20210322104343.948660-3-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322104343.948660-1-arnd@kernel.org> References: <20210322104343.948660-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann There are a couple of warnings in this driver when building with W=1: drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_power_set_mode': drivers/net/wireless/intel/iwlegacy/common.c:1195:60: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 1195 | il->chain_noise_data.state); | ^ drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_do_scan_abort': drivers/net/wireless/intel/iwlegacy/common.c:1343:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] Change the empty debug macros to no_printk(), which avoids the warnings and adds useful format string checks. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 -- drivers/net/wireless/intel/iwlegacy/common.c | 2 -- drivers/net/wireless/intel/iwlegacy/common.h | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) -- 2.29.2 Acked-by: Stanislaw Gruszka diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c index 4ca8212d4fa4..6ff2674f8466 100644 --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c @@ -751,9 +751,7 @@ il3945_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb) static void il3945_hdl_add_sta(struct il_priv *il, struct il_rx_buf *rxb) { -#ifdef CONFIG_IWLEGACY_DEBUG struct il_rx_pkt *pkt = rxb_addr(rxb); -#endif D_RX("Received C_ADD_STA: 0x%02X\n", pkt->u.status); } diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index 0651a6a416d1..219fed91cac5 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -1430,10 +1430,8 @@ static void il_hdl_scan_complete(struct il_priv *il, struct il_rx_buf *rxb) { -#ifdef CONFIG_IWLEGACY_DEBUG struct il_rx_pkt *pkt = rxb_addr(rxb); struct il_scancomplete_notification *scan_notif = (void *)pkt->u.raw; -#endif D_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", scan_notif->scanned_channels, scan_notif->tsf_low, diff --git a/drivers/net/wireless/intel/iwlegacy/common.h b/drivers/net/wireless/intel/iwlegacy/common.h index ea1b1bb7ddcb..40877ef1fbf2 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.h +++ b/drivers/net/wireless/intel/iwlegacy/common.h @@ -2937,7 +2937,7 @@ do { \ } while (0) #else -#define IL_DBG(level, fmt, args...) +#define IL_DBG(level, fmt, args...) no_printk(fmt, ##args) static inline void il_print_hex_dump(struct il_priv *il, int level, const void *p, u32 len) { From patchwork Mon Mar 22 10:43:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 406096 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3451719jai; Mon, 22 Mar 2021 03:46:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNYdOVnqPQkoeGOeyfWbYnib+PeBvZeE0Ct22pGJ3zLSPBEQv487mfUuhlnMpW/rbr/qcZ X-Received: by 2002:a17:907:76b3:: with SMTP id jw19mr18239697ejc.202.1616409972066; Mon, 22 Mar 2021 03:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616409972; cv=none; d=google.com; s=arc-20160816; b=pXCkc0SHyUuD3iKQNDujLwwbbJmLF7l27nFJabOh4xNT9JUph1ZKTo4wM8V8jdq8yI Blvm9F0+qugwS4cYTqYms+TgXXd0YEQ6QOmfEn2Wrz8/F1+NY8rDGRtiPM0gYJ2SJ4fZ Y+SkhE9cAVrnoTQNaBchWpFi5r64OQur+bNZyu+XohABk2XZ+quGEjCgnHYnycP0nmao Y91qqXeXo1v+2TwfAg1j+xQxgVYsJ81OjQ8kEzoeAURcWg3/nG5tzaheQUBkRbM4zsDZ V0JLcW3nc/FyxIXoTF0Qrh3Dx7q8lZ5Jd0sfAtWzSEq7txg5r0i3SzNJR0FFtqLhXbFQ 9BNA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TAtsvAxz+4hVJTw3guwVRJOrTxK6TiQf7OBE92oRrp4=; b=V72LYJLmSqZNoUBHWgyr3v2GC4bLCXSHGspwUhtLRvbOfNau1uDwwAkL2s0Rv+gYC0 sI99Ax4S5E0+9h99N43UVlVwdksgSH3kXMfoFaKO5dCkPgcF5JWtft3Id1k9LUZ0pXHS omkmxFthFQGL0SQeBbi/kKPQjnTrq9Ae43iawFYivgM9y+C9GE1fP/QUMndXddn1yHVz 3Wz05QkTyeUl+btxRRvtppzAbuMIobl4EwT1o9Ot6DmKmaY2w3ih3ELCOlBxRjqTuN8G 63wS08N+excFmVfhNJySnzrMiMQl8feImjoR+gnsRzp+fNMCLm4LsA43KFIelcEHx8i2 oOWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rRd+pWou; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc39si10809881ejc.125.2021.03.22.03.46.11; Mon, 22 Mar 2021 03:46:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rRd+pWou; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S230153AbhCVKpk (ORCPT + 2 others); Mon, 22 Mar 2021 06:45:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:55314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbhCVKpU (ORCPT ); Mon, 22 Mar 2021 06:45:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C438B61937; Mon, 22 Mar 2021 10:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616409919; bh=PSDbuiA+J5uMCeFxNECOcgTK5RynWKPdyMjFLLCjnfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rRd+pWoue2HUGEFYmUF+B3GtWuJQn66Ps+jiriHMjPCnr05onQqvhfaCGn4vWIxKU og5ldKlnYmjxZWzPD1/IiVFPd7FBtwCXOWgvKswbueFHmufOY+4HdU65C6bPDcNr3O Afy+xSSVy3PMyYWko06pmweU3MQbGIFWgIzBo8plxdlwDQHTu66I6kH5owKoGO25Oe 2YSWMVBk1vzeHxLvFxFpMfpC+z1ACCw3y8YWSq/1XJcxVoR8A1v0JiDAo6VZn41/8P BGcZqQepkqZy9hWUnXrDkr6sUuzgMDzwhKHGhovQ82Y7gvgu77Q402IE3qOo+iSbmz GWpNZb8nuS7Ag== From: Arnd Bergmann To: netdev@vger.kernel.org, Kalle Valo , "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , Jason Yan , Lubomir Rintel , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/5] libertas: avoid -Wempty-body warning Date: Mon, 22 Mar 2021 11:43:34 +0100 Message-Id: <20210322104343.948660-4-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322104343.948660-1-arnd@kernel.org> References: <20210322104343.948660-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann Building without mesh supports shows a couple of warnings with 'make W=1': drivers/net/wireless/marvell/libertas/main.c: In function 'lbs_start_card': drivers/net/wireless/marvell/libertas/main.c:1068:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 1068 | lbs_start_mesh(priv); Change the macros to use the usual "do { } while (0)" instead to shut up the warnings and make the code a litte more robust. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/marvell/libertas/mesh.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.29.2 diff --git a/drivers/net/wireless/marvell/libertas/mesh.h b/drivers/net/wireless/marvell/libertas/mesh.h index d49717b20c09..44c4cd0230a8 100644 --- a/drivers/net/wireless/marvell/libertas/mesh.h +++ b/drivers/net/wireless/marvell/libertas/mesh.h @@ -60,13 +60,13 @@ void lbs_mesh_ethtool_get_strings(struct net_device *dev, #else -#define lbs_init_mesh(priv) -#define lbs_deinit_mesh(priv) -#define lbs_start_mesh(priv) -#define lbs_add_mesh(priv) -#define lbs_remove_mesh(priv) +#define lbs_init_mesh(priv) do { } while (0) +#define lbs_deinit_mesh(priv) do { } while (0) +#define lbs_start_mesh(priv) do { } while (0) +#define lbs_add_mesh(priv) do { } while (0) +#define lbs_remove_mesh(priv) do { } while (0) #define lbs_mesh_set_dev(priv, dev, rxpd) (dev) -#define lbs_mesh_set_txpd(priv, dev, txpd) +#define lbs_mesh_set_txpd(priv, dev, txpd) do { } while (0) #define lbs_mesh_set_channel(priv, channel) (0) #define lbs_mesh_activated(priv) (false)