[PATCH] powerpc/8xx: xmon compile fix

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3539d

5 messages, 3 authors, 2016-11-30 · open the first message on its own page

[PATCH] powerpc/8xx: xmon compile fix

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2016-11-29 08:57:05

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 7605455..435f5f5 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1213,10 +1213,13 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
+#ifndef CONFIG_8xx
+	int mode;
 	const char badaddr[] = "Only kernel addresses are permitted "
 		"for breakpoints\n";
+#endif
 
 	cmd = inchar();
 	switch (cmd) {
-- 
2.10.2

Re: [PATCH] powerpc/8xx: xmon compile fix

From: Christophe LEROY <hidden>
Date: 2016-11-29 09:07:57


Le 29/11/2016 à 09:56, Nicholas Piggin a écrit :
quoted hunk
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 7605455..435f5f5 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1213,10 +1213,13 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
+#ifndef CONFIG_8xx
CONFIG_8xx is deprecated (ref arch/powerpc/platforms/Kconfig.cputype).
CONFIG_PPC_8xx should be used instead.
+	int mode;
You could also have moved this declaration inside the switch {, 
something like

	switch (cmd) {
#ifndef CONFIG_8xx
+		int mode;
	case 'd':


Christophe
 	const char badaddr[] = "Only kernel addresses are permitted "
 		"for breakpoints\n";
+#endif

 	cmd = inchar();
 	switch (cmd) {

Re: [PATCH] powerpc/8xx: xmon compile fix

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2016-11-29 09:53:42

On Tue, 29 Nov 2016 10:06:43 +0100
Christophe LEROY [off-list ref] wrote:
Le 29/11/2016 à 09:56, Nicholas Piggin a écrit :
quoted
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/xmon/xmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 7605455..435f5f5 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1213,10 +1213,13 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
+#ifndef CONFIG_8xx  
CONFIG_8xx is deprecated (ref arch/powerpc/platforms/Kconfig.cputype).
CONFIG_PPC_8xx should be used instead.
Thanks for picking that up. Michael, can you adjust it if you merge
please?
quoted
+	int mode;  
You could also have moved this declaration inside the switch {, 
something like
I tried that, couldn't decide that it was better (you also need badaddr).

Thanks,
Nick

Re: [PATCH] powerpc/8xx: xmon compile fix

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-11-30 08:00:58

Nicholas Piggin [off-list ref] writes:
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
What's the actual error? mode/badaddr defined but not used?

I'm just curious why I've never hit it?

cheers
quoted hunk
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 7605455..435f5f5 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1213,10 +1213,13 @@ bpt_cmds(void)
 {
 	int cmd;
 	unsigned long a;
-	int mode, i;
+	int i;
 	struct bpt *bp;
+#ifndef CONFIG_8xx
+	int mode;
 	const char badaddr[] = "Only kernel addresses are permitted "
 		"for breakpoints\n";
+#endif
 
 	cmd = inchar();
 	switch (cmd) {
-- 
2.10.2

Re: [PATCH] powerpc/8xx: xmon compile fix

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2016-11-30 08:08:53

On Wed, 30 Nov 2016 19:00:57 +1100
Michael Ellerman [off-list ref] wrote:
Nicholas Piggin [off-list ref] writes:
quoted
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>  
What's the actual error? mode/badaddr defined but not used?

I'm just curious why I've never hit it?
Yes exactly. I'm not sure why you wouldn't have seen it. I'm
using powerpc64 compiler to build 32-bit, but I don't think
that should make a difference for this warning.

Thanks,
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help