]> git.dujemihanovic.xyz Git - u-boot.git/commit
efi_loader: fix efi_ecpt_register()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 10 Feb 2023 08:19:41 +0000 (09:19 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 10 Feb 2023 12:05:40 +0000 (13:05 +0100)
commit8d4c2c770c8935d4f1e06f8eb9d6416b8f63ea62
tree3221ba45e7074f1db10268c7c4f4bf5e65b7045a
parent60e3fedc64532c66f5bcd7c5c3d95e51ab2783e7
efi_loader: fix efi_ecpt_register()

num_entries should be unsigned to avoid warnings. As the target field is
u16 we should use this type.

    lib/efi_loader/efi_conformance.c: In function ‘efi_ecpt_register’:
    lib/efi_loader/efi_conformance.c:30:33: warning:
    conversion to ‘long unsigned int’ from ‘int’ may change
    the sign of the result [-Wsign-conversion]
       30 |         ecpt_size = num_entries * sizeof(efi_guid_t)
          |                                 ^
    lib/efi_loader/efi_conformance.c:46:36: warning:
    conversion from ‘int’ to ‘u16’ {aka ‘short unsigned int’}
    may change value [-Wconversion]
       46 |         ecpt->number_of_profiles = num_entries;
          |                                    ^~~~~~~~~~~

Fixes: 6b92c1735205 ("efi: Create ECPT table")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_conformance.c