lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190218185201.GA15168@embeddedor>
Date:   Mon, 18 Feb 2019 12:52:01 -0600
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     Forest Bond <forest@...ttletooquiet.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: [PATCH] staging: vt6656: key: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/staging/vt6656/key.c: In function ‘vnt_set_keymode’:
drivers/staging/vt6656/key.c:70:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
   key->hw_key_idx = entry;
   ~~~~~~~~~~~~~~~~^~~~~~~
drivers/staging/vt6656/key.c:71:2: note: here
  case VNT_KEY_ALLGROUP:
  ^~~~
drivers/staging/vt6656/key.c:73:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (onfly_latch)
      ^
drivers/staging/vt6656/key.c:75:2: note: here
  case VNT_KEY_GROUP_ADDRESS:
  ^~~~
drivers/staging/vt6656/key.c:76:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
   key_mode |= mode;
   ~~~~~~~~~^~~~~~~
drivers/staging/vt6656/key.c:77:2: note: here
  case VNT_KEY_GROUP:
  ^~~~

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 <gustavo@...eddedor.com>
---
 drivers/staging/vt6656/key.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c
index 91dede54cc1f..dcd933a6b66e 100644
--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -63,17 +63,19 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr,
 	}
 
 	switch (key_type) {
-		/* fallthrough */
 	case VNT_KEY_DEFAULTKEY:
 		/* default key last entry */
 		entry = MAX_KEY_TABLE - 1;
 		key->hw_key_idx = entry;
+		/* fall through */
 	case VNT_KEY_ALLGROUP:
 		key_mode |= VNT_KEY_ALLGROUP;
 		if (onfly_latch)
 			key_mode |= VNT_KEY_ONFLY_ALL;
+		/* fall through */
 	case VNT_KEY_GROUP_ADDRESS:
 		key_mode |= mode;
+		/* fall through */
 	case VNT_KEY_GROUP:
 		key_mode |= (mode << 4);
 		key_mode |= VNT_KEY_GROUP;
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ