[PATCH 3/3] powerpc/8xx: xmon compile fix
David Laight
David.Laight at ACULAB.COM
Sat May 27 02:20:33 AEST 2017
From: Michael Ellerman
> Sent: 26 May 2017 08:24
> Nicholas Piggin <npiggin at gmail.com> writes:
> > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> > index f11f65634aab..438fdb0fb142 100644
> > --- a/arch/powerpc/xmon/xmon.c
> > +++ b/arch/powerpc/xmon/xmon.c
> > @@ -1242,14 +1242,16 @@ bpt_cmds(void)
> > {
> > int cmd;
> > unsigned long a;
> > - int mode, i;
> > + int i;
> > struct bpt *bp;
> > - const char badaddr[] = "Only kernel addresses are permitted "
> > - "for breakpoints\n";
> >
> > cmd = inchar();
> > switch (cmd) {
> > -#ifndef CONFIG_8xx
> > +#ifndef CONFIG_PPC_8xx
> > + int mode;
> > + const char badaddr[] = "Only kernel addresses are permitted "
> > + "for breakpoints\n";
> > +
> > case 'd': /* bd - hardware data breakpoint */
> > mode = 7;
> > cmd = inchar();
>
> GCC 7 rejects this:
>
> arch/powerpc/xmon/xmon.c: In function bpt_cmds:
> arch/powerpc/xmon/xmon.c:1252:13: error: statement will never be executed [-Werror=switch-
> unreachable]
> const char badaddr[] = "Only kernel addresses are permitted for breakpoints\n";
> ^~~~~~~
Try 'static' ?
David
More information about the Linuxppc-dev
mailing list