summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2010-02-24 22:43:44 +0000
committerMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2010-02-24 22:43:44 +0000
commitf6498d7a44921cf37a252a3953e7b828437bf6a7 (patch)
tree282f28648513374d8ac9f7d3438e21c8372d8090
parent844863933d12ec9b9b51de440313f014a81dafbf (diff)
downloadast2050-flashrom-f6498d7a44921cf37a252a3953e7b828437bf6a7.zip
ast2050-flashrom-f6498d7a44921cf37a252a3953e7b828437bf6a7.tar.gz
Remove unused short IDs
This also replaces the meaningless numbers in the DMI debug printout with the parameter names. Corresponding to flashrom svn r912. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
-rw-r--r--dmi.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/dmi.c b/dmi.c
index f97aff7..c80a568 100644
--- a/dmi.c
+++ b/dmi.c
@@ -36,16 +36,13 @@ enum dmi_strings {
/* The short_id for baseboard starts with "m" as in mainboard to leave
"b" available for BIOS */
-struct {
- const char *dmidecode_name;
- char short_id[3];
-} dmi_properties[DMI_ID_INVALID] = {
- {"system-manufacturer", "sm"},
- {"system-product-name", "sp"},
- {"system-version", "sv"},
- {"baseboard-manufacturer", "mm"},
- {"baseboard-product-name", "mp"},
- {"baseboard-version", "mv"}
+const char *dmidecode_names[DMI_ID_INVALID] = {
+ "system-manufacturer",
+ "system-product-name",
+ "system-version",
+ "baseboard-manufacturer",
+ "baseboard-product-name",
+ "baseboard-version"
};
#define DMI_COMMAND_LEN_MAX 260
@@ -71,8 +68,7 @@ void dmi_init(void)
{
char commandline[DMI_COMMAND_LEN_MAX+40];
snprintf(commandline, sizeof(commandline),
- "%s -s %s", dmidecode_command,
- dmi_properties[i].dmidecode_name);
+ "%s -s %s", dmidecode_command, dmidecode_names[i]);
dmidecode_pipe = popen(commandline, "r");
if (!dmidecode_pipe)
{
@@ -100,7 +96,8 @@ void dmi_init(void)
if (answerbuf[0] != 0 &&
answerbuf[strlen(answerbuf) - 1] == '\n')
answerbuf[strlen(answerbuf) - 1] = 0;
- printf_debug("DMI string %d: \"%s\"\n", i, answerbuf);
+ printf_debug("DMI string %s: \"%s\"\n", dmidecode_names[i],
+ answerbuf);
dmistrings[i] = strdup(answerbuf);
}
has_dmi_support = 1;
OpenPOWER on IntegriCloud