summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/smbios.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-07-01 18:29:59 +0200
committerArd Biesheuvel <ardb@kernel.org>2024-07-02 00:42:04 +0200
commit0dad9ee3c13930fe8122f2efc936fcd1c277a00d (patch)
treeef5363566fa196b9d33e68743cee7b706e5e53ab /drivers/firmware/efi/libstub/smbios.c
parent37aee82c213d352dccb850dc4228dda2e7e591b1 (diff)
efistub/smbios: Simplify SMBIOS enumeration API
Update the efi_get_smbios_string() macro to take a pointer to the entire record struct rather than the header. This removes the need to pass the type explicitly, as it can be inferred from the typed pointer. Also, drop 'type' from the prototype of __efi_get_smbios_string(), as it is never referenced. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/smbios.c')
-rw-r--r--drivers/firmware/efi/libstub/smbios.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/smbios.c b/drivers/firmware/efi/libstub/smbios.c
index c217de2cc8d5..520c9079717a 100644
--- a/drivers/firmware/efi/libstub/smbios.c
+++ b/drivers/firmware/efi/libstub/smbios.c
@@ -38,7 +38,7 @@ const struct efi_smbios_record *efi_get_smbios_record(u8 type)
}
const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record,
- u8 type, int offset)
+ const u8 *offset)
{
const u8 *strtable;
@@ -46,7 +46,7 @@ const u8 *__efi_get_smbios_string(const struct efi_smbios_record *record,
return NULL;
strtable = (u8 *)record + record->length;
- for (int i = 1; i < ((u8 *)record)[offset]; i++) {
+ for (int i = 1; i < *offset; i++) {
int len = strlen(strtable);
if (!len)