diff mbox series

[02/20] scripts: Use bool in tunables initializer

Message ID fc480259907b00327596eec0cd161c5228946352.1666877952.git.szabolcs.nagy@arm.com
State New
Headers show
Series patches from the morello port | expand

Commit Message

Szabolcs Nagy Oct. 27, 2022, 3:32 p.m. UTC
The initializer for a tunable_t set the bool initialized flag to NULL.
This causes a build failure when pointer to bool conversion warns.
---
 scripts/gen-tunables.awk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Florian Weimer Oct. 27, 2022, 4:29 p.m. UTC | #1
* Szabolcs Nagy via Libc-alpha:

> The initializer for a tunable_t set the bool initialized flag to NULL.
> This causes a build failure when pointer to bool conversion warns.
> ---
>  scripts/gen-tunables.awk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/gen-tunables.awk b/scripts/gen-tunables.awk
> index fa63e86d1a..d6de100df0 100644
> --- a/scripts/gen-tunables.awk
> +++ b/scripts/gen-tunables.awk
> @@ -177,7 +177,7 @@ END {
>      n = indices[2];
>      m = indices[3];
>      printf ("  {TUNABLE_NAME_S(%s, %s, %s)", t, n, m)
> -    printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, NULL, TUNABLE_SECLEVEL_%s, %s},\n",
> +    printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, false, TUNABLE_SECLEVEL_%s, %s},\n",
>  	    types[t,n,m], minvals[t,n,m], maxvals[t,n,m],
>  	    default_val[t,n,m], security_level[t,n,m], env_alias[t,n,m]);
>    }

Looks okay.

elf/dl-tunable-types.h has:

| /* A tunable.  */
| struct _tunable
| {
|   const char name[TUNABLE_NAME_MAX];    /* Internal name of the tunable.  */
|   tunable_type_t type;                  /* Data type of the tunable.  */
|   tunable_val_t val;                    /* The value.  */
|   bool initialized;                     /* Flag to indicate that the tunable is
|                                            initialized.  */

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian
diff mbox series

Patch

diff --git a/scripts/gen-tunables.awk b/scripts/gen-tunables.awk
index fa63e86d1a..d6de100df0 100644
--- a/scripts/gen-tunables.awk
+++ b/scripts/gen-tunables.awk
@@ -177,7 +177,7 @@  END {
     n = indices[2];
     m = indices[3];
     printf ("  {TUNABLE_NAME_S(%s, %s, %s)", t, n, m)
-    printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, NULL, TUNABLE_SECLEVEL_%s, %s},\n",
+    printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, false, TUNABLE_SECLEVEL_%s, %s},\n",
 	    types[t,n,m], minvals[t,n,m], maxvals[t,n,m],
 	    default_val[t,n,m], security_level[t,n,m], env_alias[t,n,m]);
   }