* [PATCH] x86-64: add default case to emulate_vsyscall() to silence compiler warning
@ 2011-09-15 8:38 Jan Beulich
2011-09-15 14:44 ` Andrew Lutomirski
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2011-09-15 8:38 UTC (permalink / raw)
To: mingo, tglx, hpa; +Cc: Andy Lutomirski, linux-kernel
... since the compiler can't possibly know that vsyscall_nr is limited
to three values, and hence 'ret' must appear possibly uninitialized to
it.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Andy Lutomirski <luto@mit.edu>
---
arch/x86/kernel/vsyscall_64.c | 3 +++
1 file changed, 3 insertions(+)
--- 3.1-rc6/arch/x86/kernel/vsyscall_64.c
+++ 3.1-rc6-x86_64-emul-vsyscall/arch/x86/kernel/vsyscall_64.c
@@ -195,6 +195,9 @@ bool emulate_vsyscall(struct pt_regs *re
(unsigned __user *)regs->si,
0);
break;
+ default:
+ ret = -ENOSYS;
+ break;
}
if (ret == -EFAULT) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86-64: add default case to emulate_vsyscall() to silence compiler warning
2011-09-15 8:38 [PATCH] x86-64: add default case to emulate_vsyscall() to silence compiler warning Jan Beulich
@ 2011-09-15 14:44 ` Andrew Lutomirski
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lutomirski @ 2011-09-15 14:44 UTC (permalink / raw)
To: Jan Beulich; +Cc: mingo, tglx, hpa, linux-kernel
On Thu, Sep 15, 2011 at 1:38 AM, Jan Beulich <JBeulich@suse.com> wrote:
> ... since the compiler can't possibly know that vsyscall_nr is limited
> to three values, and hence 'ret' must appear possibly uninitialized to
> it.
Hmm. I actually wrote that thing carefully to avoid needing a default
case. My copy of gcc (Red Hat 4.6.0-10) doesn't warn.
I guess that older versions do warn. I have no strong preference on
what to do avoid it.
--Andy
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Andy Lutomirski <luto@mit.edu>
>
> ---
> arch/x86/kernel/vsyscall_64.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> --- 3.1-rc6/arch/x86/kernel/vsyscall_64.c
> +++ 3.1-rc6-x86_64-emul-vsyscall/arch/x86/kernel/vsyscall_64.c
> @@ -195,6 +195,9 @@ bool emulate_vsyscall(struct pt_regs *re
> (unsigned __user *)regs->si,
> 0);
> break;
> + default:
> + ret = -ENOSYS;
> + break;
> }
>
> if (ret == -EFAULT) {
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-15 14:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15 8:38 [PATCH] x86-64: add default case to emulate_vsyscall() to silence compiler warning Jan Beulich
2011-09-15 14:44 ` Andrew Lutomirski
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.