From 91f4afa1108a35783e9d3d546fe8ea41dc87708f Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Thu, 28 Jul 2011 08:13:25 +0000 Subject: Random whitespace and coding-style fixes Also, indentation fixes, e.g. due to conversion to msg_*, use ARRAY_SIZE where possible, wrap overly long line, etc. Compile-tested. There should be no functional changes. Corresponding to flashrom svn r1397. Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann --- dmi.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'dmi.c') diff --git a/dmi.c b/dmi.c index 3b17b11..4f36245 100644 --- a/dmi.c +++ b/dmi.c @@ -107,13 +107,14 @@ static char *get_dmi_string(const char *string_name) } /* Kill lines starting with '#', as recent dmidecode versions - have the quirk to emit a "# SMBIOS implementations newer..." - message even on "-s" if the SMBIOS declares a - newer-than-supported version number, while it *should* only print - the requested string. */ + * have the quirk to emit a "# SMBIOS implementations newer..." + * message even on "-s" if the SMBIOS declares a + * newer-than-supported version number, while it *should* only print + * the requested string. + */ do { if (!fgets(answerbuf, DMI_MAX_ANSWER_LEN, dmidecode_pipe)) { - if(ferror(dmidecode_pipe)) { + if (ferror(dmidecode_pipe)) { msg_perr("DMI pipe read error\n"); pclose(dmidecode_pipe); return NULL; @@ -121,7 +122,7 @@ static char *get_dmi_string(const char *string_name) answerbuf[0] = 0; /* Hit EOF */ } } - } while(answerbuf[0] == '#'); + } while (answerbuf[0] == '#'); /* Toss all output above DMI_MAX_ANSWER_LEN away to prevent deadlock on pclose. */ @@ -129,13 +130,12 @@ static char *get_dmi_string(const char *string_name) getc(dmidecode_pipe); if (pclose(dmidecode_pipe) != 0) { msg_pinfo("dmidecode execution unsuccessful - continuing " - "without DMI info\n"); + "without DMI info\n"); return NULL; } /* Chomp trailing newline. */ - if (answerbuf[0] != 0 && - answerbuf[strlen(answerbuf) - 1] == '\n') + if (answerbuf[0] != 0 && answerbuf[strlen(answerbuf) - 1] == '\n') answerbuf[strlen(answerbuf) - 1] = 0; msg_pdbg("DMI string %s: \"%s\"\n", string_name, answerbuf); @@ -196,8 +196,7 @@ void dmi_init(void) */ static int dmi_compare(const char *value, const char *pattern) { - int anchored = 0; - int patternlen; + int anchored = 0, patternlen; msg_pspew("matching %s against %s\n", value, pattern); /* The empty string is part of all strings! */ -- cgit v1.1