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

"Ard Biesheuvel" <[email protected]> Thu, 23 Jul 2026 08:44:48 +0200
Newsgroups org.kernel.vger.linux-efi,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

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 <[email protected]>
> ---
>  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 <[email protected]>