Author: uwe Date: 2007-10-10 19:42:20 +0200 (Wed, 10 Oct 2007) New Revision: 2847
Modified: trunk/util/flashrom/chipset_enable.c trunk/util/flashrom/layout.c trunk/util/flashrom/lbtable.c trunk/util/flashrom/udelay.c Log: Revert my last cleanup patch.
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/util/flashrom/chipset_enable.c =================================================================== --- trunk/util/flashrom/chipset_enable.c 2007-10-10 16:31:30 UTC (rev 2846) +++ trunk/util/flashrom/chipset_enable.c 2007-10-10 17:42:20 UTC (rev 2847) @@ -506,7 +506,7 @@ if (ret) printf("Failed!\n"); else - printf("OK\n"); + printf("OK.\n"); }
return ret;
Modified: trunk/util/flashrom/layout.c =================================================================== --- trunk/util/flashrom/layout.c 2007-10-10 16:31:30 UTC (rev 2846) +++ trunk/util/flashrom/layout.c 2007-10-10 17:42:20 UTC (rev 2847) @@ -40,21 +40,21 @@ }
if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) { - printf("Flash image seems to be a legacy BIOS - disabling checks\n"); + printf("Flash image seems to be a legacy BIOS. Disabling checks.\n"); mainboard_vendor = def_name; mainboard_part = def_name; return 0; }
printf_debug("LinuxBIOS last image size " - "(not ROM size) is %d bytes\n", *walk); + "(not rom size) is %d bytes.\n", *walk);
walk--; mainboard_part = strdup((const char *)(bios + size - *walk)); walk--; mainboard_vendor = strdup((const char *)(bios + size - *walk)); - printf_debug("Manufacturer: %s\n", mainboard_vendor); - printf_debug("Mainboard ID: %s\n", mainboard_part); + printf_debug("MANUFACTURER: %s\n", mainboard_vendor); + printf_debug("MAINBOARD ID: %s\n", mainboard_part);
/* * If lb_vendor is not set, the linuxbios table was @@ -74,18 +74,18 @@ if (!strcasecmp(mainboard_vendor, lb_vendor) && !strcasecmp(mainboard_part, lb_part)) { printf_debug("This firmware image matches " - "this motherboard\n"); + "this motherboard.\n"); } else { if (force) { printf("WARNING: This firmware image does not " - "seem to fit to this machine - forcing it\n"); + "seem to fit to this machine - forcing it.\n"); } else { printf("ERROR: Your firmware image (%s:%s) does not " "appear to\n be correct for the detected " "mainboard (%s:%s)\n\nOverride with --force if you " "are absolutely sure that you\nare using a correct " "image for this mainboard or override\nthe detected " - "values with --mainboard <vendor>:<mainboard>\n\n", + "values with --mainboard <vendor>:<mainboard>.\n\n", mainboard_vendor, mainboard_part, lb_vendor, lb_part); exit(1); @@ -104,7 +104,7 @@ romlayout = fopen(name, "r");
if (!romlayout) { - fprintf(stderr, "ERROR: Could not open ROM layout (%s)\n", + fprintf(stderr, "ERROR: Could not open rom layout (%s).\n", name); return -1; } @@ -150,11 +150,11 @@ for (i = 0; i < romimages; i++) { if (!strcmp(rom_entries[i].name, name)) { rom_entries[i].included = 1; - printf("found\n"); + printf("found.\n"); return i; } } - printf("not found\n"); + printf("not found.\n"); // Not found. Error.
return -1;
Modified: trunk/util/flashrom/lbtable.c =================================================================== --- trunk/util/flashrom/lbtable.c 2007-10-10 16:31:30 UTC (rev 2846) +++ trunk/util/flashrom/lbtable.c 2007-10-10 17:42:20 UTC (rev 2847) @@ -42,7 +42,8 @@ uint8_t byte[2]; uint16_t word; } value; - unsigned long sum, i; + unsigned long sum; + unsigned long i;
/* In the most straight forward way possible, * compute an ip style checksum. @@ -52,13 +53,15 @@ for (i = 0; i < length; i++) { unsigned long value; value = ptr[i]; - if (i & 1) + if (i & 1) { value <<= 8; + } /* Add the new value */ sum += value; /* Wrap around the carry */ - if (sum > 0xFFFF) + if (sum > 0xFFFF) { sum = (sum + (sum >> 16)) & 0xFFFF; + } } value.byte[0] = sum & 0xff; value.byte[1] = (sum >> 8) & 0xff; @@ -107,17 +110,17 @@ continue; } if (count_lb_records(head) != head->table_entries) { - fprintf(stderr, "Bad record count: %d\n", + fprintf(stderr, "bad record count: %d\n", head->table_entries); continue; } if (compute_checksum((uint8_t *) head, sizeof(*head)) != 0) { - fprintf(stderr, "Bad header checksum\n"); + fprintf(stderr, "bad header checksum\n"); continue; } if (compute_checksum(recs, head->table_bytes) != head->table_checksum) { - fprintf(stderr, "Bad table checksum: %04x\n", + fprintf(stderr, "bad table checksum: %04x\n", head->table_checksum); continue; } @@ -137,7 +140,7 @@
rec = (struct lb_mainboard *)ptr; max_size = rec->size - sizeof(*rec); - printf("Vendor ID: %.*s, part ID: %.*s\n", + printf("vendor id: %.*s part id: %.*s\n", max_size - rec->vendor_idx, rec->strings + rec->vendor_idx, max_size - rec->part_number_idx, @@ -148,7 +151,7 @@ rec->strings + rec->part_number_idx);
if (lb_part) { - printf("Overwritten by command line, vendor ID: %s, part ID: %s\n", lb_vendor, lb_part); + printf("overwritten by command line, vendor id: %s part id: %s\n", lb_vendor, lb_part); } else { lb_part = strdup(part); lb_vendor = strdup(vendor); @@ -198,7 +201,7 @@ if (lb_table) { unsigned long addr; addr = ((char *)lb_table) - ((char *)low_1MB); - printf_debug("LinuxBIOS table found at address %p\n", lb_table); + printf_debug("lb_table found at address %p\n", lb_table); rec = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes); last = (struct lb_record *)(((char *)rec) + lb_table->table_bytes); printf_debug("LinuxBIOS header(%d) checksum: %04x table(%d) checksum: %04x entries: %d\n", @@ -207,7 +210,7 @@ lb_table->table_entries); search_lb_records(rec, last, addr + lb_table->header_bytes); } else { - printf("No LinuxBIOS table found\n"); + printf("No LinuxBIOS table found.\n"); return -1; }
Modified: trunk/util/flashrom/udelay.c =================================================================== --- trunk/util/flashrom/udelay.c 2007-10-10 16:31:30 UTC (rev 2846) +++ trunk/util/flashrom/udelay.c 2007-10-10 17:42:20 UTC (rev 2847) @@ -56,5 +56,5 @@ micro = count / timeusec;
printf_debug("%ldM loops per second. ", (unsigned long)micro); - printf("OK\n"); + printf("ok\n"); }