lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251222175017.23d66430@endymion>
Date: Mon, 22 Dec 2025 17:50:17 +0100
From: Jean Delvare <jdelvare@...e.de>
To: "Mario Limonciello (AMD)" <superm1@...nel.org>
Cc: Yazen Ghannam <yazen.ghannam@....com>, x86@...nel.org, Thomas Gleixner
 <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
 <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, "H . Peter
 Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/7] firmware: dmi: Adjust dmi_decode() to use enums

On Tue, 16 Dec 2025 06:33:49 -0600, Mario Limonciello (AMD) wrote:
> 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.
> 
> Reviewed-by: Yazen Ghannam <yazen.ghannam@....com>
> Signed-off-by: Mario Limonciello (AMD) <superm1@...nel.org>
> ---
>  drivers/firmware/dmi_scan.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
> index 70d39adf50dca..80aded4c778bc 100644
> --- a/drivers/firmware/dmi_scan.c
> +++ b/drivers/firmware/dmi_scan.c
> @@ -484,14 +484,14 @@ static void __init dmi_memdev_walk(void)
>  static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
>  {
>  	switch (dm->type) {
> -	case 0:		/* BIOS Information */
> +	case DMI_ENTRY_BIOS:
>  		dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
>  		dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
>  		dmi_save_ident(dm, DMI_BIOS_DATE, 8);
>  		dmi_save_release(dm, DMI_BIOS_RELEASE, 21);
>  		dmi_save_release(dm, DMI_EC_FIRMWARE_RELEASE, 23);
>  		break;
> -	case 1:		/* System Information */
> +	case DMI_ENTRY_SYSTEM:
>  		dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
>  		dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
>  		dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
> @@ -500,33 +500,33 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
>  		dmi_save_ident(dm, DMI_PRODUCT_SKU, 25);
>  		dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
>  		break;
> -	case 2:		/* Base Board Information */
> +	case DMI_ENTRY_BASEBOARD:
>  		dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
>  		dmi_save_ident(dm, DMI_BOARD_NAME, 5);
>  		dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
>  		dmi_save_ident(dm, DMI_BOARD_SERIAL, 7);
>  		dmi_save_ident(dm, DMI_BOARD_ASSET_TAG, 8);
>  		break;
> -	case 3:		/* Chassis Information */
> +	case DMI_ENTRY_CHASSIS:
>  		dmi_save_ident(dm, DMI_CHASSIS_VENDOR, 4);
>  		dmi_save_type(dm, DMI_CHASSIS_TYPE, 5);
>  		dmi_save_ident(dm, DMI_CHASSIS_VERSION, 6);
>  		dmi_save_ident(dm, DMI_CHASSIS_SERIAL, 7);
>  		dmi_save_ident(dm, DMI_CHASSIS_ASSET_TAG, 8);
>  		break;
> -	case 9:		/* System Slots */
> +	case DMI_ENTRY_SYSTEM_SLOT:
>  		dmi_save_system_slot(dm);
>  		break;
> -	case 10:	/* Onboard Devices Information */
> +	case DMI_ENTRY_ONBOARD_DEVICE:
>  		dmi_save_devices(dm);
>  		break;
> -	case 11:	/* OEM Strings */
> +	case DMI_ENTRY_OEMSTRINGS:
>  		dmi_save_oem_strings_devices(dm);
>  		break;
> -	case 38:	/* IPMI Device Information */
> +	case DMI_ENTRY_IPMI_DEV:
>  		dmi_save_ipmi_device(dm);
>  		break;
> -	case 41:	/* Onboard Devices Extended Information */
> +	case DMI_ENTRY_ONBOARD_DEV_EXT:
>  		dmi_save_extended_devices(dm);
>  	}
>  }

I'm fine with this change.

Reviewed-by: Jean Delvare <jdelvare@...e.de>

-- 
Jean Delvare
SUSE L3 Support

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ