* [PATCH] keys/trusted/tpm2: rename "bool" to "boolean"
@ 2026-11-09 5:39 Dan Carpenter
2026-11-09 14:54 ` Jarkko Sakkinen
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2026-11-09 5:39 UTC (permalink / raw)
To: James Bottomley
Cc: Jarkko Sakkinen, Mimi Zohar, David Howells, Paul Moore,
James Morris, Serge E. Hallyn, linux-integrity, keyrings,
linux-security-module, linux-kernel, kernel-janitors
In C23, "bool" is a keyword so rename this array from bool[] to boolean[]
to avoid a conflict.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
security/keys/trusted-keys/trusted_tpm2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c
index 30188a0ec676..2d6cc53539c8 100644
--- a/security/keys/trusted-keys/trusted_tpm2.c
+++ b/security/keys/trusted-keys/trusted_tpm2.c
@@ -59,13 +59,13 @@ static int tpm2_key_encode(struct trusted_key_payload *payload,
asn1_oid_len(tpm2key_oid));
if (private->blobauth_len == 0) {
- unsigned char bool[3], *w = bool;
+ unsigned char boolean[3], *w = boolean;
/* tag 0 is emptyAuth */
- w = asn1_encode_boolean(w, w + sizeof(bool), true);
+ w = asn1_encode_boolean(w, w + sizeof(boolean), true);
if (WARN(IS_ERR(w), "BUG: Boolean failed to encode"))
return PTR_ERR(w);
- work = asn1_encode_tag(work, end_work, 0, bool, w - bool);
+ work = asn1_encode_tag(work, end_work, 0, boolean, w - boolean);
}
/*
--
2.53.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] keys/trusted/tpm2: rename "bool" to "boolean"
2026-11-09 5:39 [PATCH] keys/trusted/tpm2: rename "bool" to "boolean" Dan Carpenter
@ 2026-11-09 14:54 ` Jarkko Sakkinen
2026-11-09 19:48 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Sakkinen @ 2026-11-09 14:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: James Bottomley, Mimi Zohar, David Howells, Paul Moore,
James Morris, Serge E. Hallyn, linux-integrity, keyrings,
linux-security-module, linux-kernel, kernel-janitors
On Mon, Nov 09, 2026 at 08:39:24AM +0300, Dan Carpenter wrote:
> In C23, "bool" is a keyword so rename this array from bool[] to boolean[]
> to avoid a conflict.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> security/keys/trusted-keys/trusted_tpm2.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c
> index 30188a0ec676..2d6cc53539c8 100644
> --- a/security/keys/trusted-keys/trusted_tpm2.c
> +++ b/security/keys/trusted-keys/trusted_tpm2.c
> @@ -59,13 +59,13 @@ static int tpm2_key_encode(struct trusted_key_payload *payload,
> asn1_oid_len(tpm2key_oid));
>
> if (private->blobauth_len == 0) {
> - unsigned char bool[3], *w = bool;
> + unsigned char boolean[3], *w = boolean;
> /* tag 0 is emptyAuth */
> - w = asn1_encode_boolean(w, w + sizeof(bool), true);
> + w = asn1_encode_boolean(w, w + sizeof(boolean), true);
> if (WARN(IS_ERR(w), "BUG: Boolean failed to encode"))
> return PTR_ERR(w);
>
> - work = asn1_encode_tag(work, end_work, 0, bool, w - bool);
> + work = asn1_encode_tag(work, end_work, 0, boolean, w - boolean);
> }
>
> /*
> --
> 2.53.0
>
Are we migrating to C23? I've not followed this too closely.
Br, Jarkko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] keys/trusted/tpm2: rename "bool" to "boolean"
2026-11-09 14:54 ` Jarkko Sakkinen
@ 2026-11-09 19:48 ` Dan Carpenter
2026-11-09 20:08 ` Jarkko Sakkinen
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2026-11-09 19:48 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Dan Carpenter, James Bottomley, Mimi Zohar, David Howells,
Paul Moore, James Morris, Serge E. Hallyn, linux-integrity,
keyrings, linux-security-module, linux-kernel, kernel-janitors
On Mon, Nov 09, 2026 at 04:54:13PM +0200, Jarkko Sakkinen wrote:
>
> Are we migrating to C23? I've not followed this too closely.
Google AI says that we will adopt C23 next year or the year after.
I argued that it would be would be after 2030 but AI said, "No, there
is too much juicy stuff in C23 for kernel developers to wait so long."
I don't have a pressing need for this patch to be merged. I was
just playing with some compiler related tools noticed this. It's
the only place in the kernel which uses "bool" as a variable name.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] keys/trusted/tpm2: rename "bool" to "boolean"
2026-11-09 19:48 ` Dan Carpenter
@ 2026-11-09 20:08 ` Jarkko Sakkinen
2026-11-09 20:13 ` Jarkko Sakkinen
0 siblings, 1 reply; 5+ messages in thread
From: Jarkko Sakkinen @ 2026-11-09 20:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: Dan Carpenter, James Bottomley, Mimi Zohar, David Howells,
Paul Moore, James Morris, Serge E. Hallyn, linux-integrity,
keyrings, linux-security-module, linux-kernel, kernel-janitors
On Mon, Nov 09, 2026 at 10:48:58PM +0300, Dan Carpenter wrote:
> On Mon, Nov 09, 2026 at 04:54:13PM +0200, Jarkko Sakkinen wrote:
> >
> > Are we migrating to C23? I've not followed this too closely.
>
> Google AI says that we will adopt C23 next year or the year after.
> I argued that it would be would be after 2030 but AI said, "No, there
> is too much juicy stuff in C23 for kernel developers to wait so long."
>
> I don't have a pressing need for this patch to be merged. I was
> just playing with some compiler related tools noticed this. It's
> the only place in the kernel which uses "bool" as a variable name.
I do think that bool is not great choice for a variable name; in fact
it is quite horrible choice. But since there is no other force than being
horrible name, I think I'll pass...
>
> regards,
> dan carpenter
>
Br, Jarkko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] keys/trusted/tpm2: rename "bool" to "boolean"
2026-11-09 20:08 ` Jarkko Sakkinen
@ 2026-11-09 20:13 ` Jarkko Sakkinen
0 siblings, 0 replies; 5+ messages in thread
From: Jarkko Sakkinen @ 2026-11-09 20:13 UTC (permalink / raw)
To: Dan Carpenter
Cc: Dan Carpenter, James Bottomley, Mimi Zohar, David Howells,
Paul Moore, James Morris, Serge E. Hallyn, linux-integrity,
keyrings, linux-security-module, linux-kernel, kernel-janitors
On Mon, Nov 09, 2026 at 10:08:58PM +0200, Jarkko Sakkinen wrote:
> On Mon, Nov 09, 2026 at 10:48:58PM +0300, Dan Carpenter wrote:
> > On Mon, Nov 09, 2026 at 04:54:13PM +0200, Jarkko Sakkinen wrote:
> > >
> > > Are we migrating to C23? I've not followed this too closely.
> >
> > Google AI says that we will adopt C23 next year or the year after.
> > I argued that it would be would be after 2030 but AI said, "No, there
> > is too much juicy stuff in C23 for kernel developers to wait so long."
> >
> > I don't have a pressing need for this patch to be merged. I was
> > just playing with some compiler related tools noticed this. It's
> > the only place in the kernel which uses "bool" as a variable name.
>
> I do think that bool is not great choice for a variable name; in fact
> it is quite horrible choice. But since there is no other force than being
> horrible name, I think I'll pass...
In order to put this in a proper context, I meant that bad variable
names are common. I'm not blaming patch author in particular,
especially since it is a local variable. It is just something that
happens all the time; occasionally.
We could merge a billion patches like this with no other effect than
causing extra merge conflicts in backports. So the net-effect is
more harm than good.
Br, Jarkko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-09 20:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 5:39 [PATCH] keys/trusted/tpm2: rename "bool" to "boolean" Dan Carpenter
2026-11-09 14:54 ` Jarkko Sakkinen
2026-11-09 19:48 ` Dan Carpenter
2026-11-09 20:08 ` Jarkko Sakkinen
2026-11-09 20:13 ` Jarkko Sakkinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®