Changeset 933 for trunk/dmi.c


Ignore:
Timestamp:
03/13/10 18:28:29 (2 years ago)
Author:
uwe
Message:

Various coding style and cosmetic changes (trivial).

  • Fix coding-style, whitespace, and indentation in a few places.
  • Consistently use the same spelling ("Super I/O") everywhere.
  • Make some flashrom stdout output look a bit nicer.


Signed-off-by: Uwe Hermann <uwe@…>
Acked-by: Uwe Hermann <uwe@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dmi.c

    r916 r933  
    3232        DMI_BB_PRODUCT, 
    3333        DMI_BB_VERSION, 
    34         DMI_ID_INVALID /* This must always be the last entry */ 
     34        DMI_ID_INVALID, /* This must always be the last entry! */ 
    3535}; 
    3636 
    37 /* The short_id for baseboard starts with "m" as in mainboard to leave 
    38    "b" available for BIOS */ 
     37/* 
     38 * The short_id for baseboard starts with "m" as in mainboard to leave 
     39 * "b" available for BIOS. 
     40 */ 
    3941const char *dmidecode_names[DMI_ID_INVALID] = { 
    4042        "system-manufacturer", 
     
    4345        "baseboard-manufacturer", 
    4446        "baseboard-product-name", 
    45         "baseboard-version" 
     47        "baseboard-version", 
    4648}; 
    4749 
     
    5254char *dmistrings[DMI_ID_INVALID]; 
    5355 
    54 /* strings longer than 4096 in DMI are just insane */ 
     56/* Strings longer than 4096 in DMI are just insane. */ 
    5557#define DMI_MAX_ANSWER_LEN 4096 
    5658 
     
    6062        char *result; 
    6163        char answerbuf[DMI_MAX_ANSWER_LEN]; 
    62         char commandline[DMI_COMMAND_LEN_MAX+40]; 
     64        char commandline[DMI_COMMAND_LEN_MAX + 40]; 
     65 
    6366        snprintf(commandline, sizeof(commandline), 
    6467                 "%s -s %s", dmidecode_command, string_name); 
     
    8386        } 
    8487 
    85         /* chomp trailing newline */ 
     88        /* Chomp trailing newline. */ 
    8689        if (answerbuf[0] != 0 && 
    8790            answerbuf[strlen(answerbuf) - 1] == '\n') 
     
    100103        int i; 
    101104        char *chassis_type; 
     105 
    102106        has_dmi_support = 1; 
    103107        for (i = 0; i < DMI_ID_INVALID; i++) { 
     
    132136        int anchored = 0; 
    133137        int patternlen; 
     138 
    134139        printf_debug("matching %s against %s\n", value, pattern); 
    135         /* The empty string is part of all strings */ 
     140        /* The empty string is part of all strings! */ 
    136141        if (pattern[0] == 0) 
    137142                return 1; 
     
    146151                int valuelen = strlen(value); 
    147152                patternlen--; 
    148                 if(patternlen > valuelen) 
     153                if (patternlen > valuelen) 
    149154                        return 0; 
    150155 
    151156                /* full string match: require same length */ 
    152                 if(anchored && (valuelen != patternlen)) 
     157                if (anchored && (valuelen != patternlen)) 
    153158                        return 0; 
    154159 
     
    167172{ 
    168173        int i; 
     174 
    169175        if (!has_dmi_support) 
    170176                return 0; 
    171177 
    172         for (i = 0;i < DMI_ID_INVALID; i++) 
    173                 if(dmi_compare(dmistrings[i], pattern)) 
     178        for (i = 0; i < DMI_ID_INVALID; i++) 
     179                if (dmi_compare(dmistrings[i], pattern)) 
    174180                        return 1; 
    175181 
Note: See TracChangeset for help on using the changeset viewer.