All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mathieu Malaterre <malat@debian.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'
Date: Tue, 12 Mar 2019 22:25:34 +0100	[thread overview]
Message-ID: <94d90740-c970-01b0-c430-bafc2e9eecd3@c-s.fr> (raw)
In-Reply-To: <CA+7wUsyA698UtNLni7wi3=cKjbCd1V71YA0sxDtMD=MmQvQxTQ@mail.gmail.com>



Le 12/03/2019 à 22:12, Mathieu Malaterre a écrit :
> On Tue, Mar 12, 2019 at 9:56 PM Christophe Leroy
> <christophe.leroy@c-s.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@debian.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).

Well I guess yes, you could also get rid of the #ifdef __powerpc64__ and 
instead add the following just after the 'case 4:'

if (!IS_ENABLED(CONFIG_64))
	break;

That's less uggly than adding two #ifdef/#endif

Christophe

> 
> 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;
>>>

WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Mathieu Malaterre <malat@debian.org>
Cc: Paul Mackerras <paulus@samba.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr'
Date: Tue, 12 Mar 2019 22:25:34 +0100	[thread overview]
Message-ID: <94d90740-c970-01b0-c430-bafc2e9eecd3@c-s.fr> (raw)
In-Reply-To: <CA+7wUsyA698UtNLni7wi3=cKjbCd1V71YA0sxDtMD=MmQvQxTQ@mail.gmail.com>



Le 12/03/2019 à 22:12, Mathieu Malaterre a écrit :
> On Tue, Mar 12, 2019 at 9:56 PM Christophe Leroy
> <christophe.leroy@c-s.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@debian.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).

Well I guess yes, you could also get rid of the #ifdef __powerpc64__ and 
instead add the following just after the 'case 4:'

if (!IS_ENABLED(CONFIG_64))
	break;

That's less uggly than adding two #ifdef/#endif

Christophe

> 
> 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;
>>>

  reply	other threads:[~2019-03-12 21:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 20:20 [PATCH] powerpc: sstep: Mark variable `rc` as unused in function 'analyse_instr' Mathieu Malaterre
2019-03-12 20:20 ` Mathieu Malaterre
2019-03-12 20:56 ` Christophe Leroy
2019-03-12 20:56   ` Christophe Leroy
2019-03-12 21:12   ` Mathieu Malaterre
2019-03-12 21:12     ` Mathieu Malaterre
2019-03-12 21:25     ` Christophe Leroy [this message]
2019-03-12 21:25       ` Christophe Leroy
2019-03-13 20:12       ` Mathieu Malaterre
2019-03-13 20:12         ` Mathieu Malaterre
2019-03-12 21:23 ` [PATCH v2] powerpc/32: sstep: Move variable `rc` within CONFIG_PPC64 sentinels Mathieu Malaterre
2019-03-12 21:23   ` Mathieu Malaterre
2019-05-23 11:49   ` Mathieu Malaterre
2019-05-23 11:49     ` Mathieu Malaterre
2019-05-28 11:40   ` Michael Ellerman
2019-05-28 11:40     ` Michael Ellerman
2019-05-28 15:52     ` Mathieu Malaterre
2019-05-28 15:52       ` Mathieu Malaterre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94d90740-c970-01b0-c430-bafc2e9eecd3@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=malat@debian.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.