[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190920084540.3449-1-lei.xu@nxp.com>
Date: Fri, 20 Sep 2019 16:45:40 +0800
From: Lei Xu <lei.xu@....com>
To: linux-devel@...ux.nxdi.nxp.com,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
linuxppc-dev@...ts.ozlabs.org
Cc: linux-kernel@...r.kernel.org, Lei Xu <lei.xu@....com>
Subject: [PATCH] powerpc:mark expected switch fall-throughs
When building kernel with -Wimplicit-fallthrough and -Werror, it
reported the follwoing errors:
arch/powerpc/kernel/align.c: In function ‘emulate_spe’:
arch/powerpc/kernel/align.c:178:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
ret |= __get_user_inatomic(temp.v[3], p++);
^~
arch/powerpc/kernel/align.c:179:3: note: here
case 4:
^~~~
arch/powerpc/kernel/align.c:181:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
ret |= __get_user_inatomic(temp.v[5], p++);
^~
arch/powerpc/kernel/align.c:182:3: note: here
case 2:
^~~~
arch/powerpc/kernel/align.c:261:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
ret |= __put_user_inatomic(data.v[3], p++);
^~
arch/powerpc/kernel/align.c:262:3: note: here
case 4:
^~~~
arch/powerpc/kernel/align.c:264:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
ret |= __put_user_inatomic(data.v[5], p++);
^~
arch/powerpc/kernel/align.c:265:3: note: here
case 2:
^~~~
cc1: all warnings being treated as errors
This patch fixs the above errors.
Signed-off-by: Lei Xu <lei.xu@....com>
---
arch/powerpc/kernel/align.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 7107ad8..92045ed 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -176,9 +176,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg,
ret |= __get_user_inatomic(temp.v[1], p++);
ret |= __get_user_inatomic(temp.v[2], p++);
ret |= __get_user_inatomic(temp.v[3], p++);
+ /* fall through */
case 4:
ret |= __get_user_inatomic(temp.v[4], p++);
ret |= __get_user_inatomic(temp.v[5], p++);
+ /* fall through */
case 2:
ret |= __get_user_inatomic(temp.v[6], p++);
ret |= __get_user_inatomic(temp.v[7], p++);
@@ -259,9 +261,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg,
ret |= __put_user_inatomic(data.v[1], p++);
ret |= __put_user_inatomic(data.v[2], p++);
ret |= __put_user_inatomic(data.v[3], p++);
+ /* fall through */
case 4:
ret |= __put_user_inatomic(data.v[4], p++);
ret |= __put_user_inatomic(data.v[5], p++);
+ /* fall through */
case 2:
ret |= __put_user_inatomic(data.v[6], p++);
ret |= __put_user_inatomic(data.v[7], p++);
--
2.9.3
Powered by blists - more mailing lists