diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-07-02 17:49:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-07-02 18:15:27 +0200 |
commit | 1d22e23edb5746ebf057b1d14b4ff5fc0aa89707 (patch) | |
tree | 636dcb98666901fbab8fb463789f84a682a8f8c0 | |
parent | efi: split out efivars.[ch] from util.[ch] (diff) | |
download | systemd-1d22e23edb5746ebf057b1d14b4ff5fc0aa89707.tar.xz systemd-1d22e23edb5746ebf057b1d14b4ff5fc0aa89707.zip |
efivars: change return parameter of efivar_get_raw() to be void**
This is the "raw", untyped version after all, hence we should return a
void pointer, and let the client cast, if they know more.
Replaces: #30812
-rw-r--r-- | src/boot/efi/boot.c | 4 | ||||
-rw-r--r-- | src/boot/efi/efivars.c | 10 | ||||
-rw-r--r-- | src/boot/efi/efivars.h | 2 | ||||
-rw-r--r-- | src/boot/efi/random-seed.c | 2 | ||||
-rw-r--r-- | src/boot/efi/vmm.c | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index b643c25925..e191d85211 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -2015,7 +2015,7 @@ static EFI_STATUS boot_windows_bitlocker(void) { /* There can be gaps in Boot#### entries. Instead of iterating over the full * EFI var list or uint16_t namespace, just look for "Windows Boot Manager" in BootOrder. */ - err = efivar_get_raw(MAKE_GUID_PTR(EFI_GLOBAL_VARIABLE), u"BootOrder", (char **) &boot_order, &boot_order_size); + err = efivar_get_raw(MAKE_GUID_PTR(EFI_GLOBAL_VARIABLE), u"BootOrder", (void**) &boot_order, &boot_order_size); if (err != EFI_SUCCESS || boot_order_size % sizeof(uint16_t) != 0) return err; @@ -2024,7 +2024,7 @@ static EFI_STATUS boot_windows_bitlocker(void) { size_t buf_size; _cleanup_free_ char16_t *name = xasprintf("Boot%04x", boot_order[i]); - err = efivar_get_raw(MAKE_GUID_PTR(EFI_GLOBAL_VARIABLE), name, &buf, &buf_size); + err = efivar_get_raw(MAKE_GUID_PTR(EFI_GLOBAL_VARIABLE), name, (void**) &buf, &buf_size); if (err != EFI_SUCCESS) continue; diff --git a/src/boot/efi/efivars.c b/src/boot/efi/efivars.c index 5cf348c3cb..500cba36ba 100644 --- a/src/boot/efi/efivars.c +++ b/src/boot/efi/efivars.c @@ -85,7 +85,7 @@ EFI_STATUS efivar_get(const EFI_GUID *vendor, const char16_t *name, char16_t **r assert(vendor); assert(name); - err = efivar_get_raw(vendor, name, (char **) &buf, &size); + err = efivar_get_raw(vendor, name, (void**) &buf, &size); if (err != EFI_SUCCESS) return err; @@ -140,7 +140,7 @@ EFI_STATUS efivar_get_uint32_le(const EFI_GUID *vendor, const char16_t *name, ui assert(vendor); assert(name); - err = efivar_get_raw(vendor, name, &buf, &size); + err = efivar_get_raw(vendor, name, (void**) &buf, &size); if (err != EFI_SUCCESS) return err; @@ -162,7 +162,7 @@ EFI_STATUS efivar_get_uint64_le(const EFI_GUID *vendor, const char16_t *name, ui assert(vendor); assert(name); - err = efivar_get_raw(vendor, name, &buf, &size); + err = efivar_get_raw(vendor, name, (void**) &buf, &size); if (err != EFI_SUCCESS) return err; @@ -177,7 +177,7 @@ EFI_STATUS efivar_get_uint64_le(const EFI_GUID *vendor, const char16_t *name, ui return EFI_SUCCESS; } -EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, const char16_t *name, char **ret, size_t *ret_size) { +EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, const char16_t *name, void **ret, size_t *ret_size) { EFI_STATUS err; assert(vendor); @@ -209,7 +209,7 @@ EFI_STATUS efivar_get_boolean_u8(const EFI_GUID *vendor, const char16_t *name, b assert(vendor); assert(name); - err = efivar_get_raw(vendor, name, &b, &size); + err = efivar_get_raw(vendor, name, (void**) &b, &size); if (err != EFI_SUCCESS) return err; diff --git a/src/boot/efi/efivars.h b/src/boot/efi/efivars.h index 32cb5496b8..f07f6b5078 100644 --- a/src/boot/efi/efivars.h +++ b/src/boot/efi/efivars.h @@ -21,7 +21,7 @@ void efivar_set_time_usec(const EFI_GUID *vendor, const char16_t *name, uint64_t EFI_STATUS efivar_unset(const EFI_GUID *vendor, const char16_t *name, uint32_t flags); EFI_STATUS efivar_get(const EFI_GUID *vendor, const char16_t *name, char16_t **ret); -EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, const char16_t *name, char **ret, size_t *ret_size); +EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, const char16_t *name, void **ret, size_t *ret_size); EFI_STATUS efivar_get_uint_string(const EFI_GUID *vendor, const char16_t *name, size_t *ret); EFI_STATUS efivar_get_uint32_le(const EFI_GUID *vendor, const char16_t *name, uint32_t *ret); EFI_STATUS efivar_get_uint64_le(const EFI_GUID *vendor, const char16_t *name, uint64_t *ret); diff --git a/src/boot/efi/random-seed.c b/src/boot/efi/random-seed.c index e5bad11962..0ce16615c1 100644 --- a/src/boot/efi/random-seed.c +++ b/src/boot/efi/random-seed.c @@ -56,7 +56,7 @@ static EFI_STATUS acquire_system_token(void **ret, size_t *ret_size) { assert(ret); assert(ret_size); - err = efivar_get_raw(MAKE_GUID_PTR(LOADER), u"LoaderSystemToken", &data, &size); + err = efivar_get_raw(MAKE_GUID_PTR(LOADER), u"LoaderSystemToken", (void**) &data, &size); if (err != EFI_SUCCESS) { if (err != EFI_NOT_FOUND) log_error_status(err, "Failed to read LoaderSystemToken EFI variable: %m"); diff --git a/src/boot/efi/vmm.c b/src/boot/efi/vmm.c index e7fce0763e..0f268a1512 100644 --- a/src/boot/efi/vmm.c +++ b/src/boot/efi/vmm.c @@ -81,7 +81,7 @@ EFI_STATUS vmm_open(EFI_HANDLE *ret_vmm_dev, EFI_FILE **ret_vmm_dir) { _cleanup_free_ EFI_DEVICE_PATH *dp = NULL; _cleanup_free_ char16_t *order_str = xasprintf("VMMBootOrder%04zx", order); - dp_err = efivar_get_raw(MAKE_GUID_PTR(VMM_BOOT_ORDER), order_str, (char **) &dp, NULL); + dp_err = efivar_get_raw(MAKE_GUID_PTR(VMM_BOOT_ORDER), order_str, (void**) &dp, NULL); for (size_t i = 0; i < n_handles; i++) { _cleanup_(file_closep) EFI_FILE *root_dir = NULL, *efi_dir = NULL; |