All of lore.kernel.org
 help / color / mirror / Atom feed
* ptrace.c:202:6: warning: this statement may fall through
@ 2019-07-30 23:24 Christian Kujau
  0 siblings, 0 replies; only message in thread
From: Christian Kujau @ 2019-07-30 23:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Oleg Nesterov, linux-kernel

While compiling mainline with gcc-9.1.1 the following warning is emitted:

===========================================================
../arch/x86/kernel/ptrace.c: In function ‘set_segment_reg’: 
../arch/x86/kernel/ptrace.c:202:6: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
  202 |   if (unlikely(value == 0))
      |      ^
../arch/x86/kernel/ptrace.c:205:2: note: here
  205 |  default:
      |  ^~~~~~~
===========================================================

The patch below silences the warning, but I don't know if this is actual 
intended behaviour.

Christian.

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 0fdbe89d0754..0030456d6e5c 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -201,6 +201,7 @@ static int set_segment_reg(struct task_struct *task,
 	case offsetof(struct user_regs_struct, ss):
 		if (unlikely(value == 0))
 			return -EIO;
+		/* fall through */

 	default:
 		*pt_regs_access(task_pt_regs(task), offset) = value;
-- 
BOFH excuse #326:

We need a licensed electrician to replace the light bulbs in the computer room.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-30 23:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 23:24 ptrace.c:202:6: warning: this statement may fall through Christian Kujau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.