All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: "Mario Limonciello (AMD)" <superm1@kernel.org>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>,
	x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/7] firmware: dmi: Adjust dmi_decode() to use enums
Date: Mon, 22 Dec 2025 17:50:17 +0100	[thread overview]
Message-ID: <20251222175017.23d66430@endymion> (raw)
In-Reply-To: <20251216123354.9219-3-superm1@kernel.org>

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@amd.com>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.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@suse.de>

-- 
Jean Delvare
SUSE L3 Support

  reply	other threads:[~2025-12-22 16:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 12:33 [PATCH v2 0/7] Parse SMBIOS additional entries Mario Limonciello (AMD)
2025-12-16 12:33 ` [PATCH v2 1/7] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
2025-12-22 16:48   ` Jean Delvare
2025-12-16 12:33 ` [PATCH v2 2/7] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
2025-12-22 16:50   ` Jean Delvare [this message]
2025-12-16 12:33 ` [PATCH v2 3/7] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
2025-12-17 21:03   ` Yazen Ghannam
2025-12-17 21:09     ` Mario Limonciello
2025-12-17 21:21       ` Yazen Ghannam
2025-12-17 21:23         ` Mario Limonciello
2025-12-18 15:43           ` Yazen Ghannam
2025-12-22 16:59         ` Jean Delvare
2025-12-22 17:51   ` Jean Delvare
2025-12-22 21:31   ` Jean DELVARE
2025-12-16 12:33 ` [PATCH v2 4/7] firmware: dmi: Add debugfs for additional information entries Mario Limonciello (AMD)
2025-12-16 12:33 ` [PATCH v2 5/7] firmware: dmi: Add missing DMI entry types Mario Limonciello (AMD)
2025-12-22 17:01   ` Jean Delvare
2025-12-16 12:33 ` [PATCH v2 6/7] x86/CPU/AMD: Prefix messages with x86/amd Mario Limonciello (AMD)
2025-12-17 21:10   ` Yazen Ghannam
2025-12-16 12:33 ` [PATCH v2 7/7] x86/CPU/AMD: Output the AGESA version to the logs Mario Limonciello (AMD)
2025-12-17 21:18   ` Yazen Ghannam
2025-12-17 21:21     ` Mario Limonciello
2025-12-18 15:47       ` Yazen Ghannam
2025-12-22 18:18   ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251222175017.23d66430@endymion \
    --to=jdelvare@suse.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=superm1@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.