From 63bc1e1ee56769da8fe404aacc1119acf542aeb2 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 29 May 2009 15:10:21 -0700 Subject: [PATCH] Run Nindent on com32/gpllib/vpd/vpd.c Automatically reformat com32/gpllib/vpd/vpd.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin --- com32/gpllib/vpd/vpd.c | 112 ++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/com32/gpllib/vpd/vpd.c b/com32/gpllib/vpd/vpd.c index ff04b8b..fd468e4 100644 --- a/com32/gpllib/vpd/vpd.c +++ b/com32/gpllib/vpd/vpd.c @@ -32,72 +32,72 @@ int vpd_checksum(char *buf, int len) { - uint8_t sum=0; - int a; + uint8_t sum = 0; + int a; - for(a=0; abase_address,0,sizeof (vpd->base_address)); - memset(&vpd->bios_build_id,0,sizeof (vpd->bios_build_id)); - memset(&vpd->box_serial_number,0,sizeof (vpd->box_serial_number)); - memset(&vpd->motherboard_serial_number,0,sizeof (vpd->motherboard_serial_number)); - memset(&vpd->machine_type_model,0,sizeof (vpd->machine_type_model)); - memset(&vpd->bios_release_date,0,sizeof (vpd->bios_release_date)); - memset(&vpd->default_flash_filename,0,sizeof (vpd->default_flash_filename)); - memset(&vpd->bios_version,0,sizeof (vpd->bios_version)); + /* Cleaning structures */ + memset(&vpd->base_address, 0, sizeof(vpd->base_address)); + memset(&vpd->bios_build_id, 0, sizeof(vpd->bios_build_id)); + memset(&vpd->box_serial_number, 0, sizeof(vpd->box_serial_number)); + memset(&vpd->motherboard_serial_number, 0, + sizeof(vpd->motherboard_serial_number)); + memset(&vpd->machine_type_model, 0, sizeof(vpd->machine_type_model)); + memset(&vpd->bios_release_date, 0, sizeof(vpd->bios_release_date)); + memset(&vpd->default_flash_filename, 0, + sizeof(vpd->default_flash_filename)); + memset(&vpd->bios_version, 0, sizeof(vpd->bios_version)); - /* Until we found elements in the vpdtable, we consider them as not filled */ - vpd->filled=false; + /* Until we found elements in the vpdtable, we consider them as not filled */ + vpd->filled = false; - p=(char *)0xF0000; /* The start address to look at the dmi table */ - for (q = p; q < p + 0x10000; q +=4) { - memcpy(buf, q, 5); - if(memcmp(buf, "\252\125VPD", 5)==0) { - snprintf(&vpd->base_address,5,"%X",q); - if (q[5] < 0x30) - return -ENOVPDTABLE; + p = (char *)0xF0000; /* The start address to look at the dmi table */ + for (q = p; q < p + 0x10000; q += 4) { + memcpy(buf, q, 5); + if (memcmp(buf, "\252\125VPD", 5) == 0) { + snprintf(&vpd->base_address, 5, "%X", q); + if (q[5] < 0x30) + return -ENOVPDTABLE; - vpd->filled=true; - /* XSeries have longer records, exact length seems to vary. */ - if (!(q[5] >= 0x45 && vpd_checksum(q, q[5])) - /* Some Netvista seem to work with this. */ - && !(vpd_checksum(q, 0x30)) - /* The Thinkpad/Thinkcentre checksum does *not* include the first 13 bytes. */ - && !(vpd_checksum(q + 0x0D, 0x30 - 0x0D))) - { - /* A few systems have a bad checksum (xSeries 325, 330, 335 - and 345 with early BIOS) but the record is otherwise - valid. */ - printf("VPD: Bad checksum!\n"); - } + vpd->filled = true; + /* XSeries have longer records, exact length seems to vary. */ + if (!(q[5] >= 0x45 && vpd_checksum(q, q[5])) + /* Some Netvista seem to work with this. */ + && !(vpd_checksum(q, 0x30)) + /* The Thinkpad/Thinkcentre checksum does *not* include the first 13 bytes. */ + && !(vpd_checksum(q + 0x0D, 0x30 - 0x0D))) { + /* A few systems have a bad checksum (xSeries 325, 330, 335 + and 345 with early BIOS) but the record is otherwise + valid. */ + printf("VPD: Bad checksum!\n"); + } - strncpy(vpd->bios_build_id,q+0x0D, 9); - strncpy(vpd->box_serial_number,q+0x16, 7); - strncpy(vpd->motherboard_serial_number,q+0x1D, 11); - strncpy(vpd->machine_type_model,q+0x28, 7); + strncpy(vpd->bios_build_id, q + 0x0D, 9); + strncpy(vpd->box_serial_number, q + 0x16, 7); + strncpy(vpd->motherboard_serial_number, q + 0x1D, 11); + strncpy(vpd->machine_type_model, q + 0x28, 7); - if (q[5] < 0x44) - return VPD_TABLE_PRESENT; + if (q[5] < 0x44) + return VPD_TABLE_PRESENT; - strncpy(vpd->bios_release_date,q+0x30, 8); - strncpy(vpd->default_flash_filename,q+0x38, 12); + strncpy(vpd->bios_release_date, q + 0x30, 8); + strncpy(vpd->default_flash_filename, q + 0x38, 12); - if (q[5] >= 0x46 && q[0x44] != 0x00) { - strncpy(vpd->bios_version,q+0x44, 255); - } + if (q[5] >= 0x46 && q[0x44] != 0x00) { + strncpy(vpd->bios_version, q + 0x44, 255); + } - return VPD_TABLE_PRESENT; - } - } - return -ENOVPDTABLE; + return VPD_TABLE_PRESENT; + } + } + return -ENOVPDTABLE; } - - -- 2.7.4