Messages in this thread Patch in this message | | | Date | Tue, 30 Jul 2019 16:24:40 -0700 (PDT) | From | Christian Kujau <> | Subject | ptrace.c:202:6: warning: this statement may fall through |
| |
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.
| |