* [PATCH] powerpc/8xx: xmon compile fix
@ 2016-11-29 8:56 Nicholas Piggin
2016-11-29 9:06 ` Christophe LEROY
2016-11-30 8:00 ` Michael Ellerman
0 siblings, 2 replies; 5+ messages in thread
From: Nicholas Piggin @ 2016-11-29 8:56 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Nicholas Piggin, linuxppc-dev
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/8xx: xmon compile fix
2016-11-29 8:56 [PATCH] powerpc/8xx: xmon compile fix Nicholas Piggin
@ 2016-11-29 9:06 ` Christophe LEROY
2016-11-29 9:53 ` Nicholas Piggin
2016-11-30 8:00 ` Michael Ellerman
1 sibling, 1 reply; 5+ messages in thread
From: Christophe LEROY @ 2016-11-29 9:06 UTC (permalink / raw)
To: Nicholas Piggin, Michael Ellerman; +Cc: linuxppc-dev
Le 29/11/2016 à 09:56, Nicholas Piggin a écrit :
> 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) {
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/8xx: xmon compile fix
2016-11-29 9:06 ` Christophe LEROY
@ 2016-11-29 9:53 ` Nicholas Piggin
0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Piggin @ 2016-11-29 9:53 UTC (permalink / raw)
To: Christophe LEROY; +Cc: Michael Ellerman, linuxppc-dev
On Tue, 29 Nov 2016 10:06:43 +0100
Christophe LEROY <christophe.leroy@c-s.fr> wrote:
> Le 29/11/2016 à 09:56, Nicholas Piggin a écrit :
> > 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?
>
> > + 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/8xx: xmon compile fix
2016-11-29 8:56 [PATCH] powerpc/8xx: xmon compile fix Nicholas Piggin
2016-11-29 9:06 ` Christophe LEROY
@ 2016-11-30 8:00 ` Michael Ellerman
2016-11-30 8:08 ` Nicholas Piggin
1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2016-11-30 8:00 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: Nicholas Piggin, linuxppc-dev
Nicholas Piggin <npiggin@gmail.com> 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
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/8xx: xmon compile fix
2016-11-30 8:00 ` Michael Ellerman
@ 2016-11-30 8:08 ` Nicholas Piggin
0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Piggin @ 2016-11-30 8:08 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Wed, 30 Nov 2016 19:00:57 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:
> Nicholas Piggin <npiggin@gmail.com> 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?
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-11-30 8:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29 8:56 [PATCH] powerpc/8xx: xmon compile fix Nicholas Piggin
2016-11-29 9:06 ` Christophe LEROY
2016-11-29 9:53 ` Nicholas Piggin
2016-11-30 8:00 ` Michael Ellerman
2016-11-30 8:08 ` Nicholas Piggin
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).