diff mbox series

[V2,4/4] hw/tpm: fix usage of bool in tpm-tis.c

Message ID 1553351197-14581-5-git-send-email-cafer.abdi@gmail.com (mailing list archive)
State New, archived
Headers show
Series fix usage of bool | expand

Commit Message

Jafar Abdi March 23, 2019, 2:26 p.m. UTC
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>
---
 hw/tpm/tpm_tis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Huth March 24, 2019, 7:41 p.m. UTC | #1
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>
> ---
>  hw/tpm/tpm_tis.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
> index fd183e8..c1eb094 100644
> --- a/hw/tpm/tpm_tis.c
> +++ b/hw/tpm/tpm_tis.c
> @@ -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++) {
>                      if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
> -                        higher_seize = TRUE;
> +                        higher_seize = true;
>                          break;
>                      }
>                  }
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Stefan Berger March 26, 2019, 1:55 p.m. UTC | #2
On 3/24/19 3:41 PM, Thomas Huth wrote:
> 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>
>> ---
>>   hw/tpm/tpm_tis.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
>> index fd183e8..c1eb094 100644
>> --- a/hw/tpm/tpm_tis.c
>> +++ b/hw/tpm/tpm_tis.c
>> @@ -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++) {
>>                       if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
>> -                        higher_seize = TRUE;
>> +                        higher_seize = true;
>>                           break;
>>                       }
>>                   }
>>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
>
Daniel P. Berrangé May 7, 2020, 11:52 a.m. UTC | #3
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.

On Tue, Mar 26, 2019 at 09:55:24AM -0400, Stefan Berger wrote:
> On 3/24/19 3:41 PM, Thomas Huth wrote:
> > 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>
> > > ---
> > >   hw/tpm/tpm_tis.c | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
> > > index fd183e8..c1eb094 100644
> > > --- a/hw/tpm/tpm_tis.c
> > > +++ b/hw/tpm/tpm_tis.c
> > > @@ -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++) {
> > >                       if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
> > > -                        higher_seize = TRUE;
> > > +                        higher_seize = true;
> > >                           break;
> > >                       }
> > >                   }
> > > 
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
> > 
> 
> 

Regards,
Daniel
Stefan Berger May 8, 2020, 7:42 p.m. UTC | #4
On 5/7/20 7:52 AM, Daniel P. Berrangé wrote:
> 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.
diff mbox series

Patch

diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index fd183e8..c1eb094 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -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++) {
                     if ((s->loc[l].access & TPM_TIS_ACCESS_SEIZE)) {
-                        higher_seize = TRUE;
+                        higher_seize = true;
                         break;
                     }
                 }