From: Mathieu Malaterre <malat@debian.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Mathieu Malaterre <malat@debian.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] lib/siphash.c:: annotate implicit fall throughs
Date: Mon, 14 Jan 2019 21:19:11 +0100 [thread overview]
Message-ID: <20190114201911.13725-1-malat@debian.org> (raw)
There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings (W=1). Fix them up.
This commit remove the following warnings:
lib/siphash.c:71:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/siphash.c:72:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/siphash.c:73:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/siphash.c:75:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/siphash.c:434:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
lib/siphash.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/siphash.c b/lib/siphash.c
index 3ae58b4edad6..b95624f5aa34 100644
--- a/lib/siphash.c
+++ b/lib/siphash.c
@@ -69,10 +69,14 @@ u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key)
#else
switch (left) {
case 7: b |= ((u64)end[6]) << 48;
+ /* fall through */
case 6: b |= ((u64)end[5]) << 40;
+ /* fall through */
case 5: b |= ((u64)end[4]) << 32;
+ /* fall through */
case 4: b |= le32_to_cpup(data); break;
case 3: b |= ((u64)end[2]) << 16;
+ /* fall through */
case 2: b |= le16_to_cpup(data); break;
case 1: b |= end[0];
}
@@ -432,6 +436,7 @@ u32 __hsiphash_aligned(const void *data, size_t len, const hsiphash_key_t *key)
}
switch (left) {
case 3: b |= ((u32)end[2]) << 16;
+ /* fall through */
case 2: b |= le16_to_cpup(data); break;
case 1: b |= end[0];
}
--
2.19.2
next reply other threads:[~2019-01-14 20:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-14 20:19 Mathieu Malaterre [this message]
2019-01-14 21:04 ` [PATCH] lib/siphash.c:: annotate implicit fall throughs Gustavo A. R. Silva
2019-03-13 20:24 ` [PATCH v2] lib/siphash.c: " Mathieu Malaterre
2019-03-13 20:34 ` Jason A. Donenfeld
2019-03-13 20:44 ` Gustavo A. R. Silva
2019-03-13 20:52 ` Mathieu Malaterre
2019-03-13 21:12 ` [PATCH v3] " Mathieu Malaterre
2019-03-14 1:50 ` Joe Perches
2019-03-14 7:01 ` Jason A. Donenfeld
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=20190114201911.13725-1-malat@debian.org \
--to=malat@debian.org \
--cc=Jason@zx2c4.com \
--cc=linux-kernel@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).