Skip to contentSkip to conversation

qemu: implicit precedence for logical operator in has_work

PATCH Applied Carlo Marcelo Arenas Belon 3 participants 4 messages Feb 20, 2008 – Feb 24, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: implicit precedence for logical operator in has_work

janitorial fix for :

qemu/qemu-kvm.c: In function `has_work':
qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||

---
 qemu/qemu-kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu/qemu-kvm.c +1 -1
index ffc59d5..4056453 100644
@@ -137,7 +137,7 @@ extern int vm_running;
 
 static int has_work(CPUState *env)
 {
-    if (!vm_running || env && vcpu_info[env->cpu_index].stopped)
+    if (!vm_running || (env && vcpu_info[env->cpu_index].stopped))
 	return 0;
     if (!(env->hflags & HF_HALTED_MASK))
 	return 1;
Signature · 7 lines
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
#1 lore raw
Quoted 15 lines · Carlo Marcelo Arenas Belon

janitorial fix for :

qemu/qemu-kvm.c: In function `has_work':
qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||

---
qemu/qemu-kvm.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
qemu/qemu-kvm.c +0 -0
index ffc59d5..4056453 100644

qemu/qemu-kvm.c extern int vm_running; · line 140

Quoted 5 lines
qemu/qemu-kvm.c +1 -1
@@ -137,7 +137,7 @@ extern int vm_running;
 
 static int has_work(CPUState *env)
 {
-    if (!vm_running || env && vcpu_info[env->cpu_index].stopped)
+    if (!vm_running || (env && vcpu_info[env->cpu_index].stopped))

What exactly is the env check needed for here?

qemu/qemu-kvm.c extern int vm_running; · line 142

Quoted 3 lines
qemu/qemu-kvm.c +0 -0
 	return 0;
    if (!(env->hflags & HF_HALTED_MASK))

It won't be done here anyway...

Quoted 14 lines
qemu/qemu-kvm.c +0 -0
 	return 1;
Signature · 11 lines
1.5.3.7


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#2 lore raw
Quoted 19 lines · Alexander Graf
Quoted 16 lines · Carlo Marcelo Arenas Belon

janitorial fix for :

qemu/qemu-kvm.c: In function `has_work':
qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||

---
qemu/qemu-kvm.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
qemu/qemu-kvm.c +0 -0
index ffc59d5..4056453 100644
@@ -137,7 +137,7 @@ extern int vm_running;
 
Quoted 9 lines

qemu/qemu-kvm.c extern int vm_running;

Quoted 5 lines
qemu/qemu-kvm.c +1 -1
 static int has_work(CPUState *env)
 {
-    if (!vm_running || env && vcpu_info[env->cpu_index].stopped)
+    if (!vm_running || (env && vcpu_info[env->cpu_index].stopped))
 

What exactly is the env check needed for here?

This code arrived from another location, where it was necessary.

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Applied
#3 lore raw
In reply to Carlo Marcelo Arenas Belon
Quoted 6 lines · Carlo Marcelo Arenas Belon

janitorial fix for :

qemu/qemu-kvm.c: In function `has_work':
qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||

Applied, thanks.

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/