diff mbox series

efi_loader: pass GUID by address

Message ID 20260907-guidptr-v1-1-5cb72c450436@arm.com
State New
Delegated to: Heinrich Schuchardt
Headers show
Series efi_loader: pass GUID by address | expand

Commit Message

Vincent Stehlé Sept. 7, 2026, 12:16 p.m. UTC
Instead of passing a GUID by value to the hash_algo_supported()
function, prefer passing a pointer.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
---
 lib/efi_loader/efi_signature.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


---
base-commit: 509312dc5386ff4c5adabf53a573abca0aac4ce5
change-id: 20260907-guidptr-9865d0f0dd1b

Best regards,
--  
Vincent.

Comments

Heinrich Schuchardt Sept. 7, 2026, 2:15 p.m. UTC | #1
On 9/7/26 14:16, Vincent Stehlé wrote:
> Instead of passing a GUID by value to the hash_algo_supported()
> function, prefer passing a pointer.
> 
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Tom Rini <trini@konsulko.com>

Yes, GUIDs should be passed via pointers.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>   lib/efi_loader/efi_signature.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c
> index c2be5cb61b3..21a96426356 100644
> --- a/lib/efi_loader/efi_signature.c
> +++ b/lib/efi_loader/efi_signature.c
> @@ -166,7 +166,7 @@ bool efi_hash_regions(struct image_region *regs, int count,
>    *
>    * Return: true if supported false otherwise
>    */
> -static bool hash_algo_supported(const efi_guid_t guid)
> +static bool hash_algo_supported(const efi_guid_t *guid)
>   {
>   	int i;
>   	const efi_guid_t unsupported_hashes[] = {
> @@ -177,7 +177,7 @@ static bool hash_algo_supported(const efi_guid_t guid)
>   	};
>   
>   	for (i = 0; i < ARRAY_SIZE(unsupported_hashes); i++) {
> -		if (!guidcmp(&unsupported_hashes[i], &guid))
> +		if (!guidcmp(&unsupported_hashes[i], guid))
>   			return false;
>   	}
>   
> @@ -219,7 +219,7 @@ bool efi_signature_lookup_digest(struct efi_image_regions *regs,
>   		 * if the hash algorithm is unsupported and we get an entry in
>   		 * dbx reject the image
>   		 */
> -		if (dbx && !hash_algo_supported(siglist->sig_type)) {
> +		if (dbx && !hash_algo_supported(&siglist->sig_type)) {
>   			found = true;
>   			continue;
>   		};
> 
> ---
> base-commit: 509312dc5386ff4c5adabf53a573abca0aac4ce5
> change-id: 20260907-guidptr-9865d0f0dd1b
> 
> Best regards,
> --
> Vincent.
>
Ilias Apalodimas Sept. 8, 2026, 7:34 a.m. UTC | #2
On Mon, 7 Sept 2026 at 15:16, Vincent Stehlé <vincent.stehle@arm.com> wrote:

> Instead of passing a GUID by value to the hash_algo_supported()
> function, prefer passing a pointer.
>
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


>  lib/efi_loader/efi_signature.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/efi_loader/efi_signature.c
> b/lib/efi_loader/efi_signature.c
> index c2be5cb61b3..21a96426356 100644
> --- a/lib/efi_loader/efi_signature.c
> +++ b/lib/efi_loader/efi_signature.c
> @@ -166,7 +166,7 @@ bool efi_hash_regions(struct image_region *regs, int
> count,
>   *
>   * Return: true if supported false otherwise
>   */
> -static bool hash_algo_supported(const efi_guid_t guid)
> +static bool hash_algo_supported(const efi_guid_t *guid)
>  {
>         int i;
>         const efi_guid_t unsupported_hashes[] = {
> @@ -177,7 +177,7 @@ static bool hash_algo_supported(const efi_guid_t guid)
>         };
>
>         for (i = 0; i < ARRAY_SIZE(unsupported_hashes); i++) {
> -               if (!guidcmp(&unsupported_hashes[i], &guid))
> +               if (!guidcmp(&unsupported_hashes[i], guid))
>                         return false;
>         }
>
> @@ -219,7 +219,7 @@ bool efi_signature_lookup_digest(struct
> efi_image_regions *regs,
>                  * if the hash algorithm is unsupported and we get an
> entry in
>                  * dbx reject the image
>                  */
> -               if (dbx && !hash_algo_supported(siglist->sig_type)) {
> +               if (dbx && !hash_algo_supported(&siglist->sig_type)) {
>                         found = true;
>                         continue;
>                 };
>
> ---
> base-commit: 509312dc5386ff4c5adabf53a573abca0aac4ce5
> change-id: 20260907-guidptr-9865d0f0dd1b
>
> Best regards,
> --
> Vincent.
>
>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c
index c2be5cb61b3..21a96426356 100644
--- a/lib/efi_loader/efi_signature.c
+++ b/lib/efi_loader/efi_signature.c
@@ -166,7 +166,7 @@  bool efi_hash_regions(struct image_region *regs, int count,
  *
  * Return: true if supported false otherwise
  */
-static bool hash_algo_supported(const efi_guid_t guid)
+static bool hash_algo_supported(const efi_guid_t *guid)
 {
 	int i;
 	const efi_guid_t unsupported_hashes[] = {
@@ -177,7 +177,7 @@  static bool hash_algo_supported(const efi_guid_t guid)
 	};
 
 	for (i = 0; i < ARRAY_SIZE(unsupported_hashes); i++) {
-		if (!guidcmp(&unsupported_hashes[i], &guid))
+		if (!guidcmp(&unsupported_hashes[i], guid))
 			return false;
 	}
 
@@ -219,7 +219,7 @@  bool efi_signature_lookup_digest(struct efi_image_regions *regs,
 		 * if the hash algorithm is unsupported and we get an entry in
 		 * dbx reject the image
 		 */
-		if (dbx && !hash_algo_supported(siglist->sig_type)) {
+		if (dbx && !hash_algo_supported(&siglist->sig_type)) {
 			found = true;
 			continue;
 		};