Skip to contentSkip to conversation

tests/libqos: fix usage of bool in pci-pc.c

PATCH Thomas Huth 4 participants 9 messages Mar 24, 2019 – May 8, 2020 5 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Thomas Huth

author Reviewed-by
#2 lore raw
Quoted 17 lines · Jafar Abdi

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

---
 tests/libqos/pci-pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/libqos/pci-pc.c +0 -0
index 4ab16fa..407d8af 100644

tests/libqos/pci-pc.c void qpci_init_pc(QPCIBusPC *qpci, QTestState *qts, QGuestAllocator *alloc) · line 131

Quoted 8 lines
tests/libqos/pci-pc.c +1 -1
@@ -125,7 +125,7 @@ void qpci_init_pc(QPCIBusPC *qpci, QTestState *qts, QGuestAllocator *alloc)
     assert(qts);
 
     /* tests can use pci-bus */
-    qpci->bus.has_buggy_msi = FALSE;
+    qpci->bus.has_buggy_msi = false;
 
     qpci->bus.pio_readb = qpci_pc_pio_readb;
     qpci->bus.pio_readw = qpci_pc_pio_readw;

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Reviewed-by
#4 lore raw

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

Quoted 17 lines · Jafar Abdi

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

---
 tests/libqos/pci-spapr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/libqos/pci-spapr.c +0 -0
index 6925925..58ba27a 100644

tests/libqos/pci-spapr.c void qpci_init_spapr(QPCIBusSPAPR *qpci, QTestState *qts, · line 161

Quoted 7 lines
tests/libqos/pci-spapr.c +1 -1
@@ -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;

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Reviewed-by
#6 lore raw

Re: [Qemu-trivial] [Qemu-devel] [PATCH V2 4/4] hw/tpm: fix usage of bool in tpm-tis.c

Quoted 26 lines · Jafar Abdi

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

---
 hw/tpm/tpm_tis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/tpm/tpm_tis.c +1 -1
index fd183e8..c1eb094 100644
@@ -611,7 +611,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
             while ((TPM_TIS_IS_VALID_LOCTY(s->active_locty) &&
                     locty > s->active_locty) ||
                     !TPM_TIS_IS_VALID_LOCTY(s->active_locty)) {
-                bool higher_seize = FALSE;
+                bool higher_seize = false;
 
                 /* already a pending SEIZE ? */
                 if ((s->loc[locty].access & TPM_TIS_ACCESS_SEIZE)) {

hw/tpm/tpm_tis.c static void tpm_tis_mmio_write(void *opaque, hwaddr addr, · line 627

Quoted 8 lines
hw/tpm/tpm_tis.c +1 -1
@@ -621,7 +621,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
                 /* check for ongoing seize by a higher locality */
                 for (l = locty + 1; l < TPM_TIS_NUM_LOCALITIES; l++) {
                     if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
-                        higher_seize = TRUE;
+                        higher_seize = true;
                         break;
                     }
                 }
Reviewed-by
#7 lore raw

Re: [Qemu-trivial] [Qemu-devel] [PATCH V2 4/4] hw/tpm: fix usage of bool in tpm-tis.c

Quoted 23 lines · Thomas Huth
Quoted 22 lines · Jafar Abdi

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

---
  hw/tpm/tpm_tis.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/tpm/tpm_tis.c +1 -1
index fd183e8..c1eb094 100644
@@ -611,7 +611,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
              while ((TPM_TIS_IS_VALID_LOCTY(s->active_locty) &&
                      locty > s->active_locty) ||
                      !TPM_TIS_IS_VALID_LOCTY(s->active_locty)) {
-                bool higher_seize = FALSE;
+                bool higher_seize = false;
 
Quoted 13 lines

hw/tpm/tpm_tis.c static void tpm_tis_mmio_write(void *opaque, hwaddr addr, · line 627

Quoted 12 lines
hw/tpm/tpm_tis.c +1 -1
                  /* already a pending SEIZE ? */
                  if ((s->loc[locty].access & TPM_TIS_ACCESS_SEIZE)) {
@@ -621,7 +621,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
                  /* check for ongoing seize by a higher locality */
                  for (l = locty + 1; l < TPM_TIS_NUM_LOCALITIES; l++) {
                      if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
-                        higher_seize = TRUE;
+                        higher_seize = true;
                          break;
                      }
                  }
Quoted 1 line
#8 lore raw

Re: [Qemu-devel] [PATCH V2 4/4] hw/tpm: fix usage of bool in tpm-tis.c

ping, again, for either qemu-trivial or TPM maintainers to take this patch.

The other three in this series are merged, but this TPM patch is still pending.

Quoted 36 lines · Stefan Berger
Quoted 27 lines · Thomas Huth
Quoted 26 lines · Jafar Abdi

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

---
  hw/tpm/tpm_tis.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/tpm/tpm_tis.c +1 -1
index fd183e8..c1eb094 100644
@@ -611,7 +611,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
              while ((TPM_TIS_IS_VALID_LOCTY(s->active_locty) &&
                      locty > s->active_locty) ||
                      !TPM_TIS_IS_VALID_LOCTY(s->active_locty)) {
-                bool higher_seize = FALSE;
+                bool higher_seize = false;
                  /* already a pending SEIZE ? */
                  if ((s->loc[locty].access & TPM_TIS_ACCESS_SEIZE)) {
@@ -621,7 +621,7 @@ static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
                  /* check for ongoing seize by a higher locality */
                  for (l = locty + 1; l < TPM_TIS_NUM_LOCALITIES; l++) {
Quoted 8 lines

hw/tpm/tpm_tis.c static void tpm_tis_mmio_write(void *opaque, hwaddr addr, · line 627

Quoted 7 lines
hw/tpm/tpm_tis.c +1 -1
                      if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
-                        higher_seize = TRUE;
+                        higher_seize = true;
                          break;
                      }
                  }
Quoted 4 lines
Quoted 1 line

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#9 lore raw

Re: [Qemu-devel] [PATCH V2 4/4] hw/tpm: fix usage of bool in tpm-tis.c

Quoted 5 lines · Daniel P. Berrangé

ping, again, for either qemu-trivial or TPM maintainers to take this patch.

The other three in this series are merged, but this TPM patch is still pending.

I'll send a PR with it tonight.

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Reviewed-by
#11 lore raw

Re: [Qemu-trivial] [Qemu-devel] [PATCH V2 1/4] authz: fix usage of bool in listfile.c

Quoted 17 lines · Jafar Abdi

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

---
 authz/listfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
authz/listfile.c +0 -0
index d457976..03eaf46 100644

authz/listfile.c qauthz_list_file_init(Object *obj) · line 243

Quoted 7 lines
authz/listfile.c +1 -1
@@ -238,7 +238,7 @@ qauthz_list_file_init(Object *obj)
 
     authz->file_watch = -1;
 #ifdef CONFIG_INOTIFY1
-    authz->refresh = TRUE;
+    authz->refresh = true;
 #endif
 }
#12 lore raw

Re: [Qemu-trivial] [PATCH V2 0/4] fix usage of bool

In reply to a message not in the archive
Quoted 5 lines · Jafar Abdi

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

CCing qemu-trivial

Quoted 15 lines

Jafar Abdi (4):
authz: fix usage of bool in listfile.c
tests/libqos: fix usage of bool in pci-pc.c
tests/libqos: fix usage of bool in pci-spapr.c
hw/tpm: fix usage of bool in tpm-tis.c

 authz/listfile.c         | 2 +-
 hw/tpm/tpm_tis.c         | 4 ++--
 tests/libqos/pci-pc.c    | 2 +-
 tests/libqos/pci-spapr.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#13 lore raw

Re: [Qemu-devel] [PATCH V2 0/4] fix usage of bool

Quoted 8 lines · Stefan Hajnoczi
Quoted 5 lines · Jafar Abdi

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

CCing qemu-trivial

Ping qemu-trivial - this was seems to have been missed, though patches 2 & 3 got merged via ppc tree meanwhile. The other two are still valid.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|