lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Mar 2019 22:12:59 +0100
From:   Mathieu Malaterre <malat@...ian.org>
To:     Christophe Leroy <christophe.leroy@....fr>
Cc:     Michael Ellerman <mpe@...erman.id.au>,
        Paul Mackerras <paulus@...ba.org>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'

On Tue, Mar 12, 2019 at 9:56 PM Christophe Leroy
<christophe.leroy@....fr> wrote:
>
>
>
> Le 12/03/2019 à 21:20, Mathieu Malaterre a écrit :
> > Add gcc attribute unused for `rc` variable.
> >
> > Fix warnings treated as errors with W=1:
> >
> >    arch/powerpc/lib/sstep.c:1172:31: error: variable 'rc' set but not used [-Werror=unused-but-set-variable]
> >
> > Signed-off-by: Mathieu Malaterre <malat@...ian.org>
> > ---
> >   arch/powerpc/lib/sstep.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
> > index 3d33fb509ef4..32d092f62ae0 100644
> > --- a/arch/powerpc/lib/sstep.c
> > +++ b/arch/powerpc/lib/sstep.c
> > @@ -1169,7 +1169,7 @@ static nokprobe_inline int trap_compare(long v1, long v2)
> >   int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
> >                 unsigned int instr)
> >   {
> > -     unsigned int opcode, ra, rb, rc, rd, spr, u;
> > +     unsigned int opcode, ra, rb, rc __maybe_unused, rd, spr, u;
>
> I think it would be better to enclose 'rc' inside a #ifdef CONFIG_PPC64

Hum odd, I would have bet you would have suggested me to use
IS_ENABLED with some crazy scheme (I was not able to mix it with the
switch case nicely).

Anyway I'll try your suggestion and post a v2.

> Christophe
>
> >       unsigned long int imm;
> >       unsigned long int val, val2;
> >       unsigned int mb, me, sh;
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ