summaryrefslogtreecommitdiff
path: root/dmioem.c
diff options
context:
space:
mode:
authorkhali <khali>2008-10-26 12:50:21 +0000
committerkhali <khali>2008-10-26 12:50:21 +0000
commitae6a924ba494a37307d9e3a7fa6ee996e0a693ae (patch)
tree980acb3a19879f4489b4d76d1145f4aead0d8dd5 /dmioem.c
parent90fabb142d5d1eb3ff548997161f226f5ca6bb03 (diff)
downloaddmidecode-ae6a924ba494a37307d9e3a7fa6ee996e0a693ae.tar.gz
Mass coding-style change: add spaces around operators.
Diffstat (limited to 'dmioem.c')
-rw-r--r--dmioem.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/dmioem.c b/dmioem.c
index 22690c0..cf684df 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -32,7 +32,7 @@
enum DMI_VENDORS { VENDOR_UNKNOWN, VENDOR_HP };
-static enum DMI_VENDORS dmi_vendor=VENDOR_UNKNOWN;
+static enum DMI_VENDORS dmi_vendor = VENDOR_UNKNOWN;
/*
* Remember the system vendor for later use. We only actually store the
@@ -41,8 +41,8 @@ static enum DMI_VENDORS dmi_vendor=VENDOR_UNKNOWN;
*/
void dmi_set_vendor(const char *s)
{
- if(strcmp(s, "HP")==0)
- dmi_vendor=VENDOR_HP;
+ if (strcmp(s, "HP") == 0)
+ dmi_vendor = VENDOR_HP;
}
/*
@@ -53,17 +53,17 @@ void dmi_set_vendor(const char *s)
static int dmi_decode_hp(struct dmi_header *h)
{
- u8 *data=h->data;
+ u8 *data = h->data;
int nic, ptr;
- switch(h->type)
+ switch (h->type)
{
case 204:
/*
* Vendor Specific: HP ProLiant System/Rack Locator
*/
printf("HP ProLiant System/Rack Locator\n");
- if(h->length<0x0B) break;
+ if (h->length < 0x0B) break;
printf("\tRack Name: %s\n", dmi_string(h, data[0x04]));
printf("\tEnclosure Name: %s\n", dmi_string(h, data[0x05]));
printf("\tEnclosure Model: %s\n", dmi_string(h, data[0x06]));
@@ -81,28 +81,29 @@ static int dmi_decode_hp(struct dmi_header *h)
* This prints the BIOS NIC number,
* PCI bus/device/function, and MAC address
*/
- printf(h->type==221?
- "HP BIOS iSCSI NIC PCI and MAC Information\n":
+ printf(h->type == 221 ?
+ "HP BIOS iSCSI NIC PCI and MAC Information\n" :
"HP BIOS NIC PCI and MAC Information\n");
- nic=1;
- ptr=4;
- while(h->length>=ptr+8)
+ nic = 1;
+ ptr = 4;
+ while (h->length >= ptr + 8)
{
- if(data[ptr]==0x00 && data[ptr+1]==0x00)
+ if (data[ptr] == 0x00 && data[ptr + 1] == 0x00)
printf("\tNIC %d: Disabled\n", nic);
- else if(data[ptr]==0xFF && data[ptr+1]==0xFF)
+ else if (data[ptr] == 0xFF && data[ptr + 1] == 0xFF)
printf("\tNIC %d: Not Installed\n", nic);
else
{
printf("\tNIC %d: PCI device %02x:%02x.%x, "
"MAC address %02X:%02X:%02X:%02X:%02X:%02X\n",
- nic, data[ptr+1], data[ptr]>>3, data[ptr]&7,
- data[ptr+2], data[ptr+3],
- data[ptr+4], data[ptr+5],
- data[ptr+6], data[ptr+7]);
+ nic, data[ptr + 1],
+ data[ptr] >> 3, data[ptr] & 7,
+ data[ptr + 2], data[ptr + 3],
+ data[ptr + 4], data[ptr + 5],
+ data[ptr + 6], data[ptr + 7]);
}
nic++;
- ptr+=8;
+ ptr += 8;
}
break;
@@ -118,7 +119,7 @@ static int dmi_decode_hp(struct dmi_header *h)
*/
int dmi_decode_oem(struct dmi_header *h)
{
- switch(dmi_vendor)
+ switch (dmi_vendor)
{
case VENDOR_HP:
return dmi_decode_hp(h);