[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171127235253.GA20384@embeddedor.com>
Date: Mon, 27 Nov 2017 17:52:53 -0600
From: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org
Cc: linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <garsilva@...eddedor.com>,
Kees Cook <keescook@...omium.org>
Subject: [PATCH] x86/syscalls: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
---
arch/x86/include/asm/syscall.h | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index e3c95e8..63b01b1 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -121,23 +121,30 @@ static inline void syscall_get_arguments(struct task_struct *task,
case 0:
if (!n--) break;
*args++ = regs->bx;
+ /* fall through */
case 1:
if (!n--) break;
*args++ = regs->cx;
+ /* fall through */
case 2:
if (!n--) break;
*args++ = regs->dx;
+ /* fall through */
case 3:
if (!n--) break;
*args++ = regs->si;
+ /* fall through */
case 4:
if (!n--) break;
*args++ = regs->di;
+ /* fall through */
case 5:
if (!n--) break;
*args++ = regs->bp;
+ /* fall through */
case 6:
if (!n--) break;
+ /* fall through */
default:
BUG();
break;
@@ -148,23 +155,30 @@ static inline void syscall_get_arguments(struct task_struct *task,
case 0:
if (!n--) break;
*args++ = regs->di;
+ /* fall through */
case 1:
if (!n--) break;
*args++ = regs->si;
+ /* fall through */
case 2:
if (!n--) break;
*args++ = regs->dx;
+ /* fall through */
case 3:
if (!n--) break;
*args++ = regs->r10;
+ /* fall through */
case 4:
if (!n--) break;
*args++ = regs->r8;
+ /* fall through */
case 5:
if (!n--) break;
*args++ = regs->r9;
+ /* fall through */
case 6:
if (!n--) break;
+ /* fall through */
default:
BUG();
break;
@@ -182,23 +196,30 @@ static inline void syscall_set_arguments(struct task_struct *task,
case 0:
if (!n--) break;
regs->bx = *args++;
+ /* fall through */
case 1:
if (!n--) break;
regs->cx = *args++;
+ /* fall through */
case 2:
if (!n--) break;
regs->dx = *args++;
+ /* fall through */
case 3:
if (!n--) break;
regs->si = *args++;
+ /* fall through */
case 4:
if (!n--) break;
regs->di = *args++;
+ /* fall through */
case 5:
if (!n--) break;
regs->bp = *args++;
+ /* fall through */
case 6:
if (!n--) break;
+ /* fall through */
default:
BUG();
break;
@@ -209,23 +230,30 @@ static inline void syscall_set_arguments(struct task_struct *task,
case 0:
if (!n--) break;
regs->di = *args++;
+ /* fall through */
case 1:
if (!n--) break;
regs->si = *args++;
+ /* fall through */
case 2:
if (!n--) break;
regs->dx = *args++;
+ /* fall through */
case 3:
if (!n--) break;
regs->r10 = *args++;
+ /* fall through */
case 4:
if (!n--) break;
regs->r8 = *args++;
+ /* fall through */
case 5:
if (!n--) break;
regs->r9 = *args++;
+ /* fall through */
case 6:
if (!n--) break;
+ /* fall through */
default:
BUG();
break;
--
2.7.4
Powered by blists - more mailing lists