Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: dmi: Adjust dmi_decode() to use enums

dmi_decode() has hardcoded values with comments for each DMI entry type. The
same information is already in dmi.h though, so drop the comments and use the
definitions instead.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Link: https://patch.msgid.link/20260307141024.819807-3-superm1@kernel.org

authored by

Mario Limonciello (AMD) and committed by
Borislav Petkov (AMD)
28189e95 c064abc6

+9 -9
+9 -9
drivers/firmware/dmi_scan.c
··· 484 484 static void __init dmi_decode(const struct dmi_header *dm, void *dummy) 485 485 { 486 486 switch (dm->type) { 487 - case 0: /* BIOS Information */ 487 + case DMI_ENTRY_BIOS: 488 488 dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); 489 489 dmi_save_ident(dm, DMI_BIOS_VERSION, 5); 490 490 dmi_save_ident(dm, DMI_BIOS_DATE, 8); 491 491 dmi_save_release(dm, DMI_BIOS_RELEASE, 21); 492 492 dmi_save_release(dm, DMI_EC_FIRMWARE_RELEASE, 23); 493 493 break; 494 - case 1: /* System Information */ 494 + case DMI_ENTRY_SYSTEM: 495 495 dmi_save_ident(dm, DMI_SYS_VENDOR, 4); 496 496 dmi_save_ident(dm, DMI_PRODUCT_NAME, 5); 497 497 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6); ··· 500 500 dmi_save_ident(dm, DMI_PRODUCT_SKU, 25); 501 501 dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26); 502 502 break; 503 - case 2: /* Base Board Information */ 503 + case DMI_ENTRY_BASEBOARD: 504 504 dmi_save_ident(dm, DMI_BOARD_VENDOR, 4); 505 505 dmi_save_ident(dm, DMI_BOARD_NAME, 5); 506 506 dmi_save_ident(dm, DMI_BOARD_VERSION, 6); 507 507 dmi_save_ident(dm, DMI_BOARD_SERIAL, 7); 508 508 dmi_save_ident(dm, DMI_BOARD_ASSET_TAG, 8); 509 509 break; 510 - case 3: /* Chassis Information */ 510 + case DMI_ENTRY_CHASSIS: 511 511 dmi_save_ident(dm, DMI_CHASSIS_VENDOR, 4); 512 512 dmi_save_type(dm, DMI_CHASSIS_TYPE, 5); 513 513 dmi_save_ident(dm, DMI_CHASSIS_VERSION, 6); 514 514 dmi_save_ident(dm, DMI_CHASSIS_SERIAL, 7); 515 515 dmi_save_ident(dm, DMI_CHASSIS_ASSET_TAG, 8); 516 516 break; 517 - case 9: /* System Slots */ 517 + case DMI_ENTRY_SYSTEM_SLOT: 518 518 dmi_save_system_slot(dm); 519 519 break; 520 - case 10: /* Onboard Devices Information */ 520 + case DMI_ENTRY_ONBOARD_DEVICE: 521 521 dmi_save_devices(dm); 522 522 break; 523 - case 11: /* OEM Strings */ 523 + case DMI_ENTRY_OEMSTRINGS: 524 524 dmi_save_oem_strings_devices(dm); 525 525 break; 526 - case 38: /* IPMI Device Information */ 526 + case DMI_ENTRY_IPMI_DEV: 527 527 dmi_save_ipmi_device(dm); 528 528 break; 529 - case 41: /* Onboard Devices Extended Information */ 529 + case DMI_ENTRY_ONBOARD_DEV_EXT: 530 530 dmi_save_extended_devices(dm); 531 531 } 532 532 }