Re: [PATCH] efi: make efi_guid_to_str() take a const GUID pointer

From: Ard Biesheuvel

Date: Thu Jul 23 2026 - 02:49:32 EST




On Wed, 22 Jul 2026, at 23:22, Vincent Mailhol wrote:
> efi_guid_to_str() only formats the GUID through the byte array passed to
> the UUID printf formatter. It does not modify the GUID contents.
>
> Make the input pointer const so callers can stringify GUIDs from const
> data without a cast.
>
> Signed-off-by: Vincent Mailhol <mailhol@xxxxxxxxxx>
> ---
> include/linux/efi.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Applied, thanks.

> diff --git a/include/linux/efi.h b/include/linux/efi.h
> index ccbc35479684..cf5cc85e3fc8 100644
> --- a/include/linux/efi.h
> +++ b/include/linux/efi.h
> @@ -705,7 +705,7 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right)
> }
>
> static inline char *
> -efi_guid_to_str(efi_guid_t *guid, char *out)
> +efi_guid_to_str(const efi_guid_t *guid, char *out)
> {
> sprintf(out, "%pUl", guid->b);
> return out;
>
> ---
> base-commit: 1590cf0329716306e948a8fc29f1d3ee87d3989f
> change-id: 20260722-efi_guid_to_str-const-guid-a5b2accc7f0a
>
> Best regards,
> --
> Vincent Mailhol <mailhol@xxxxxxxxxx>