diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2011-07-28 08:13:25 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2011-07-28 08:13:25 +0000 |
commit | 91f4afa1108a35783e9d3d546fe8ea41dc87708f (patch) | |
tree | a94991ce77532b8767d5d3c6ac0e9ab58f4b9a2c /dmi.c | |
parent | 1a227954f2c7d0a25d42bcea2ea0b901ceb0f464 (diff) | |
download | ast2050-flashrom-91f4afa1108a35783e9d3d546fe8ea41dc87708f.zip ast2050-flashrom-91f4afa1108a35783e9d3d546fe8ea41dc87708f.tar.gz |
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 <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'dmi.c')
-rw-r--r-- | dmi.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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! */ |