* [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation
@ 2014-03-15 18:33 Paolo Bonzini
2014-03-15 20:40 ` Richard Henderson
2014-03-15 23:47 ` Peter Maydell
0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-03-15 18:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, rth
Two missing braces, one close and one open, fabulously let the code
compile.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target-alpha/translate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index a9ef1a7..e7e319b 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -1927,6 +1927,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
else {
tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
+ }
}
}
break;
@@ -1991,7 +1992,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
} else {
if (islit)
tcg_gen_movi_i64(cpu_ir[rc], -lit);
- else
+ else {
tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
}
--
1.8.5.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation
2014-03-15 18:33 [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation Paolo Bonzini
@ 2014-03-15 20:40 ` Richard Henderson
2014-03-18 21:33 ` Stuart Brady
2014-03-15 23:47 ` Peter Maydell
1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2014-03-15 20:40 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial
On 03/15/2014 11:33 AM, Paolo Bonzini wrote:
> Two missing braces, one close and one open, fabulously let the code
> compile.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Wow. That's ... amazing.
Reviewed-by: Richard Henderson <rth@twiddle.net>
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation
2014-03-15 18:33 [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation Paolo Bonzini
2014-03-15 20:40 ` Richard Henderson
@ 2014-03-15 23:47 ` Peter Maydell
2014-03-16 7:59 ` Paolo Bonzini
1 sibling, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2014-03-15 23:47 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Trivial, QEMU Developers, Richard Henderson
On 15 March 2014 18:33, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Two missing braces, one close and one open, fabulously let the code
> compile.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> target-alpha/translate.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index a9ef1a7..e7e319b 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -1927,6 +1927,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
> else {
> tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
> tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
> + }
> }
> }
> break;
> @@ -1991,7 +1992,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
> } else {
> if (islit)
> tcg_gen_movi_i64(cpu_ir[rc], -lit);
> - else
> + else {
> tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
> tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
> }
I'm surprised checkpatch didn't insist you added braces to the "if"
half of this if-else as well.
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation
2014-03-15 23:47 ` Peter Maydell
@ 2014-03-16 7:59 ` Paolo Bonzini
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-03-16 7:59 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Trivial, QEMU Developers, Richard Henderson
Il 16/03/2014 00:47, Peter Maydell ha scritto:
> On 15 March 2014 18:33, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> Two missing braces, one close and one open, fabulously let the code
>> compile.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> target-alpha/translate.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
>> index a9ef1a7..e7e319b 100644
>> --- a/target-alpha/translate.c
>> +++ b/target-alpha/translate.c
>> @@ -1927,6 +1927,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
>> else {
>> tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
>> tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
>> + }
>> }
>> }
>> break;
>> @@ -1991,7 +1992,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
>> } else {
>> if (islit)
>> tcg_gen_movi_i64(cpu_ir[rc], -lit);
>> - else
>> + else {
>> tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
>> tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
>> }
>
> I'm surprised checkpatch didn't insist you added braces to the "if"
> half of this if-else as well.
I must admit I ignored it. It makes the patch harder to review, since
the bug is explicitly about missing (unmatched) braces. I can add the
braces throughout the file, but I don't think it's a reason to obfuscate
this particular patch.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation
2014-03-15 20:40 ` Richard Henderson
@ 2014-03-18 21:33 ` Stuart Brady
0 siblings, 0 replies; 5+ messages in thread
From: Stuart Brady @ 2014-03-18 21:33 UTC (permalink / raw)
To: qemu-devel
On Sat, Mar 15, 2014 at 01:40:26PM -0700, Richard Henderson wrote:
> On 03/15/2014 11:33 AM, Paolo Bonzini wrote:
> > Two missing braces, one close and one open, fabulously let the code
> > compile.
> >
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> Wow. That's ... amazing.
>
> Reviewed-by: Richard Henderson <rth@twiddle.net>
The *really* amazing thing about this (at least as far as I can see) is
the missing braces didn't alter the semantics of the code, except that
with the patch we no longer generate an extra TCG op with no effect...
--
Cheers,
Stuart
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-18 21:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-15 18:33 [Qemu-devel] [PATCH] target-alpha: fix subl and s8subl indentation Paolo Bonzini
2014-03-15 20:40 ` Richard Henderson
2014-03-18 21:33 ` Stuart Brady
2014-03-15 23:47 ` Peter Maydell
2014-03-16 7:59 ` Paolo Bonzini
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).