[Qemu-devel] [PATCH V2 3/4] tests/libqos: fix usage of bool in pci-spapr.c

Jafar Abdi posted 4 patches 6 years, 10 months ago
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>, Stefan Berger <stefanb@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Laurent Vivier <lvivier@redhat.com>
[Qemu-devel] [PATCH V2 3/4] tests/libqos: fix usage of bool in pci-spapr.c
Posted by Jafar Abdi 6 years, 10 months ago
Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h.

FALSE and TRUE (with capital letters) are the constants defined by glib for
being used with the "gboolean" type of glib. But some parts of the code also use
TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>).

Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 tests/libqos/pci-spapr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
index 6925925..58ba27a 100644
--- a/tests/libqos/pci-spapr.c
+++ b/tests/libqos/pci-spapr.c
@@ -156,7 +156,7 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts,
     assert(qts);
 
     /* tests cannot use spapr, needs to be fixed first */
-    qpci->bus.has_buggy_msi = TRUE;
+    qpci->bus.has_buggy_msi = true;
 
     qpci->alloc = alloc;
 
-- 
2.7.4


Re: [Qemu-devel] [PATCH V2 3/4] tests/libqos: fix usage of bool in pci-spapr.c
Posted by David Gibson 6 years, 10 months ago
On Sat, Mar 23, 2019 at 05:26:36PM +0300, Jafar Abdi wrote:
> Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h.
> 
> FALSE and TRUE (with capital letters) are the constants defined by glib for
> being used with the "gboolean" type of glib. But some parts of the code also use
> TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>).
> 
> Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

Do you want me to take this through my tree?

> ---
>  tests/libqos/pci-spapr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
> index 6925925..58ba27a 100644
> --- a/tests/libqos/pci-spapr.c
> +++ b/tests/libqos/pci-spapr.c
> @@ -156,7 +156,7 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts,
>      assert(qts);
>  
>      /* tests cannot use spapr, needs to be fixed first */
> -    qpci->bus.has_buggy_msi = TRUE;
> +    qpci->bus.has_buggy_msi = true;
>  
>      qpci->alloc = alloc;
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH V2 3/4] tests/libqos: fix usage of bool in pci-spapr.c
Posted by Thomas Huth 6 years, 10 months ago
On 23/03/2019 15.26, Jafar Abdi wrote:
> Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h.
> 
> FALSE and TRUE (with capital letters) are the constants defined by glib for
> being used with the "gboolean" type of glib. But some parts of the code also use
> TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>).
> 
> Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  tests/libqos/pci-spapr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
> index 6925925..58ba27a 100644
> --- a/tests/libqos/pci-spapr.c
> +++ b/tests/libqos/pci-spapr.c
> @@ -156,7 +156,7 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts,
>      assert(qts);
>  
>      /* tests cannot use spapr, needs to be fixed first */
> -    qpci->bus.has_buggy_msi = TRUE;
> +    qpci->bus.has_buggy_msi = true;
>  
>      qpci->alloc = alloc;

Reviewed-by: Thomas Huth <thuth@redhat.com>

Re: [Qemu-devel] [PATCH V2 3/4] tests/libqos: fix usage of bool in pci-spapr.c
Posted by David Gibson 6 years, 10 months ago
On Sat, Mar 23, 2019 at 05:26:36PM +0300, Jafar Abdi wrote:
> Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h.
> 
> FALSE and TRUE (with capital letters) are the constants defined by glib for
> being used with the "gboolean" type of glib. But some parts of the code also use
> TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>).
> 
> Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

I've applied this to my ppc-for-4.1 tree.  If it goes in elsewhere as
well, that's fine, it's a trivial merge.

> ---
>  tests/libqos/pci-spapr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
> index 6925925..58ba27a 100644
> --- a/tests/libqos/pci-spapr.c
> +++ b/tests/libqos/pci-spapr.c
> @@ -156,7 +156,7 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts,
>      assert(qts);
>  
>      /* tests cannot use spapr, needs to be fixed first */
> -    qpci->bus.has_buggy_msi = TRUE;
> +    qpci->bus.has_buggy_msi = true;
>  
>      qpci->alloc = alloc;
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH V2 3/4] tests/libqos: fix usage of bool in pci-spapr.c
Posted by David Gibson 6 years, 10 months ago
On Sat, Mar 23, 2019 at 05:26:36PM +0300, Jafar Abdi wrote:
> Clean up wrong usage of FALSE and TRUE in places that use "bool" from stdbool.h.
> 
> FALSE and TRUE (with capital letters) are the constants defined by glib for
> being used with the "gboolean" type of glib. But some parts of the code also use
> TRUE and FALSE for variables that are declared as "bool" (the type from <stdbool.h>).
> 
> Signed-off-by: Jafar Abdi <cafer.abdi@gmail.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  tests/libqos/pci-spapr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c
> index 6925925..58ba27a 100644
> --- a/tests/libqos/pci-spapr.c
> +++ b/tests/libqos/pci-spapr.c
> @@ -156,7 +156,7 @@ void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts,
>      assert(qts);
>  
>      /* tests cannot use spapr, needs to be fixed first */
> -    qpci->bus.has_buggy_msi = TRUE;
> +    qpci->bus.has_buggy_msi = true;
>  
>      qpci->alloc = alloc;
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson