lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@embeddedor.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
\
 
 \ /
  Last update: 2017-11-28 00:53    [W:0.087 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site