linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86_64,kgdb: add default case into a switch
@ 2010-11-22  7:02 Namhyung Kim
  2010-11-22 14:39 ` Jason Wessel
  0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2010-11-22  7:02 UTC (permalink / raw)
  To: Jason Wessel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: x86, linux-kernel

This fixes following sparse warning on x86_64:

 arch/x86/kernel/kgdb.c:123:9: warning: switch with no cases

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 arch/x86/kernel/kgdb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index cd21b65..6919506 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -135,6 +135,8 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
 		*(unsigned long *)mem = 0xFFFF;
 		break;
 #endif
+	default:
+		break;
 	}
 	return dbg_reg_def[regno].name;
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86_64,kgdb: add default case into a switch
  2010-11-22  7:02 [PATCH] x86_64,kgdb: add default case into a switch Namhyung Kim
@ 2010-11-22 14:39 ` Jason Wessel
  2010-11-23  3:21   ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wessel @ 2010-11-22 14:39 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel

On 11/22/2010 01:02 AM, Namhyung Kim wrote:
> This fixes following sparse warning on x86_64:
> 
>  arch/x86/kernel/kgdb.c:123:9: warning: switch with no cases
> 

Thanks for the report on this.  

The preferred fix for the warning is below, and I'll queue it for the 2.6.38 merge window.

Thanks,
Jason.

--

From: Jason Wessel <jason.wessel@windriver.com>
Subject: [PATCH] kgdb,x86_64: fix compile warning found with sparse
Date: Mon Nov 22 08:38:04 CST 2010

Fix sparse warning:

arch/x86/kernel/kgdb.c:123:9: warning: switch with no cases

Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

---
 arch/x86/kernel/kgdb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -120,8 +120,8 @@ char *dbg_get_reg(int regno, void *mem, 
 		memcpy(mem, (void *)regs + dbg_reg_def[regno].offset,
 		       dbg_reg_def[regno].size);
 
-	switch (regno) {
 #ifdef CONFIG_X86_32
+	switch (regno) {
 	case GDB_SS:
 		if (!user_mode_vm(regs))
 			*(unsigned long *)mem = __KERNEL_DS;
@@ -134,8 +134,8 @@ char *dbg_get_reg(int regno, void *mem, 
 	case GDB_FS:
 		*(unsigned long *)mem = 0xFFFF;
 		break;
-#endif
 	}
+#endif
 	return dbg_reg_def[regno].name;
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86_64,kgdb: add default case into a switch
  2010-11-22 14:39 ` Jason Wessel
@ 2010-11-23  3:21   ` Namhyung Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2010-11-23  3:21 UTC (permalink / raw)
  To: Jason Wessel
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel

2010-11-22 (월), 08:39 -0600, Jason Wessel:
> On 11/22/2010 01:02 AM, Namhyung Kim wrote:
> > This fixes following sparse warning on x86_64:
> > 
> >  arch/x86/kernel/kgdb.c:123:9: warning: switch with no cases
> > 
> 
> Thanks for the report on this.  
> 
> The preferred fix for the warning is below, and I'll queue it for the 2.6.38 merge window.
> 
> Thanks,
> Jason.

Looks good to me, thanks.


-- 
Regards,
Namhyung Kim



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-23  3:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-22  7:02 [PATCH] x86_64,kgdb: add default case into a switch Namhyung Kim
2010-11-22 14:39 ` Jason Wessel
2010-11-23  3:21   ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).