public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] qemu: implicit precedence for logical operator in has_work
  2008-02-20  8:30 [PATCH] qemu: implicit precedence for logical operator in has_work Carlo Marcelo Arenas Belon
@ 2008-02-20  8:23 ` Alexander Graf
  2008-02-24  9:59   ` Avi Kivity
  2008-02-24  9:58 ` Avi Kivity
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2008-02-20  8:23 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belon; +Cc: kvm-devel


On Feb 20, 2008, at 9:30 AM, Carlo Marcelo Arenas Belon wrote:

> janitorial fix for :
>
>  qemu/qemu-kvm.c: In function `has_work':
>  qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||
>
> Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
> ---
> qemu/qemu-kvm.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
> index ffc59d5..4056453 100644
> --- a/qemu/qemu-kvm.c
> +++ b/qemu/qemu-kvm.c
> @@ -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?

>
> 	return 0;
>     if (!(env->hflags & HF_HALTED_MASK))

It won't be done here anyway...

>
> 	return 1;
> -- 
> 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
> kvm-devel@lists.sourceforge.net
> 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/

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

* [PATCH] qemu: implicit precedence for logical operator in has_work
@ 2008-02-20  8:30 Carlo Marcelo Arenas Belon
  2008-02-20  8:23 ` Alexander Graf
  2008-02-24  9:58 ` Avi Kivity
  0 siblings, 2 replies; 4+ messages in thread
From: Carlo Marcelo Arenas Belon @ 2008-02-20  8:30 UTC (permalink / raw)
  To: kvm-devel

janitorial fix for :

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

Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
---
 qemu/qemu-kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index ffc59d5..4056453 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -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;
-- 
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/

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

* Re: [PATCH] qemu: implicit precedence for logical operator in has_work
  2008-02-20  8:30 [PATCH] qemu: implicit precedence for logical operator in has_work Carlo Marcelo Arenas Belon
  2008-02-20  8:23 ` Alexander Graf
@ 2008-02-24  9:58 ` Avi Kivity
  1 sibling, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-02-24  9:58 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belon; +Cc: kvm-devel

Carlo Marcelo Arenas Belon wrote:
> janitorial fix for :
>
>   qemu/qemu-kvm.c: In function `has_work':
>   qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||
>
>   

Applied, thanks.

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

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

* Re: [PATCH] qemu: implicit precedence for logical operator in has_work
  2008-02-20  8:23 ` Alexander Graf
@ 2008-02-24  9:59   ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-02-24  9:59 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm-devel, Carlo Marcelo Arenas Belon

Alexander Graf wrote:
> On Feb 20, 2008, at 9:30 AM, Carlo Marcelo Arenas Belon wrote:
>
>   
>> janitorial fix for :
>>
>>  qemu/qemu-kvm.c: In function `has_work':
>>  qemu/qemu-kvm.c:140: warning: suggest parentheses around && within ||
>>
>> Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
>> ---
>> qemu/qemu-kvm.c |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
>> index ffc59d5..4056453 100644
>> --- a/qemu/qemu-kvm.c
>> +++ b/qemu/qemu-kvm.c
>> @@ -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?
>
>   

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

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

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

end of thread, other threads:[~2008-02-24  9:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20  8:30 [PATCH] qemu: implicit precedence for logical operator in has_work Carlo Marcelo Arenas Belon
2008-02-20  8:23 ` Alexander Graf
2008-02-24  9:59   ` Avi Kivity
2008-02-24  9:58 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox