qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-tricore: Fix check which was always false
@ 2015-03-21 13:44 Stefan Weil
  2015-03-25  8:26 ` Bastian Koppelmann
  2015-03-25 15:20 ` Michael Tokarev
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Weil @ 2015-03-21 13:44 UTC (permalink / raw)
  To: QEMU Trivial; +Cc: Bastian Koppelmann, QEMU Developer, Stefan Weil

With a mask value of 0x00400000, the result will never be 1.
This fixes a Coverity warning.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 target-tricore/op_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c
index 0e7b4e8..b7d18b2 100644
--- a/target-tricore/op_helper.c
+++ b/target-tricore/op_helper.c
@@ -2593,7 +2593,7 @@ void helper_rslcx(CPUTriCoreState *env)
         /* CSU trap */
     }
     /* if (PCXI.UL == 1) then trap(CTYP); */
-    if ((env->PCXI & MASK_PCXI_UL) == 1) {
+    if ((env->PCXI & MASK_PCXI_UL) != 0) {
         /* CTYP trap */
     }
     /* EA = {PCXI.PCXS, 6'b0, PCXI.PCXO, 6'b0}; */
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-tricore: Fix check which was always false
  2015-03-21 13:44 [Qemu-devel] [PATCH] target-tricore: Fix check which was always false Stefan Weil
@ 2015-03-25  8:26 ` Bastian Koppelmann
  2015-03-25 15:20 ` Michael Tokarev
  1 sibling, 0 replies; 4+ messages in thread
From: Bastian Koppelmann @ 2015-03-25  8:26 UTC (permalink / raw)
  To: Stefan Weil, QEMU Trivial; +Cc: mjt, QEMU Developer

Hi mjt,

On 03/21/2015 02:44 PM, Stefan Weil wrote:
> With a mask value of 0x00400000, the result will never be 1.
> This fixes a Coverity warning.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>   target-tricore/op_helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c
> index 0e7b4e8..b7d18b2 100644
> --- a/target-tricore/op_helper.c
> +++ b/target-tricore/op_helper.c
> @@ -2593,7 +2593,7 @@ void helper_rslcx(CPUTriCoreState *env)
>           /* CSU trap */
>       }
>       /* if (PCXI.UL == 1) then trap(CTYP); */
> -    if ((env->PCXI & MASK_PCXI_UL) == 1) {
> +    if ((env->PCXI & MASK_PCXI_UL) != 0) {
>           /* CTYP trap */
>       }
>       /* EA = {PCXI.PCXS, 6'b0, PCXI.PCXO, 6'b0}; */

are you picking this one up? It looks good to me.

Cheers,
Bastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-tricore: Fix check which was always false
  2015-03-21 13:44 [Qemu-devel] [PATCH] target-tricore: Fix check which was always false Stefan Weil
  2015-03-25  8:26 ` Bastian Koppelmann
@ 2015-03-25 15:20 ` Michael Tokarev
  2015-03-25 15:39   ` Bastian Koppelmann
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2015-03-25 15:20 UTC (permalink / raw)
  To: Stefan Weil, QEMU Trivial; +Cc: Bastian Koppelmann, QEMU Developer

21.03.2015 16:44, Stefan Weil wrote:
> With a mask value of 0x00400000, the result will never be 1.
> This fixes a Coverity warning.

Might be a bit risky if the whole thing wasn't a complete no-op.
I wonder maybe the whole this if statement should be removed..

But anyway, applied to -trivial, thank you!

/mjt

> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  target-tricore/op_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-tricore/op_helper.c b/target-tricore/op_helper.c
> index 0e7b4e8..b7d18b2 100644
> --- a/target-tricore/op_helper.c
> +++ b/target-tricore/op_helper.c
> @@ -2593,7 +2593,7 @@ void helper_rslcx(CPUTriCoreState *env)
>          /* CSU trap */
>      }
>      /* if (PCXI.UL == 1) then trap(CTYP); */
> -    if ((env->PCXI & MASK_PCXI_UL) == 1) {
> +    if ((env->PCXI & MASK_PCXI_UL) != 0) {
>          /* CTYP trap */
>      }
>      /* EA = {PCXI.PCXS, 6'b0, PCXI.PCXO, 6'b0}; */
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-tricore: Fix check which was always false
  2015-03-25 15:20 ` Michael Tokarev
@ 2015-03-25 15:39   ` Bastian Koppelmann
  0 siblings, 0 replies; 4+ messages in thread
From: Bastian Koppelmann @ 2015-03-25 15:39 UTC (permalink / raw)
  To: Michael Tokarev, Stefan Weil, QEMU Trivial; +Cc: QEMU Developer



On 03/25/2015 04:20 PM, Michael Tokarev wrote:
> 21.03.2015 16:44, Stefan Weil wrote:
>> With a mask value of 0x00400000, the result will never be 1.
>> This fixes a Coverity warning.
> Might be a bit risky if the whole thing wasn't a complete no-op.
> I wonder maybe the whole this if statement should be removed..
>
> But anyway, applied to -trivial, thank you!
>
> /mjt
>
Thanks. The statement is just an indicator for a trap which needs to 
happen there. I'm working on this right now, so it won't stay like this 
for long :).

Cheers,
Bastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-25 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-21 13:44 [Qemu-devel] [PATCH] target-tricore: Fix check which was always false Stefan Weil
2015-03-25  8:26 ` Bastian Koppelmann
2015-03-25 15:20 ` Michael Tokarev
2015-03-25 15:39   ` Bastian Koppelmann

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).