1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +02:00

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>
This commit is contained in:
Uwe Hermann
2011-07-28 08:13:25 +00:00
parent 1a227954f2
commit 91f4afa110
20 changed files with 523 additions and 523 deletions

21
dmi.c
View File

@ -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! */