Skip to contentSkip to conversation

target/hexagon: fix = vs. == mishap

PATCH In review Paolo Bonzini 4 participants 6 messages Apr 27, 2023 – Apr 28, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/hexagon: fix = vs. == mishap

Coverity reports a parameter that is "set but never used". This is caused by an assignment operator being used instead of equality.

---
 target/hexagon/idef-parser/parser-helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/idef-parser/parser-helpers.c +1 -1
index 86511efb62b9..0a01ec39b75e 100644
@@ -1123,7 +1123,7 @@ HexValue gen_extend_op(Context *c,
                        HexValue *value,
                        HexSignedness signedness)
 {
-    unsigned bit_width = (dst_width = 64) ? 64 : 32;
+    unsigned bit_width = (dst_width == 64) ? 64 : 32;
     HexValue value_m = *value;
     HexValue src_width_m = *src_width;
 
Signature · 1 line
2.40.0
#2 lore raw
Quoted 16 lines

-----Original Message-----
From: Richard Henderson <[email protected]>
Sent: Thursday, April 27, 2023 8:33 AM
To: Paolo Bonzini <[email protected]>; [email protected]
Cc: Taylor Simpson <[email protected]>
Subject: Re: [PATCH] target/hexagon: fix = vs. == mishap

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 3 lines · Paolo Bonzini

Coverity reports a parameter that is "set but never used". This is caused by an assignment operator being used instead of equality.

Quoted 7 lines
Quoted 5 lines
---
  target/hexagon/idef-parser/parser-helpers.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Queued with next Hexagon update

Thanks,
Taylor

#3 lore raw
Quoted 32 lines

-----Original Message-----
From: Taylor Simpson
Sent: Thursday, April 27, 2023 6:05 PM
To: Richard Henderson <[email protected]>; Paolo Bonzini <[email protected]>; [email protected]
Subject: RE: [PATCH] target/hexagon: fix = vs. == mishap

Quoted 8 lines

-----Original Message-----
From: Richard Henderson <[email protected]>
Sent: Thursday, April 27, 2023 8:33 AM
To: Paolo Bonzini <[email protected]>; [email protected]
Cc: Taylor Simpson <[email protected]>
Subject: Re: [PATCH] target/hexagon: fix = vs. == mishap

WARNING: This email originated from outside of Qualcomm. Please be

wary

Quoted 12 lines

of any links or attachments, and do not enable macros.

Quoted 8 lines · Paolo Bonzini

Coverity reports a parameter that is "set but never used". This is caused by an assignment operator being used instead of equality.

---
  target/hexagon/idef-parser/parser-helpers.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines
Quoted 1 line

Queued with next Hexagon update

This patch is causing some yyassert's when idef-parser runs. They are coming from sign and zero extends. WARNING (A2_vavgw): 'Extending to a size smaller than the current size makes no sense'

I will investigate.

Taylor

Reviewed-by on v1 1/1
#4 lore raw
In reply to Paolo Bonzini
Quoted 27 lines

-----Original Message-----
From: Paolo Bonzini <[email protected]>
Sent: Thursday, April 27, 2023 7:57 AM
To: [email protected]
Cc: Taylor Simpson <[email protected]>
Subject: [PATCH] target/hexagon: fix = vs. == mishap

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Coverity reports a parameter that is "set but never used". This is caused by an assignment operator being used instead of equality.

---
 target/hexagon/idef-parser/parser-helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/idef-parser/parser-helpers.c +0 -0
index 86511efb62b9..0a01ec39b75e 100644

target/hexagon/idef-parser/parser-helpers.c HexValue gen_extend_op(Context *c, · line 1127

Quoted 6 lines
target/hexagon/idef-parser/parser-helpers.c +1 -1
@@ -1123,7 +1123,7 @@ HexValue gen_extend_op(Context *c,
                        HexValue *value,
                        HexSignedness signedness)  {
-    unsigned bit_width = (dst_width = 64) ? 64 : 32;
+    unsigned bit_width = (dst_width == 64) ? 64 : 32;
     HexValue value_m = *value;
     HexValue src_width_m = *src_width;
Cc Alessandro Di Federico <[email protected]>
Cc Anton Johansson <[email protected]>
Reviewed-by Anton Johansson on v1 1/1
#5 lore raw
In reply to Paolo Bonzini
Quoted 14 lines · Paolo Bonzini

Coverity reports a parameter that is "set but never used". This is caused by an assignment operator being used instead of equality.

---
  target/hexagon/idef-parser/parser-helpers.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/idef-parser/parser-helpers.c +0 -0
index 86511efb62b9..0a01ec39b75e 100644

target/hexagon/idef-parser/parser-helpers.c HexValue gen_extend_op(Context *c, · line 1129

Quoted 8 lines
target/hexagon/idef-parser/parser-helpers.c +1 -1
@@ -1123,7 +1123,7 @@ HexValue gen_extend_op(Context *c,
                         HexValue *value,
                         HexSignedness signedness)
  {
-    unsigned bit_width = (dst_width = 64) ? 64 : 32;
+    unsigned bit_width = (dst_width == 64) ? 64 : 32;
      HexValue value_m = *value;
      HexValue src_width_m = *src_width;