linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "Lee, Chun-Yi" <jlee@suse.com>,
	Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Kees Cook <keescook@chromium.org>
Subject: [PATCH] platform/x86: acer-wmi: Mark expected switch fall-throughs
Date: Wed, 8 May 2019 11:49:34 -0500	[thread overview]
Message-ID: <20190508164934.GA20064@embeddedor> (raw)

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

This patch fixes the following warnings:

drivers/platform/x86/acer-wmi.c: In function ‘set_u32’:
drivers/platform/x86/acer-wmi.c:1378:33: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (cap == ACER_CAP_WIRELESS ||
                                 ^
drivers/platform/x86/acer-wmi.c:1386:3: note: here
   case ACER_WMID:
   ^~~~
drivers/platform/x86/acer-wmi.c:1393:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
    else if (wmi_has_guid(WMID_GUID2))
            ^
drivers/platform/x86/acer-wmi.c:1395:3: note: here
   default:
   ^~~~~~~
drivers/platform/x86/acer-wmi.c: In function ‘get_u32’:
drivers/platform/x86/acer-wmi.c:1340:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (cap == ACER_CAP_MAILLED) {
      ^
drivers/platform/x86/acer-wmi.c:1344:2: note: here
  case ACER_WMID:
  ^~~~
drivers/platform/x86/acer-wmi.c: In function ‘WMID_get_u32’:
drivers/platform/x86/acer-wmi.c:1013:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (quirks->mailled == 1) {
      ^
drivers/platform/x86/acer-wmi.c:1018:2: note: here
  default:
  ^~~~~~~

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@embeddedor.com>
---
 drivers/platform/x86/acer-wmi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index fcfeadd1301f..bd87f9037f95 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1015,6 +1015,7 @@ static acpi_status WMID_get_u32(u32 *value, u32 cap)
 			*value = tmp & 0x1;
 			return 0;
 		}
+		/* fall through */
 	default:
 		return AE_ERROR;
 	}
@@ -1341,6 +1342,7 @@ static acpi_status get_u32(u32 *value, u32 cap)
 			status = AMW0_get_u32(value, cap);
 			break;
 		}
+		/* fall through */
 	case ACER_WMID:
 		status = WMID_get_u32(value, cap);
 		break;
@@ -1383,6 +1385,7 @@ static acpi_status set_u32(u32 value, u32 cap)
 
 				return AMW0_set_u32(value, cap);
 			}
+			/* fall through */
 		case ACER_WMID:
 			return WMID_set_u32(value, cap);
 		case ACER_WMID_v2:
@@ -1392,6 +1395,7 @@ static acpi_status set_u32(u32 value, u32 cap)
 				return wmid_v2_set_u32(value, cap);
 			else if (wmi_has_guid(WMID_GUID2))
 				return WMID_set_u32(value, cap);
+			/* fall through */
 		default:
 			return AE_BAD_PARAMETER;
 		}
-- 
2.21.0


             reply	other threads:[~2019-05-08 16:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 16:49 Gustavo A. R. Silva [this message]
2019-05-08 23:06 ` [PATCH] platform/x86: acer-wmi: Mark expected switch fall-throughs Darren Hart
2019-05-09  1:48   ` Gustavo A. R. Silva
2019-06-29 13:13     ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2018-07-05 20:42 [PATCH] platform/x86: acer-wmi: mark " Gustavo A. R. Silva
2018-07-06 23:15 ` Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190508164934.GA20064@embeddedor \
    --to=gustavo@embeddedor.com \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=jlee@suse.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).