]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: Use directly version_string variable
authorPali Rohár <pali@kernel.org>
Mon, 2 Aug 2021 13:18:30 +0000 (15:18 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 17 Sep 2021 16:10:44 +0000 (12:10 -0400)
Macro U_BOOT_VERSION_STRING is already stored in variable version_string.
So use directly this variable instead of storing U_BOOT_VERSION_STRING into
temporary variable.

Signed-off-by: Pali Rohár <pali@kernel.org>
[trini: This area was reworked since posted, what is here is now really
        inspired by the previous version, so drop Ilias' Acked-by]
Signed-off-by: Tom Rini <trini@konsulko.com>
lib/efi_loader/efi_tcg2.c

index cb48919223d386721cb6be9b7bb3160620efecd6..578b69e38f7cc3fbc8f39e3dc3ae341cdbdc9ed2 100644 (file)
@@ -1337,10 +1337,11 @@ out:
  */
 static efi_status_t efi_append_scrtm_version(struct udevice *dev)
 {
-       u8 ver[] = U_BOOT_VERSION_STRING;
        efi_status_t ret;
 
-       ret = tcg2_measure_event(dev, 0, EV_S_CRTM_VERSION, sizeof(ver), ver);
+       ret = tcg2_measure_event(dev, 0, EV_S_CRTM_VERSION,
+                                strlen(version_string) + 1,
+                                (u8 *)version_string);
 
        return ret;
 }