From patchwork Thu Jun 6 03:42:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 1110870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45KBPK1jzrz9sDX; Thu, 6 Jun 2019 13:44:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hYjKa-0008Jq-Fp; Thu, 06 Jun 2019 03:44:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hYjJA-0008HA-UY for kernel-team@lists.ubuntu.com; Thu, 06 Jun 2019 03:43:20 +0000 Received: from [222.129.45.111] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hYjJ9-0004NJ-GA for kernel-team@lists.ubuntu.com; Thu, 06 Jun 2019 03:43:20 +0000 From: Aaron Ma To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/7] rtw88: phy: mark expected switch fall-throughs Date: Thu, 6 Jun 2019 11:42:53 +0800 Message-Id: <20190606034255.2192-6-aaron.ma@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190606034255.2192-1-aaron.ma@canonical.com> References: <20190606034255.2192-1-aaron.ma@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Gustavo A. R. Silva" BugLink: https://bugs.launchpad.net/bugs/1831828 In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/net/wireless/realtek/rtw88/phy.c: In function ‘rtw_get_channel_group’: ./include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=] # define unlikely(x) __builtin_expect(!!(x), 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/asm-generic/bug.h:125:2: note: in expansion of macro ‘unlikely’ unlikely(__ret_warn_on); \ ^~~~~~~~ drivers/net/wireless/realtek/rtw88/phy.c:907:3: note: in expansion of macro ‘WARN_ON’ WARN_ON(1); ^~~~~~~ drivers/net/wireless/realtek/rtw88/phy.c:908:2: note: here case 1: ^~~~ In file included from ./include/linux/bcd.h:5, from drivers/net/wireless/realtek/rtw88/phy.c:5: drivers/net/wireless/realtek/rtw88/phy.c: In function ‘phy_get_2g_tx_power_index’: ./include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=] # define unlikely(x) __builtin_expect(!!(x), 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/asm-generic/bug.h:125:2: note: in expansion of macro ‘unlikely’ unlikely(__ret_warn_on); \ ^~~~~~~~ drivers/net/wireless/realtek/rtw88/phy.c:1021:3: note: in expansion of macro ‘WARN_ON’ WARN_ON(1); ^~~~~~~ drivers/net/wireless/realtek/rtw88/phy.c:1022:2: note: here case RTW_CHANNEL_WIDTH_20: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo (cherry picked from commit aa8eaaaa123ab2ee15a3bebb90e8c2d55c895c47) Signed-off-by: Aaron Ma --- drivers/net/wireless/realtek/rtw88/phy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c index 35a35dbca85f..4381b360b5b5 100644 --- a/drivers/net/wireless/realtek/rtw88/phy.c +++ b/drivers/net/wireless/realtek/rtw88/phy.c @@ -905,6 +905,7 @@ static u8 rtw_get_channel_group(u8 channel) switch (channel) { default: WARN_ON(1); + /* fall through */ case 1: case 2: case 36: @@ -1019,6 +1020,7 @@ static u8 phy_get_2g_tx_power_index(struct rtw_dev *rtwdev, switch (bandwidth) { default: WARN_ON(1); + /* fall through */ case RTW_CHANNEL_WIDTH_20: tx_power += pwr_idx_2g->ht_1s_diff.bw20 * factor; if (above_2ss) @@ -1062,6 +1064,7 @@ static u8 phy_get_5g_tx_power_index(struct rtw_dev *rtwdev, switch (bandwidth) { default: WARN_ON(1); + /* fall through */ case RTW_CHANNEL_WIDTH_20: tx_power += pwr_idx_5g->ht_1s_diff.bw20 * factor; if (above_2ss)