diff --git a/82802ab.c b/82802ab.c
index c0f60ef..fceb715 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -52,9 +52,9 @@
 	uint8_t id1, id2;
 
 #if 0
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0x90;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x90;
 #endif
 
 	*bios = 0xff;
@@ -62,13 +62,13 @@
 	*bios = 0x90;
 	myusec_delay(10);
 
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 #if 1
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0xF0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xF0;
 
 #endif
 	myusec_delay(10);
@@ -82,7 +82,7 @@
 			    fd_mem, (off_t) (0 - 0x400000 - size));
 		if (bios == MAP_FAILED) {
 			// it's this part but we can't map it ...
-			perror("Error MMAP memory using " MEM_DEV );
+			perror("Error MMAP memory using " MEM_DEV);
 			exit(1);
 		}
 
@@ -101,7 +101,7 @@
 
 	*bios = 0x70;
 	if ((*bios & 0x80) == 0) {	// it's busy
-		while ((*bios & 0x80) == 0);
+		while ((*bios & 0x80) == 0) ;
 	}
 
 	status = *bios;
@@ -111,21 +111,20 @@
 	*bios = 0x90;
 	myusec_delay(10);
 
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 	// this is needed to jam it out of "read id" mode
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0xF0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xF0;
 	return status;
 
 }
 int erase_82802ab_block(struct flashchip *flash, int offset)
 {
 	volatile uint8_t *bios = flash->virt_addr + offset;
-	volatile uint8_t *wrprotect =
-	    flash->virt_addr_2 + offset + 2;
+	volatile uint8_t *wrprotect = flash->virt_addr_2 + offset + 2;
 	uint8_t status;
 
 	// clear status register
@@ -138,8 +137,8 @@
 	//printf("write protect is 0x%x\n", *(wrprotect));
 
 	// now start it
-	*(volatile uint8_t *) (bios) = 0x20;
-	*(volatile uint8_t *) (bios) = 0xd0;
+	*(volatile uint8_t *)(bios) = 0x20;
+	*(volatile uint8_t *)(bios) = 0xd0;
 	myusec_delay(10);
 	// now let's see what the register is
 	status = wait_82802ab(flash->virt_addr);
@@ -160,8 +159,8 @@
 	return (0);
 }
 
-void write_page_82802ab(volatile uint8_t *bios, uint8_t *src, volatile uint8_t *dst,
-			int page_size)
+void write_page_82802ab(volatile uint8_t *bios, uint8_t *src,
+			volatile uint8_t *dst, int page_size)
 {
 	int i;
 
@@ -177,8 +176,8 @@
 int write_82802ab(struct flashchip *flash, uint8_t *buf)
 {
 	int i;
-	int total_size = flash->total_size * 1024, page_size =
-	    flash->page_size;
+	int total_size = flash->total_size * 1024;
+	int page_size = flash->page_size;
 	volatile uint8_t *bios = flash->virt_addr;
 
 	erase_82802ab(flash);
@@ -191,8 +190,7 @@
 		printf("%04d at address: 0x%08x", i, i * page_size);
 		write_page_82802ab(bios, buf + i * page_size,
 				   bios + i * page_size, page_size);
-		printf
-		    ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
+		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
 	printf("\n");
 	protect_82802ab(bios);
diff --git a/board_enable.c b/board_enable.c
index 89d66ad..10608ad 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -30,38 +30,33 @@
 #define W836_DATA  0x2F
 
 /* Enter extended functions */
-static void
-w836xx_ext_enter(void)
+static void w836xx_ext_enter(void)
 {
 	outb(0x87, W836_INDEX);
 	outb(0x87, W836_INDEX);
 }
 
 /* Leave extended functions */
-static void
-w836xx_ext_leave(void)
+static void w836xx_ext_leave(void)
 {
 	outb(0xAA, W836_INDEX);
 }
 
 /* General functions for read/writing WB SuperIOs */
-static unsigned char
-wbsio_read(unsigned char index)
+static unsigned char wbsio_read(unsigned char index)
 {
 	outb(index, W836_INDEX);
 	return inb(W836_DATA);
 }
 
-static void
-wbsio_write(unsigned char index, unsigned char data)
+static void wbsio_write(unsigned char index, unsigned char data)
 {
 	outb(index, W836_INDEX);
 	outb(data, W836_DATA);
 }
 
 static void
-wbsio_mask(unsigned char index, unsigned char data,
-	   unsigned char mask)
+wbsio_mask(unsigned char index, unsigned char data, unsigned char mask)
 {
 	unsigned char tmp;
 
@@ -83,7 +78,7 @@
 	w836xx_ext_enter();
 
 	/* Is this the w83627hf? */
-	if (wbsio_read(0x20) != 0x52) { /* SIO device ID register */
+	if (wbsio_read(0x20) != 0x52) {	/* SIO device ID register */
 		fprintf(stderr, "\nERROR: %s: W83627HF: Wrong ID: 0x%02X.\n",
 			name, wbsio_read(0x20));
 		w836xx_ext_leave();
@@ -93,15 +88,15 @@
 	/* PIN89S: WDTO/GP24 multiplex -> GPIO24 */
 	wbsio_mask(0x2B, 0x10, 0x10);
 
-	wbsio_write(0x07, 0x08); /* Select logical device 8: GPIO port 2 */
+	wbsio_write(0x07, 0x08);	/* Select logical device 8: GPIO port 2 */
 
-	wbsio_mask(0x30, 0x01, 0x01); /* Activate logical device. */
+	wbsio_mask(0x30, 0x01, 0x01);	/* Activate logical device. */
 
-	wbsio_mask(0xF0, 0x00, 0x10); /* GPIO24 -> output */
+	wbsio_mask(0xF0, 0x00, 0x10);	/* GPIO24 -> output */
 
-	wbsio_mask(0xF2, 0x00, 0x10); /* Clear GPIO24 inversion */
+	wbsio_mask(0xF2, 0x00, 0x10);	/* Clear GPIO24 inversion */
 
-	wbsio_mask(0xF1, 0x10, 0x10); /* Raise GPIO24 */
+	wbsio_mask(0xF1, 0x10, 0x10);	/* Raise GPIO24 */
 
 	w836xx_ext_leave();
 
@@ -116,30 +111,30 @@
 
 static int board_via_epia_m(const char *name)
 {
-        struct pci_dev *dev;
-        unsigned int base;
-        uint8_t val;
+	struct pci_dev *dev;
+	unsigned int base;
+	uint8_t val;
 
-        dev = pci_dev_find(0x1106, 0x3177); /* VT8235 ISA bridge */
-        if (!dev) {
-                fprintf(stderr, "\nERROR: VT8235 ISA Bridge not found.\n");
-                return -1;
-        }
+	dev = pci_dev_find(0x1106, 0x3177);	/* VT8235 ISA bridge */
+	if (!dev) {
+		fprintf(stderr, "\nERROR: VT8235 ISA Bridge not found.\n");
+		return -1;
+	}
 
-        /* GPIO12-15 -> output */
-        val = pci_read_byte(dev, 0xE4);
-        val |= 0x10;
-        pci_write_byte(dev, 0xE4, val);
+	/* GPIO12-15 -> output */
+	val = pci_read_byte(dev, 0xE4);
+	val |= 0x10;
+	pci_write_byte(dev, 0xE4, val);
 
-        /* Get Power Management IO address. */
-        base = pci_read_word(dev, 0x88) & 0xFF80;
+	/* Get Power Management IO address. */
+	base = pci_read_word(dev, 0x88) & 0xFF80;
 
-        /* enable GPIO15 which is connected to write protect. */
-        val = inb(base + 0x4D);
-        val |= 0x80;
-        outb(val, base + 0x4D);
+	/* enable GPIO15 which is connected to write protect. */
+	val = inb(base + 0x4D);
+	val |= 0x80;
+	outb(val, base + 0x4D);
 
-        return 0;
+	return 0;
 }
 
 /*
@@ -149,29 +144,29 @@
 
 static int board_asus_a7v8x_mx(const char *name)
 {
-        struct pci_dev *dev;
-        uint8_t val;
+	struct pci_dev *dev;
+	uint8_t val;
 
-        dev = pci_dev_find(0x1106, 0x3177); /* VT8235 ISA bridge */
-        if (!dev) {
-                fprintf(stderr, "\nERROR: VT8235 ISA Bridge not found.\n");
-                return -1;
-        }
+	dev = pci_dev_find(0x1106, 0x3177);	/* VT8235 ISA bridge */
+	if (!dev) {
+		fprintf(stderr, "\nERROR: VT8235 ISA Bridge not found.\n");
+		return -1;
+	}
 
-        /* This bit is marked reserved actually */
-        val = pci_read_byte(dev, 0x59);
-        val &= 0x7F;
-        pci_write_byte(dev, 0x59, val);
+	/* This bit is marked reserved actually */
+	val = pci_read_byte(dev, 0x59);
+	val &= 0x7F;
+	pci_write_byte(dev, 0x59, val);
 
 	/* Raise ROM MEMW# line on Winbond w83697 SuperIO */
-        w836xx_ext_enter();
+	w836xx_ext_enter();
 
-	if (!(wbsio_read(0x24) & 0x02)) /* flash rom enabled? */
-		wbsio_mask(0x24, 0x08, 0x08); /* enable MEMW# */
+	if (!(wbsio_read(0x24) & 0x02))	/* flash rom enabled? */
+		wbsio_mask(0x24, 0x08, 0x08);	/* enable MEMW# */
 
 	w836xx_ext_leave();
 
-        return 0;
+	return 0;
 }
 
 /*
@@ -185,39 +180,39 @@
  */
 
 struct board_pciid_enable {
-        /* Any device, but make it sensible, like the isa bridge. */
-        uint16_t  first_vendor;
-        uint16_t  first_device;
-        uint16_t  first_card_vendor;
-        uint16_t  first_card_device;
+	/* Any device, but make it sensible, like the isa bridge. */
+	uint16_t first_vendor;
+	uint16_t first_device;
+	uint16_t first_card_vendor;
+	uint16_t first_card_device;
 
-        /* Any device, but make it sensible, like 
+	/* Any device, but make it sensible, like 
 	 * the host bridge. May be NULL
 	 */
-        uint16_t  second_vendor;
-        uint16_t  second_device;
-        uint16_t  second_card_vendor;
-        uint16_t  second_card_device;
+	uint16_t second_vendor;
+	uint16_t second_device;
+	uint16_t second_card_vendor;
+	uint16_t second_card_device;
 
-        /* From linuxbios table */
-        char  *lb_vendor;
-        char  *lb_part;
+	/* From linuxbios table */
+	char *lb_vendor;
+	char *lb_part;
 
-        char  *name;
-        int  (*enable)(const char *name);
+	char *name;
+	int (*enable) (const char *name);
 };
 
 struct board_pciid_enable board_pciid_enables[] = {
-	{ 0x1022, 0x7468, 0x0000, 0x0000,  0x0000, 0x0000, 0x0000, 0x0000,
-		"iwill", "dk8_htx", "IWILL DK8-HTX", w83627hf_gpio24_raise },
-	{ 0x1022, 0x746B, 0x1022, 0x36C0,  0x0000, 0x0000, 0x0000, 0x0000,
-		"AGAMI", "ARUMA", "agami Aruma", w83627hf_gpio24_raise },
-	{ 0x1106, 0x3177, 0x1106, 0xAA01,  0x1106, 0x3123, 0x1106, 0xAA01, 
-		NULL, NULL, "VIA EPIA M/MII/...", board_via_epia_m },
-	{ 0x1106, 0x3177, 0x1043, 0x80A1,  0x1106, 0x3205, 0x1043, 0x8118, 
-		NULL, NULL, "ASUS A7V8-MX SE", board_asus_a7v8x_mx },
+	{0x1022, 0x7468, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	 "iwill", "dk8_htx", "IWILL DK8-HTX", w83627hf_gpio24_raise},
+	{0x1022, 0x746B, 0x1022, 0x36C0, 0x0000, 0x0000, 0x0000, 0x0000,
+	 "AGAMI", "ARUMA", "agami Aruma", w83627hf_gpio24_raise},
+	{0x1106, 0x3177, 0x1106, 0xAA01, 0x1106, 0x3123, 0x1106, 0xAA01,
+	 NULL, NULL, "VIA EPIA M/MII/...", board_via_epia_m},
+	{0x1106, 0x3177, 0x1043, 0x80A1, 0x1106, 0x3205, 0x1043, 0x8118,
+	 NULL, NULL, "ASUS A7V8-MX SE", board_asus_a7v8x_mx},
 
-        { 0, 0, 0, 0,  0, 0, 0, 0, NULL, NULL } /* Keep this */
+	{0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL}	/* Keep this */
 };
 
 /*
@@ -225,27 +220,27 @@
  * Require main pci-ids to match too as extra safety.
  *
  */
-static struct board_pciid_enable *
-board_match_linuxbios_name(char *vendor, char *part)
+static struct board_pciid_enable *board_match_linuxbios_name(char *vendor,
+							     char *part)
 {
-        struct board_pciid_enable *board = board_pciid_enables;
+	struct board_pciid_enable *board = board_pciid_enables;
 
-        for (; board->name; board++) {
-                if (!board->lb_vendor || strcmp(board->lb_vendor, vendor))
-                        continue;
+	for (; board->name; board++) {
+		if (!board->lb_vendor || strcmp(board->lb_vendor, vendor))
+			continue;
 
-                if (!board->lb_part || strcmp(board->lb_part, part))
-                        continue;
+		if (!board->lb_part || strcmp(board->lb_part, part))
+			continue;
 
-                if (!pci_dev_find(board->first_vendor, board->first_device))
-                        continue;
+		if (!pci_dev_find(board->first_vendor, board->first_device))
+			continue;
 
-                if (board->second_vendor &&
-                    !pci_dev_find(board->second_vendor, board->second_device))
-                        continue;
-                return board;
-        }
-        return NULL;
+		if (board->second_vendor &&
+		    !pci_dev_find(board->second_vendor, board->second_device))
+			continue;
+		return board;
+	}
+	return NULL;
 }
 
 /*
@@ -254,35 +249,35 @@
  */
 static struct board_pciid_enable *board_match_pci_card_ids(void)
 {
-        struct board_pciid_enable *board = board_pciid_enables;
+	struct board_pciid_enable *board = board_pciid_enables;
 
-        for (; board->name; board++) {
-                if (!board->first_card_vendor || !board->first_card_device)
-                        continue;
+	for (; board->name; board++) {
+		if (!board->first_card_vendor || !board->first_card_device)
+			continue;
 
-                if (!pci_card_find(board->first_vendor, board->first_device,
-                                   board->first_card_vendor,
-                                   board->first_card_device))
-                        continue;
+		if (!pci_card_find(board->first_vendor, board->first_device,
+				   board->first_card_vendor,
+				   board->first_card_device))
+			continue;
 
-                if (board->second_vendor) {
-                        if (board->second_card_vendor) {
-                                if (!pci_card_find(board->second_vendor,
-                                                   board->second_device,
-                                                   board->second_card_vendor,
-                                                   board->second_card_device))
-                                        continue;
-                        } else {
-                                if (!pci_dev_find(board->second_vendor,
-                                                  board->second_device))
-                                        continue;
-                        }
-                }
+		if (board->second_vendor) {
+			if (board->second_card_vendor) {
+				if (!pci_card_find(board->second_vendor,
+						   board->second_device,
+						   board->second_card_vendor,
+						   board->second_card_device))
+					continue;
+			} else {
+				if (!pci_dev_find(board->second_vendor,
+						  board->second_device))
+					continue;
+			}
+		}
 
-                return board;
-        }
+		return board;
+	}
 
-        return NULL;
+	return NULL;
 }
 
 /*
@@ -290,25 +285,25 @@
  */
 int board_flash_enable(char *vendor, char *part)
 {
-        struct board_pciid_enable *board = NULL;
-        int ret = 0;
+	struct board_pciid_enable *board = NULL;
+	int ret = 0;
 
-        if (vendor && part)
-                board = board_match_linuxbios_name(vendor, part);
+	if (vendor && part)
+		board = board_match_linuxbios_name(vendor, part);
 
-        if (!board)
-                board = board_match_pci_card_ids();
+	if (!board)
+		board = board_match_pci_card_ids();
 
-        if (board) {
-                printf("Found board \"%s\": Enabling flash write... ",
-                       board->name);
+	if (board) {
+		printf("Found board \"%s\": Enabling flash write... ",
+		       board->name);
 
-                ret = board->enable(board->name);
-                if (ret)
-                        printf("Failed!\n");
-                else
-                        printf("OK.\n");
-        }
+		ret = board->enable(board->name);
+		if (ret)
+			printf("Failed!\n");
+		else
+			printf("OK.\n");
+	}
 
-        return ret;
+	return ret;
 }
diff --git a/chipset_enable.c b/chipset_enable.c
index d49d085..d903f21 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -75,20 +75,21 @@
 static int enable_flash_piix4(struct pci_dev *dev, char *name)
 {
 	uint16_t old, new;
-	uint16_t xbcs = 0x4e; /* X-Bus Chip Select register. */
+	uint16_t xbcs = 0x4e;	/* X-Bus Chip Select register. */
 
 	old = pci_read_word(dev, xbcs);
 
 	/* Set bit 9: 1-Meg Extended BIOS Enable (PCI master accesses to
-                      FFF00000-FFF7FFFF are forwarded to ISA).
-           Set bit 7: Extended BIOS Enable (PCI master accesses to
-                      FFF80000-FFFDFFFF are forwarded to ISA).
-           Set bit 6: Lower BIOS Enable (PCI master, or ISA master accesses to
-                      the lower 64-Kbyte BIOS block (E0000-EFFFF) at the top
-                      of 1 Mbyte, or the aliases at the top of 4 Gbyte
-                      (FFFE0000-FFFEFFFF) result in the generation of BIOSCS#.
-           Note: Accesses to FFFF0000-FFFFFFFF are always forwarded to ISA.
-           Set bit 2: BIOSCS# Write Enable (1=enable, 0=disable). */
+	 *            FFF00000-FFF7FFFF are forwarded to ISA).
+	 * Set bit 7: Extended BIOS Enable (PCI master accesses to
+	 *            FFF80000-FFFDFFFF are forwarded to ISA).
+	 * Set bit 6: Lower BIOS Enable (PCI master, or ISA master accesses to
+	 *            the lower 64-Kbyte BIOS block (E0000-EFFFF) at the top
+	 *            of 1 Mbyte, or the aliases at the top of 4 Gbyte
+	 *            (FFFE0000-FFFEFFFF) result in the generation of BIOSCS#.
+	 * Note: Accesses to FFFF0000-FFFFFFFF are always forwarded to ISA.
+	 * Set bit 2: BIOSCS# Write Enable (1=enable, 0=disable).
+	 */
 	new = old | 0x2c4;
 
 	if (new == old)
@@ -113,7 +114,7 @@
 	 */
 
 	/* Note: the ICH0-ICH5 BIOS_CNTL register is actually 16 bit wide, but
-         * just treating it as 8 bit wide seems to work fine in practice.
+	 * just treating it as 8 bit wide seems to work fine in practice.
 	 */
 
 	/* see ie. page 375 of "Intel ICH7 External Design Specification"
@@ -130,8 +131,7 @@
 	pci_write_byte(dev, bios_cntl, new);
 
 	if (pci_read_byte(dev, bios_cntl) != new) {
-		printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-		       bios_cntl, new, name);
+		printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", bios_cntl, new, name);
 		return -1;
 	}
 	return 0;
@@ -150,23 +150,22 @@
 /*
  *
  */
-static int
-enable_flash_vt823x(struct pci_dev *dev, char *name)
+static int enable_flash_vt823x(struct pci_dev *dev, char *name)
 {
 	uint8_t val;
 
-        /* ROM Write enable */
+	/* ROM Write enable */
 	val = pci_read_byte(dev, 0x40);
 	val |= 0x10;
 	pci_write_byte(dev, 0x40, val);
 
 	if (pci_read_byte(dev, 0x40) != val) {
 		printf("\nWARNING: Failed to enable ROM Write on \"%s\"\n",
-                       name);
+		       name);
 		return -1;
 	}
 
-        return 0;
+	return 0;
 }
 
 static int enable_flash_cs5530(struct pci_dev *dev, char *name)
@@ -178,8 +177,7 @@
 	new = pci_read_byte(dev, 0x52);
 
 	if (new != 0xee) {
-		printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-		       0x52, new, name);
+		printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x52, new, name);
 		return -1;
 	}
 
@@ -189,7 +187,6 @@
 	return 0;
 }
 
-
 static int enable_flash_sc1100(struct pci_dev *dev, char *name)
 {
 	uint8_t new;
@@ -199,8 +196,7 @@
 	new = pci_read_byte(dev, 0x52);
 
 	if (new != 0xee) {
-		printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-		       0x52, new, name);
+		printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x52, new, name);
 		return -1;
 	}
 	return 0;
@@ -221,8 +217,7 @@
 
 	newer = pci_read_byte(dev, 0x45);
 	if (newer != new) {
-		printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-		       0x45, new, name);
+		printf("tried to set register 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x45, new, name);
 		printf("Stuck at 0x%x\n", newer);
 		return -1;
 	}
@@ -233,6 +228,7 @@
 {
 	/* register 4e.b gets or'ed with one */
 	uint8_t old, new;
+
 	/* if it fails, it fails. There are so many variations of broken mobos
 	 * that it is hard to argue that we should quit at this point.
 	 */
@@ -243,8 +239,7 @@
 	if (new != old) {
 		pci_write_byte(dev, 0x43, new);
 		if (pci_read_byte(dev, 0x43) != new) {
-			printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-			       0x43, new, name);
+			printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x43, new, name);
 		}
 	}
 
@@ -255,8 +250,7 @@
 	pci_write_byte(dev, 0x40, new);
 
 	if (pci_read_byte(dev, 0x40) != new) {
-		printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-		       0x40, new, name);
+		printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x40, new, name);
 		return -1;
 	}
 	return 0;
@@ -264,47 +258,46 @@
 
 static int enable_flash_ck804(struct pci_dev *dev, char *name)
 {
-        /* register 4e.b gets or'ed with one */
-        uint8_t old, new;
-        /* if it fails, it fails. There are so many variations of broken mobos
-         * that it is hard to argue that we should quit at this point.
-         */
+	/* register 4e.b gets or'ed with one */
+	uint8_t old, new;
 
-        /* dump_pci_device(dev); */
+	/* if it fails, it fails. There are so many variations of broken mobos
+	 * that it is hard to argue that we should quit at this point.
+	 */
 
-        old = pci_read_byte(dev, 0x88);
-        new = old | 0xc0;
-        if (new != old) {
-                pci_write_byte(dev, 0x88, new);
-                if (pci_read_byte(dev, 0x88) != new) {
-                        printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-                               0x88, new, name);
-                }
-        }
+	/* dump_pci_device(dev); */
 
-        old = pci_read_byte(dev, 0x6d);
-        new = old | 0x01;
-        if (new == old)
-                return 0;
-        pci_write_byte(dev, 0x6d, new);
+	old = pci_read_byte(dev, 0x88);
+	new = old | 0xc0;
+	if (new != old) {
+		pci_write_byte(dev, 0x88, new);
+		if (pci_read_byte(dev, 0x88) != new) {
+			printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x88, new, name);
+		}
+	}
 
-        if (pci_read_byte(dev, 0x6d) != new) {
-                printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-                       0x6d, new, name);
-                return -1;
-        }
-        return 0;
+	old = pci_read_byte(dev, 0x6d);
+	new = old | 0x01;
+	if (new == old)
+		return 0;
+	pci_write_byte(dev, 0x6d, new);
+
+	if (pci_read_byte(dev, 0x6d) != new) {
+		printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", 0x6d, new, name);
+		return -1;
+	}
+	return 0;
 }
 
 static int enable_flash_sb400(struct pci_dev *dev, char *name)
 {
-        uint8_t tmp;
+	uint8_t tmp;
 
 	struct pci_filter f;
 	struct pci_dev *smbusdev;
 
 	/* then look for the smbus device */
-	pci_filter_init((struct pci_access *) 0, &f);
+	pci_filter_init((struct pci_access *)0, &f);
 	f.vendor = 0x1002;
 	f.device = 0x4372;
 
@@ -314,26 +307,26 @@
 		}
 	}
 
-	if(!smbusdev) {
+	if (!smbusdev) {
 		fprintf(stderr, "ERROR: SMBus device not found. aborting\n");
 		exit(1);
 	}
 
 	/* enable some smbus stuff */
-	tmp=pci_read_byte(smbusdev, 0x79);
-	tmp|=0x01;
+	tmp = pci_read_byte(smbusdev, 0x79);
+	tmp |= 0x01;
 	pci_write_byte(smbusdev, 0x79, tmp);
 
 	/* change southbridge */
-	tmp=pci_read_byte(dev, 0x48);
-	tmp|=0x21;
+	tmp = pci_read_byte(dev, 0x48);
+	tmp |= 0x21;
 	pci_write_byte(dev, 0x48, tmp);
 
 	/* now become a bit silly. */
-	tmp=inb(0xc6f);
-	outb(tmp,0xeb);
+	tmp = inb(0xc6f);
 	outb(tmp, 0xeb);
-	tmp|=0x40;
+	outb(tmp, 0xeb);
+	tmp |= 0x40;
 	outb(tmp, 0xc6f);
 	outb(tmp, 0xeb);
 	outb(tmp, 0xeb);
@@ -343,38 +336,39 @@
 
 static int enable_flash_mcp55(struct pci_dev *dev, char *name)
 {
-        /* register 4e.b gets or'ed with one */
-        unsigned char old, new, byte;
-        unsigned short word;
+	/* register 4e.b gets or'ed with one */
+	unsigned char old, new, byte;
+	unsigned short word;
 
-        /* if it fails, it fails. There are so many variations of broken mobos
-         * that it is hard to argue that we should quit at this point.
-         */
+	/* if it fails, it fails. There are so many variations of broken mobos
+	 * that it is hard to argue that we should quit at this point.
+	 */
 
-        /* dump_pci_device(dev); */
+	/* dump_pci_device(dev); */
 
-        /* Set the 4MB enable bit bit */
-        byte = pci_read_byte(dev, 0x88);
-        byte |= 0xff; /* 256K */
-        pci_write_byte(dev, 0x88, byte);
-        byte = pci_read_byte(dev, 0x8c);
-        byte |= 0xff; /* 1M */
-        pci_write_byte(dev, 0x8c, byte);
-        word = pci_read_word(dev, 0x90);
-        word |= 0x7fff; /* 15M */
-        pci_write_word(dev, 0x90, word);
+	/* Set the 4MB enable bit bit */
+	byte = pci_read_byte(dev, 0x88);
+	byte |= 0xff;		/* 256K */
+	pci_write_byte(dev, 0x88, byte);
+	byte = pci_read_byte(dev, 0x8c);
+	byte |= 0xff;		/* 1M */
+	pci_write_byte(dev, 0x8c, byte);
+	word = pci_read_word(dev, 0x90);
+	word |= 0x7fff;		/* 15M */
+	pci_write_word(dev, 0x90, word);
 
-        old = pci_read_byte(dev, 0x6d);
-        new = old | 0x01;
-        if (new == old)
-                return 0;
-        pci_write_byte(dev, 0x6d, new);
+	old = pci_read_byte(dev, 0x6d);
+	new = old | 0x01;
+	if (new == old)
+		return 0;
+	pci_write_byte(dev, 0x6d, new);
 
-        if (pci_read_byte(dev, 0x6d) != new) {
-                printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
-                       0x6d, new, name);
-                return -1;
-        }
+	if (pci_read_byte(dev, 0x6d) != new) {
+		printf
+		    ("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n",
+		     0x6d, new, name);
+		return -1;
+	}
 
 	return 0;
 
@@ -410,61 +404,60 @@
 	{0x1106, 0x8231, "VT8231", enable_flash_vt823x},
 	{0x1106, 0x3177, "VT8235", enable_flash_vt823x},
 	{0x1106, 0x3227, "VT8237", enable_flash_vt823x},
-	{0x1106, 0x8324, "CX700" , enable_flash_vt823x},
+	{0x1106, 0x8324, "CX700", enable_flash_vt823x},
 	{0x1106, 0x0686, "VT82C686", enable_flash_amd8111},
 	{0x1078, 0x0100, "CS5530", enable_flash_cs5530},
 	{0x100b, 0x0510, "SC1100", enable_flash_sc1100},
 	{0x1039, 0x0008, "SIS5595", enable_flash_sis5595},
 	{0x1022, 0x7468, "AMD8111", enable_flash_amd8111},
 	/* this fallthrough looks broken. */
-        {0x10de, 0x0050, "NVIDIA CK804", enable_flash_ck804}, /* LPC */
-        {0x10de, 0x0051, "NVIDIA CK804", enable_flash_ck804}, /* Pro */
-        {0x10de, 0x00d3, "NVIDIA CK804", enable_flash_ck804}, /* Slave, should not be here, to fix known bug for A01. */
+	{0x10de, 0x0050, "NVIDIA CK804", enable_flash_ck804},	/* LPC */
+	{0x10de, 0x0051, "NVIDIA CK804", enable_flash_ck804},	/* Pro */
+	{0x10de, 0x00d3, "NVIDIA CK804", enable_flash_ck804},	/* Slave, should not be here, to fix known bug for A01. */
 
-        {0x10de, 0x0260, "NVidia MCP51", enable_flash_ck804},
-        {0x10de, 0x0261, "NVidia MCP51", enable_flash_ck804},
-        {0x10de, 0x0262, "NVidia MCP51", enable_flash_ck804},
-        {0x10de, 0x0263, "NVidia MCP51", enable_flash_ck804},
+	{0x10de, 0x0260, "NVidia MCP51", enable_flash_ck804},
+	{0x10de, 0x0261, "NVidia MCP51", enable_flash_ck804},
+	{0x10de, 0x0262, "NVidia MCP51", enable_flash_ck804},
+	{0x10de, 0x0263, "NVidia MCP51", enable_flash_ck804},
 
-	{0x10de, 0x0360, "NVIDIA MCP55", enable_flash_mcp55}, /* Gigabyte m57sli-s4 */
-	{0x10de, 0x0361, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */
-	{0x10de, 0x0362, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */
-	{0x10de, 0x0363, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */
-        {0x10de, 0x0364, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */
-	{0x10de, 0x0365, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */
-	{0x10de, 0x0366, "NVIDIA MCP55", enable_flash_mcp55}, /* LPC */
-	{0x10de, 0x0367, "NVIDIA MCP55", enable_flash_mcp55}, /* Pro */
+	{0x10de, 0x0360, "NVIDIA MCP55", enable_flash_mcp55},	/* Gigabyte m57sli-s4 */
+	{0x10de, 0x0361, "NVIDIA MCP55", enable_flash_mcp55},	/* LPC */
+	{0x10de, 0x0362, "NVIDIA MCP55", enable_flash_mcp55},	/* LPC */
+	{0x10de, 0x0363, "NVIDIA MCP55", enable_flash_mcp55},	/* LPC */
+	{0x10de, 0x0364, "NVIDIA MCP55", enable_flash_mcp55},	/* LPC */
+	{0x10de, 0x0365, "NVIDIA MCP55", enable_flash_mcp55},	/* LPC */
+	{0x10de, 0x0366, "NVIDIA MCP55", enable_flash_mcp55},	/* LPC */
+	{0x10de, 0x0367, "NVIDIA MCP55", enable_flash_mcp55},	/* Pro */
 
-	{0x1002, 0x4377, "ATI SB400", enable_flash_sb400}, /* ATI Technologies Inc IXP SB400 PCI-ISA Bridge (rev 80) */
+	{0x1002, 0x4377, "ATI SB400", enable_flash_sb400},	/* ATI Technologies Inc IXP SB400 PCI-ISA Bridge (rev 80) */
 };
 
 /*
  *
  */
-int
-chipset_flash_enable(void)
+int chipset_flash_enable(void)
 {
-        struct pci_dev *dev = 0;
-        int ret = -2; /* nothing! */
-        int i;
+	struct pci_dev *dev = 0;
+	int ret = -2;		/* nothing! */
+	int i;
 
 	/* now let's try to find the chipset we have ... */
 	for (i = 0; i < sizeof(enables) / sizeof(enables[0]); i++) {
-                dev = pci_dev_find(enables[i].vendor, enables[i].device);
-                if (dev)
-                        break;
-        }
-
-        if (dev) {
-                printf("Found chipset \"%s\": Enabling flash write... ",
-                       enables[i].name);
-
-                ret = enables[i].doit(dev, enables[i].name);
-                if (ret)
-                        printf("Failed!\n");
-                else
-                        printf("OK.\n");
+		dev = pci_dev_find(enables[i].vendor, enables[i].device);
+		if (dev)
+			break;
 	}
 
-        return ret;
+	if (dev) {
+		printf("Found chipset \"%s\": Enabling flash write... ",
+		       enables[i].name);
+
+		ret = enables[i].doit(dev, enables[i].name);
+		if (ret)
+			printf("Failed!\n");
+		else
+			printf("OK.\n");
+	}
+
+	return ret;
 }
diff --git a/flash.h b/flash.h
index 0d54c42..3e3ad84 100644
--- a/flash.h
+++ b/flash.h
@@ -132,13 +132,13 @@
 void myusec_calibrate_delay();
 
 /* pci handling for board/chipset_enable */
-struct pci_access *pacc; /* For board and chipset_enable */
+struct pci_access *pacc;	/* For board and chipset_enable */
 struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device);
-struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device, 
-		uint16_t card_vendor, uint16_t card_device);
+struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
+			      uint16_t card_vendor, uint16_t card_device);
 
-int board_flash_enable(char *vendor, char *part); /* board_enable.c */
-int chipset_flash_enable(void); /* chipset_enable.c */
+int board_flash_enable(char *vendor, char *part);	/* board_enable.c */
+int chipset_flash_enable(void);	/* chipset_enable.c */
 
 /* physical memory mapping device */
 
diff --git a/flashrom.c b/flashrom.c
index 04c8600..cf895a0 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -51,54 +51,52 @@
 #include "debug.h"
 
 char *chip_to_probe = NULL;
-struct pci_access *pacc; /* For board and chipset_enable */
+struct pci_access *pacc;	/* For board and chipset_enable */
 int exclude_start_page, exclude_end_page;
-int force=0, verbose=0;
+int force = 0, verbose = 0;
 
 int fd_mem;
 
 /*
  *
  */
-struct pci_dev *
-pci_dev_find(uint16_t vendor, uint16_t device)
+struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device)
 {
-        struct pci_dev  *temp;
-        struct pci_filter  filter;
+	struct pci_dev *temp;
+	struct pci_filter filter;
 
-        pci_filter_init(NULL, &filter);
-        filter.vendor = vendor;
-        filter.device = device;
+	pci_filter_init(NULL, &filter);
+	filter.vendor = vendor;
+	filter.device = device;
 
-        for (temp = pacc->devices; temp; temp = temp->next)
-                if (pci_filter_match(&filter, temp))
-                        return temp;
+	for (temp = pacc->devices; temp; temp = temp->next)
+		if (pci_filter_match(&filter, temp))
+			return temp;
 
-        return NULL;
+	return NULL;
 }
 
 /*
  *
  */
-struct pci_dev *
-pci_card_find(uint16_t vendor, uint16_t device,
-              uint16_t card_vendor, uint16_t card_device)
+struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
+			      uint16_t card_vendor, uint16_t card_device)
 {
-        struct pci_dev  *temp;
-        struct pci_filter  filter;
+	struct pci_dev *temp;
+	struct pci_filter filter;
 
-        pci_filter_init(NULL, &filter);
-        filter.vendor = vendor;
-        filter.device = device;
+	pci_filter_init(NULL, &filter);
+	filter.vendor = vendor;
+	filter.device = device;
 
-        for (temp = pacc->devices; temp; temp = temp->next)
-                if (pci_filter_match(&filter, temp)) {
-                        if ((card_vendor == pci_read_word(temp, 0x2C)) &&
-                            (card_device == pci_read_word(temp, 0x2E)))
-                                return temp;
-                }
+	for (temp = pacc->devices; temp; temp = temp->next)
+		if (pci_filter_match(&filter, temp)) {
+			if ((card_vendor == pci_read_word(temp, 0x2C)) &&
+			    (card_device == pci_read_word(temp, 0x2E)))
+				return temp;
+		}
 
-        return NULL;
+	return NULL;
 }
 
 struct flashchip *probe_flash(struct flashchip *flash)
@@ -111,8 +109,8 @@
 			flash++;
 			continue;
 		}
-		printf_debug("Probing for %s, %d KB\n", 
-				flash->name, flash->total_size);
+		printf_debug("Probing for %s, %d KB\n",
+			     flash->name, flash->total_size);
 
 		size = flash->total_size * 1024;
 
@@ -132,11 +130,11 @@
 		if (getpagesize() > size) {
 			size = getpagesize();
 			printf("WARNING: size: %d -> %ld (page size)\n",
-			       flash->total_size * 1024, (unsigned long) size);
+			       flash->total_size * 1024, (unsigned long)size);
 		}
 
 		bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
-			    fd_mem, (off_t)flash_baseaddr );
+			    fd_mem, (off_t) flash_baseaddr);
 		if (bios == MAP_FAILED) {
 			perror("Error: Can't mmap " MEM_DEV ".");
 			exit(1);
@@ -148,7 +146,7 @@
 			       flash->name, flash_baseaddr);
 			return flash;
 		}
-		munmap((void *) bios, size);
+		munmap((void *)bios, size);
 
 		flash++;
 	}
@@ -162,11 +160,12 @@
 	volatile uint8_t *bios = flash->virt_addr;
 
 	printf("Verifying flash ");
-	
-	if(verbose) printf("address: 0x00000000\b\b\b\b\b\b\b\b\b\b");
-	
+
+	if (verbose)
+		printf("address: 0x00000000\b\b\b\b\b\b\b\b\b\b");
+
 	for (idx = 0; idx < total_size; idx++) {
-		if (verbose && ( (idx & 0xfff) == 0xfff ))
+		if (verbose && ((idx & 0xfff) == 0xfff))
 			printf("0x%08x", idx);
 
 		if (*(bios + idx) != *(buf + idx)) {
@@ -176,38 +175,37 @@
 			printf("- FAILED\n");
 			return 1;
 		}
-		
-		if (verbose && ( (idx & 0xfff) == 0xfff ))
+
+		if (verbose && ((idx & 0xfff) == 0xfff))
 			printf("\b\b\b\b\b\b\b\b\b\b");
 	}
-	if (verbose) 
+	if (verbose)
 		printf("\b\b\b\b\b\b\b\b\b\b ");
-	
+
 	printf("- VERIFIED         \n");
 	return 0;
 }
 
-
 void usage(const char *name)
 {
 	printf("usage: %s [-rwvEVfh] [-c chipname] [-s exclude_start]\n", name);
 	printf("       [-e exclude_end] [-m vendor:part] [-l file.layout] [-i imagename] [file]\n");
-	printf("   -r | --read:                    read flash and save into file\n"
-	       "   -w | --write:                   write file into flash (default when\n"
-	       "                                   file is specified)\n"
-	       "   -v | --verify:                  verify flash against file\n"
-	       "   -E | --erase:                   erase flash device\n"
-	       "   -V | --verbose:                 more verbose output\n"
-	       "   -c | --chip <chipname>:         probe only for specified flash chip\n"
-	       "   -s | --estart <addr>:           exclude start position\n"
-	       "   -e | --eend <addr>:             exclude end postion\n"
-	       "   -m | --mainboard <vendor:part>: override mainboard settings\n"
-	       "   -f | --force:                   force write without checking image\n"
-	       "   -l | --layout <file.layout>:    read rom layout from file\n"
-	       "   -i | --image <name>:            only flash image name from flash layout\n"
-	       "\n"
-	       " If no file is specified, then all that happens\n"
-	       " is that flash info is dumped.\n\n");
+	printf
+	    ("   -r | --read:                    read flash and save into file\n"
+	     "   -w | --write:                   write file into flash (default when\n"
+	     "                                   file is specified)\n"
+	     "   -v | --verify:                  verify flash against file\n"
+	     "   -E | --erase:                   erase flash device\n"
+	     "   -V | --verbose:                 more verbose output\n"
+	     "   -c | --chip <chipname>:         probe only for specified flash chip\n"
+	     "   -s | --estart <addr>:           exclude start position\n"
+	     "   -e | --eend <addr>:             exclude end postion\n"
+	     "   -m | --mainboard <vendor:part>: override mainboard settings\n"
+	     "   -f | --force:                   force write without checking image\n"
+	     "   -l | --layout <file.layout>:    read rom layout from file\n"
+	     "   -i | --image <name>:            only flash image name from flash layout\n"
+	     "\n" " If no file is specified, then all that happens\n"
+	     " is that flash info is dumped.\n\n");
 	exit(1);
 }
 
@@ -219,46 +217,42 @@
 	struct flashchip *flash;
 	int opt;
 	int option_index = 0;
-	int read_it = 0, 
-	    write_it = 0, 
-	    erase_it = 0, 
-	    verify_it = 0;
+	int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
 	int ret = 0;
 
-	static struct option long_options[]= {
-		{ "read", 0, 0, 'r' },
-		{ "write", 0, 0, 'w' },
-		{ "erase", 0, 0, 'E' },
-		{ "verify", 0, 0, 'v' },
-		{ "chip", 1, 0, 'c' },
-		{ "estart", 1, 0, 's' },
-		{ "eend", 1, 0, 'e' },
-		{ "mainboard", 1, 0, 'm' },
-		{ "verbose", 0, 0, 'V' },
-		{ "force", 0, 0, 'f' },
-		{ "layout", 1, 0, 'l' },
-		{ "image", 1, 0, 'i' },
-		{ "help", 0, 0, 'h' },
-		{ 0, 0, 0, 0 }
+	static struct option long_options[] = {
+		{"read", 0, 0, 'r'},
+		{"write", 0, 0, 'w'},
+		{"erase", 0, 0, 'E'},
+		{"verify", 0, 0, 'v'},
+		{"chip", 1, 0, 'c'},
+		{"estart", 1, 0, 's'},
+		{"eend", 1, 0, 'e'},
+		{"mainboard", 1, 0, 'm'},
+		{"verbose", 0, 0, 'V'},
+		{"force", 0, 0, 'f'},
+		{"layout", 1, 0, 'l'},
+		{"image", 1, 0, 'i'},
+		{"help", 0, 0, 'h'},
+		{0, 0, 0, 0}
 	};
-	
+
 	char *filename = NULL;
 
-
-        unsigned int exclude_start_position=0, exclude_end_position=0; // [x,y)
-	char *tempstr=NULL, *tempstr2=NULL;
+	unsigned int exclude_start_position = 0, exclude_end_position = 0;	// [x,y)
+	char *tempstr = NULL, *tempstr2 = NULL;
 
 	if (argc > 1) {
 		/* Yes, print them. */
 		int i;
-		printf_debug ("The arguments are:\n");
+		printf_debug("The arguments are:\n");
 		for (i = 1; i < argc; ++i)
-			printf_debug ("%s\n", argv[i]);
+			printf_debug("%s\n", argv[i]);
 	}
 
 	setbuf(stdout, NULL);
-	while ((opt = getopt_long(argc, argv, "rwvVEfc:s:e:m:l:i:h", long_options,
-					&option_index)) != EOF) {
+	while ((opt = getopt_long(argc, argv, "rwvVEfc:s:e:m:l:i:h",
+				  long_options, &option_index)) != EOF) {
 		switch (opt) {
 		case 'r':
 			read_it = 1;
@@ -280,34 +274,34 @@
 			break;
 		case 's':
 			tempstr = strdup(optarg);
-			sscanf(tempstr,"%x",&exclude_start_position);
+			sscanf(tempstr, "%x", &exclude_start_position);
 			break;
 		case 'e':
 			tempstr = strdup(optarg);
-			sscanf(tempstr,"%x",&exclude_end_position);
+			sscanf(tempstr, "%x", &exclude_end_position);
 			break;
 		case 'm':
 			tempstr = strdup(optarg);
 			strtok(tempstr, ":");
-			tempstr2=strtok(NULL, ":");
+			tempstr2 = strtok(NULL, ":");
 			if (tempstr2) {
-				lb_vendor=tempstr;
-				lb_part=tempstr2;
+				lb_vendor = tempstr;
+				lb_part = tempstr2;
 			} else {
 				printf("warning: ignored wrong format of"
-						" mainboard: %s\n", tempstr);
+				       " mainboard: %s\n", tempstr);
 			}
 			break;
 		case 'f':
-			force=1;
+			force = 1;
 			break;
 		case 'l':
-			tempstr=strdup(optarg);
+			tempstr = strdup(optarg);
 			if (read_romlayout(tempstr))
 				exit(1);
 			break;
 		case 'i':
-			tempstr=strdup(optarg);
+			tempstr = strdup(optarg);
 			find_romentry(tempstr);
 			break;
 		case 'h':
@@ -325,17 +319,18 @@
 	if (optind < argc)
 		filename = argv[optind++];
 
-        /* First get full io access */
+	/* First get full io access */
 #if defined (__sun) && (defined(__i386) || defined(__amd64))
-	if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0){
+	if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) {
 #else
 	if (iopl(3) != 0) {
 #endif
-		fprintf(stderr, "ERROR: iopl failed: \"%s\"\n", strerror(errno));
+		fprintf(stderr, "ERROR: iopl failed: \"%s\"\n",
+			strerror(errno));
 		exit(1);
 	}
 
-        /* Initialize PCI access for flash enables */
+	/* Initialize PCI access for flash enables */
 	pacc = pci_alloc();	/* Get the pci_access structure */
 	/* Set all options you want -- here we stick with the defaults */
 	pci_init(pacc);		/* Initialize the PCI library */
@@ -343,7 +338,8 @@
 
 	/* Open the memory device. A lot of functions need it */
 	if ((fd_mem = open(MEM_DEV, O_RDWR)) < 0) {
-		perror("Error: Can not access memory using " MEM_DEV ". You need to be root.");
+		perror("Error: Can not access memory using " MEM_DEV
+		       ". You need to be root.");
 		exit(1);
 	}
 
@@ -357,13 +353,13 @@
 	/* try to enable it. Failure IS an option, since not all motherboards
 	 * really need this to be done, etc., etc.
 	 */
-        ret = chipset_flash_enable();
-        if (ret == -2)
-                printf("WARNING: No chipset found. Flash detection "
-                       "will most likely fail.\n");
+	ret = chipset_flash_enable();
+	if (ret == -2) {
+		printf("WARNING: No chipset found. Flash detection "
+		       "will most likely fail.\n");
+	}
 
-        board_flash_enable(lb_vendor, lb_part);
-
+	board_flash_enable(lb_vendor, lb_part);
 
 	if ((flash = probe_flash(flashchips)) == NULL) {
 		printf("No EEPROM/flash device found.\n");
@@ -380,11 +376,11 @@
 
 	size = flash->total_size * 1024;
 	buf = (uint8_t *) calloc(size, sizeof(char));
-	
+
 	if (erase_it) {
 		printf("Erasing flash chip\n");
 		flash->erase(flash);
-		exit(0);		
+		exit(0);
 	} else if (read_it) {
 		if ((image = fopen(filename, "w")) == NULL) {
 			perror(filename);
@@ -392,13 +388,13 @@
 		}
 		printf("Reading Flash...");
 		if (flash->read == NULL)
-			memcpy(buf, (const char *) flash->virt_addr, size);
+			memcpy(buf, (const char *)flash->virt_addr, size);
 		else
 			flash->read(flash, buf);
 
 		if (exclude_end_position - exclude_start_position > 0)
-			memset(buf+exclude_start_position, 0,
-			       exclude_end_position-exclude_start_position);
+			memset(buf + exclude_start_position, 0,
+			       exclude_end_position - exclude_start_position);
 
 		fwrite(buf, sizeof(char), size, image);
 		fclose(image);
@@ -414,7 +410,7 @@
 			perror(filename);
 			exit(1);
 		}
-		if(image_stat.st_size!=flash->total_size*1024) {
+		if (image_stat.st_size != flash->total_size * 1024) {
 			fprintf(stderr, "Error: Image size doesnt match\n");
 			exit(1);
 		}
@@ -430,26 +426,26 @@
 	 * it to the rom layout feature below and drop exclude range
 	 * completely once all flash chips can do rom layouts. stepan
 	 */
-	
+
 	// ////////////////////////////////////////////////////////////
 	if (exclude_end_position - exclude_start_position > 0)
-		memcpy(buf+exclude_start_position,
-		       (const char *) flash->virt_addr+exclude_start_position, 
-		       exclude_end_position-exclude_start_position);
+		memcpy(buf + exclude_start_position,
+		       (const char *)flash->virt_addr + exclude_start_position,
+		       exclude_end_position - exclude_start_position);
 
-        exclude_start_page = exclude_start_position/flash->page_size;
-	if ((exclude_start_position%flash->page_size) != 0) {
+	exclude_start_page = exclude_start_position / flash->page_size;
+	if ((exclude_start_position % flash->page_size) != 0) {
 		exclude_start_page++;
 	}
-	exclude_end_page = exclude_end_position/flash->page_size;
+	exclude_end_page = exclude_end_position / flash->page_size;
 	// ////////////////////////////////////////////////////////////
 
 	// This should be moved into each flash part's code to do it 
 	// cleanly. This does the job.
-	handle_romentries(buf, (uint8_t *)flash->virt_addr);
-	 
+	handle_romentries(buf, (uint8_t *) flash->virt_addr);
+
 	// ////////////////////////////////////////////////////////////
-	
+
 	if (write_it)
 		ret |= flash->write(flash, buf);
 
diff --git a/jedec.c b/jedec.c
index 549f9aa..41fda42 100644
--- a/jedec.c
+++ b/jedec.c
@@ -39,23 +39,23 @@
 	uint8_t id1, id2;
 
 	/* Issue JEDEC Product ID Entry command */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x5555) = 0x90;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x90;
 	myusec_delay(10);
 
 	/* Read product ID */
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 	/* Issue JEDEC Product ID Exit command */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x5555) = 0xF0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xF0;
 	myusec_delay(10);
 
 	printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
@@ -68,18 +68,18 @@
 int erase_sector_jedec(volatile uint8_t *bios, unsigned int page)
 {
 	/*  Issue the Sector Erase command   */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x5555) = 0x80;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x80;
 	myusec_delay(10);
 
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + page)   = 0x30;
+	*(volatile uint8_t *)(bios + page) = 0x30;
 	myusec_delay(10);
 
 	/* wait for Toggle bit ready         */
@@ -91,18 +91,18 @@
 int erase_block_jedec(volatile uint8_t *bios, unsigned int block)
 {
 	/*  Issue the Sector Erase command   */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x5555) = 0x80;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x80;
 	myusec_delay(10);
 
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + block)  = 0x50;
+	*(volatile uint8_t *)(bios + block) = 0x50;
 	myusec_delay(10);
 
 	/* wait for Toggle bit ready         */
@@ -116,18 +116,18 @@
 	volatile uint8_t *bios = flash->virt_addr;
 
 	/*  Issue the JEDEC Chip Erase command   */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x5555) = 0x80;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x80;
 	myusec_delay(10);
 
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
 	myusec_delay(10);
-	*(volatile uint8_t *) (bios + 0x5555) = 0x10;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x10;
 	myusec_delay(10);
 
 	toggle_ready_jedec(bios);
@@ -144,14 +144,14 @@
 
 retry:
 	/* Issue JEDEC Data Unprotect comand */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0xA0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xA0;
 
 	/* transfer data from source to destination */
 	for (i = start_index; i < page_size; i++) {
 		/* If the data is 0xFF, don't program it */
-		if (*src != 0xFF ) 
+		if (*src != 0xFF)
 			*dst = *src;
 		dst++;
 		src++;
@@ -163,21 +163,21 @@
 	src = s;
 	ok = 1;
 	for (i = 0; i < page_size; i++) {
-		if ( *dst != *src ) 
-		{
+		if (*dst != *src) {
 			ok = 0;
 			break;
 		}
 		dst++;
 		src++;
 	}
-		
+
 	if (!ok && tried++ < MAX_REFLASH_TRIES) {
 		start_index = i;
- 		goto retry;
- 	}
+		goto retry;
+	}
 	if (!ok) {
-		fprintf( stderr, " page %d failed!\n", (unsigned int)(d-bios)/page_size );
+		fprintf(stderr, " page %d failed!\n",
+			(unsigned int)(d - bios) / page_size);
 	}
 	return (!ok);
 }
@@ -194,20 +194,20 @@
 
 retry:
 	/* Issue JEDEC Byte Program command */
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0xA0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xA0;
 
 	/* transfer data from source to destination */
 	*dst = *src;
 	toggle_ready_jedec(bios);
 
 	if (*dst != *src && tried++ < MAX_REFLASH_TRIES) {
- 		goto retry;
- 	}
+		goto retry;
+	}
 
 	if (tried >= MAX_REFLASH_TRIES)
-		ok=0;
+		ok = 0;
 
 	return (!ok);
 }
@@ -233,13 +233,13 @@
 	volatile uint8_t *bios = flash->virt_addr;
 
 	erase_chip_jedec(flash);
-        // dumb check if erase was successful.
-        for (i=0; i < total_size; i++) {
-                if (bios[i] != (uint8_t)0xff) {
-                        printf("ERASE FAILED\n");
-                        return -1;
-                }
-        }
+	// dumb check if erase was successful.
+	for (i = 0; i < total_size; i++) {
+		if (bios[i] != (uint8_t) 0xff) {
+			printf("ERASE FAILED\n");
+			return -1;
+		}
+	}
 
 	printf("Programming Page: ");
 	for (i = 0; i < total_size / page_size; i++) {
diff --git a/layout.c b/layout.c
index 8ba2e41..6dbbd9c 100644
--- a/layout.c
+++ b/layout.c
@@ -6,9 +6,9 @@
 #include "lbtable.h"
 #include "debug.h"
 
-char * mainboard_vendor=NULL;
-char * mainboard_part=NULL;
-int romimages=0;
+char *mainboard_vendor = NULL;
+char *mainboard_part = NULL;
+int romimages = 0;
 
 extern int force;
 
@@ -25,131 +25,132 @@
 
 static char *def_name = "DEFAULT";
 
-
 int show_id(uint8_t *bios, int size)
 {
 	unsigned int *walk;
 
+	walk = (unsigned int *)(bios + size - 0x10);
+	walk--;
 
-	walk=(unsigned int *)(bios+size-0x10);
-	walk--; 
-	
-	if((*walk)==0 || ((*walk)&0x3ff) != 0) {
+	if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) {
 		/* We might have an Nvidia chipset bios 
 		 * which stores the id information at a 
 		 * different location.
 		 */
-		walk=(unsigned int *)(bios+size-0x80);
-		walk--; 
+		walk = (unsigned int *)(bios + size - 0x80);
+		walk--;
 	}
-	
-	if((*walk)==0 || ((*walk)&0x3ff) != 0) {
+
+	if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) {
 		printf("Flash image seems to be a legacy BIOS. Disabling checks.\n");
-		mainboard_vendor=def_name;
-		mainboard_part=def_name;
+		mainboard_vendor = def_name;
+		mainboard_part = def_name;
 		return 0;
 	}
-	
+
 	printf_debug("LinuxBIOS last image size "
 		     "(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));
+
+	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);
-	
 
 	/*
 	 * If lb_vendor is not set, the linuxbios table was
 	 * not found. Nor was -mVENDOR:PART specified
 	 */
 
-	if(!lb_vendor || !lb_part) {
+	if (!lb_vendor || !lb_part) {
 		printf("Note: If the following flash access fails, "
-		"you might need to specify -m <vendor>:<mainboard>\n");
+		       "you might need to specify -m <vendor>:<mainboard>\n");
 		return 0;
 	}
-	
+
 	/* These comparisons are case insensitive to make things
 	 * a little less user^Werror prone. 
 	 */
 
-	if(!strcasecmp(mainboard_vendor, lb_vendor) && 
-	   !strcasecmp(mainboard_part, lb_part)) {
+	if (!strcasecmp(mainboard_vendor, lb_vendor) &&
+	    !strcasecmp(mainboard_part, lb_part)) {
 		printf_debug("This firmware image matches "
 			     "this motherboard.\n");
 	} else {
-		if(force) {
+		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",
-			mainboard_vendor, mainboard_part, lb_vendor, lb_part);
+			       "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",
+			       mainboard_vendor, mainboard_part, lb_vendor,
+			       lb_part);
 			exit(1);
 		}
 	}
-			
+
 	return 0;
 }
 
-int read_romlayout(char *name) 
+int read_romlayout(char *name)
 {
 	FILE *romlayout;
 	char tempstr[256];
 	int i;
 
-	romlayout=fopen (name, "r");
-	
-	if(!romlayout) {
-		fprintf(stderr, "ERROR: Could not open rom layout (%s).\n", 
-				name);
+	romlayout = fopen(name, "r");
+
+	if (!romlayout) {
+		fprintf(stderr, "ERROR: Could not open rom layout (%s).\n",
+			name);
 		return -1;
 	}
-	
-	while(!feof(romlayout)) {
+
+	while (!feof(romlayout)) {
 		char *tstr1, *tstr2;
-		fscanf(romlayout,"%s %s\n", tempstr, rom_entries[romimages].name);
+		fscanf(romlayout, "%s %s\n", tempstr,
+		       rom_entries[romimages].name);
 #if 0
 		// fscanf does not like arbitrary comments like that :( later
-		if (tempstr[0]=='#') {
+		if (tempstr[0] == '#') {
 			continue;
 		}
 #endif
-		tstr1=strtok(tempstr,":");
-		tstr2=strtok(NULL,":");
-		rom_entries[romimages].start=strtol(tstr1, (char **)NULL, 16);
-		rom_entries[romimages].end=strtol(tstr2, (char **)NULL, 16);
-		rom_entries[romimages].included=0;
+		tstr1 = strtok(tempstr, ":");
+		tstr2 = strtok(NULL, ":");
+		rom_entries[romimages].start = strtol(tstr1, (char **)NULL, 16);
+		rom_entries[romimages].end = strtol(tstr2, (char **)NULL, 16);
+		rom_entries[romimages].included = 0;
 		romimages++;
 	}
-	
-	for(i=0; i<romimages; i++) {
-		printf_debug("romlayout %08x - %08x named %s\n", 
-			rom_entries[i].start,
-			rom_entries[i].end,
-			rom_entries[i].name);
+
+	for (i = 0; i < romimages; i++) {
+		printf_debug("romlayout %08x - %08x named %s\n",
+			     rom_entries[i].start,
+			     rom_entries[i].end, rom_entries[i].name);
 	}
 
 	fclose(romlayout);
-	return 0;	
+	return 0;
 }
 
 int find_romentry(char *name)
 {
 	int i;
 
-	if(!romimages) return -1;
+	if (!romimages)
+		return -1;
 
 	printf("Looking for \"%s\"... ", name);
-	
-	for (i=0; i<romimages; i++) {
-		if(!strcmp(rom_entries[i].name, name)) {
-			rom_entries[i].included=1;
+
+	for (i = 0; i < romimages; i++) {
+		if (!strcmp(rom_entries[i].name, name)) {
+			rom_entries[i].included = 1;
 			printf("found.\n");
 			return i;
 		}
@@ -178,15 +179,14 @@
 	// flash. Same thing if you specify -i normal -i all only 
 	// normal will be updated and the rest will be kept.
 
-	
-	for (i=0; i<romimages; i++) {
-		
-		if (rom_entries[i].included) 
+	for (i = 0; i < romimages; i++) {
+
+		if (rom_entries[i].included)
 			continue;
-		
-		memcpy (buffer+rom_entries[i].start,
-			content+rom_entries[i].start,
-			rom_entries[i].end-rom_entries[i].start);
+
+		memcpy(buffer + rom_entries[i].start,
+		       content + rom_entries[i].start,
+		       rom_entries[i].end - rom_entries[i].start);
 	}
 
 	return 0;
diff --git a/lbtable.c b/lbtable.c
index 4409e51..d65d1a0 100644
--- a/lbtable.c
+++ b/lbtable.c
@@ -11,13 +11,13 @@
 #include "linuxbios_tables.h"
 #include "debug.h"
 
-char *lb_part=NULL, *lb_vendor=NULL;
+char *lb_part = NULL, *lb_vendor = NULL;
 
 static unsigned long compute_checksum(void *addr, unsigned long length)
 {
 	uint8_t *ptr;
 	volatile union {
-		uint8_t  byte[2];
+		uint8_t byte[2];
 		uint16_t word;
 	} value;
 	unsigned long sum;
@@ -27,7 +27,7 @@
 	 */
 	sum = 0;
 	ptr = addr;
-	for(i = 0; i < length; i++) {
+	for (i = 0; i < length; i++) {
 		unsigned long value;
 		value = ptr[i];
 		if (i & 1) {
@@ -50,10 +50,9 @@
 		(((char *)rec) < (((char *)head) + sizeof(*head) + head->table_bytes))  && \
 		(rec->size >= 1) && \
 		((((char *)rec) + rec->size) <= (((char *)head) + sizeof(*head) + head->table_bytes)); \
-		rec = (struct lb_record *)(((char *)rec) + rec->size)) 
-		
+		rec = (struct lb_record *)(((char *)rec) + rec->size))
 
-static int  count_lb_records(struct lb_header *head)
+static int count_lb_records(struct lb_header *head)
 {
 	struct lb_record *rec;
 	int count;
@@ -64,18 +63,20 @@
 	return count;
 }
 
-
-static struct lb_header *find_lb_table(void *base, unsigned long start, unsigned long end)
+static struct lb_header *find_lb_table(void *base, unsigned long start,
+				       unsigned long end)
 {
 	unsigned long addr;
 	/* For now be stupid.... */
-	for(addr = start; addr < end; addr += 16) {
-		struct lb_header *head = (struct lb_header *)(((char*)base) + addr);
-		struct lb_record *recs = (struct lb_record *)(((char*)base) + addr + sizeof(*head));
+	for (addr = start; addr < end; addr += 16) {
+		struct lb_header *head =
+		    (struct lb_header *)(((char *)base) + addr);
+		struct lb_record *recs =
+		    (struct lb_record *)(((char *)base) + addr + sizeof(*head));
 		if (memcmp(head->signature, "LBIO", 4) != 0)
 			continue;
-		printf_debug( "Found canidate at: %08lx-%08lx\n", 
-			addr, addr + head->table_bytes);
+		printf_debug("Found canidate at: %08lx-%08lx\n",
+			     addr, addr + head->table_bytes);
 		if (head->header_bytes != sizeof(*head)) {
 			fprintf(stderr, "Header bytes of %d are incorrect\n",
 				head->header_bytes);
@@ -86,12 +87,12 @@
 				head->table_entries);
 			continue;
 		}
-		if (compute_checksum((uint8_t *)head, sizeof(*head)) != 0) {
+		if (compute_checksum((uint8_t *) head, sizeof(*head)) != 0) {
 			fprintf(stderr, "bad header checksum\n");
 			continue;
 		}
 		if (compute_checksum(recs, head->table_bytes)
-			!= head->table_checksum) {
+		    != head->table_checksum) {
 			fprintf(stderr, "bad table checksum: %04x\n",
 				head->table_checksum);
 			continue;
@@ -111,21 +112,20 @@
 	rec = (struct lb_mainboard *)ptr;
 	max_size = rec->size - sizeof(*rec);
 	printf("vendor id: %.*s part id: %.*s\n",
-		max_size - rec->vendor_idx, 
-		rec->strings + rec->vendor_idx, 
-		max_size - rec->part_number_idx, 
-		rec->strings + rec->part_number_idx);
-	snprintf(vendor, 255, "%.*s", max_size - rec->vendor_idx, 
-			rec->strings + rec->vendor_idx);
+	       max_size - rec->vendor_idx,
+	       rec->strings + rec->vendor_idx,
+	       max_size - rec->part_number_idx,
+	       rec->strings + rec->part_number_idx);
+	snprintf(vendor, 255, "%.*s", max_size - rec->vendor_idx,
+		 rec->strings + rec->vendor_idx);
 	snprintf(part, 255, "%.*s", max_size - rec->part_number_idx,
-			rec->strings + rec->part_number_idx);
+		 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);
+	if (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);
+		lb_part = strdup(part);
+		lb_vendor = strdup(vendor);
 	}
 }
 
@@ -134,33 +134,35 @@
 	return (struct lb_record *)(((char *)rec) + rec->size);
 }
 
-static void search_lb_records(struct lb_record *rec, struct lb_record *last, 
-	unsigned long addr)
+static void search_lb_records(struct lb_record *rec, struct lb_record *last,
+			      unsigned long addr)
 {
 	struct lb_record *next;
 	int count;
 	count = 0;
 
-	for(next = next_record(rec); (rec < last) && (next <= last); 
-		rec = next, addr += rec->size) { 
+	for (next = next_record(rec); (rec < last) && (next <= last);
+	     rec = next, addr += rec->size) {
 		next = next_record(rec);
 		count++;
-		if(rec->tag == LB_TAG_MAINBOARD) {
-			find_mainboard(rec,addr);
+		if (rec->tag == LB_TAG_MAINBOARD) {
+			find_mainboard(rec, addr);
 			break;
 		}
 	}
 }
 
-int linuxbios_init(void) 
+int linuxbios_init(void)
 {
 	uint8_t *low_1MB;
 	struct lb_header *lb_table;
 	struct lb_record *rec, *last;
-	
-	low_1MB = mmap(0, 1024*1024, PROT_READ, MAP_SHARED, fd_mem, 0x00000000);
+
+	low_1MB = mmap(0, 1024 * 1024, PROT_READ, MAP_SHARED, fd_mem,
+		       0x00000000);
 	if (low_1MB == MAP_FAILED) {
-		fprintf(stderr, "Can not mmap " MEM_DEV " at %08lx errno(%d):%s\n",
+		fprintf(stderr,
+			"Can not mmap " MEM_DEV " at %08lx errno(%d):%s\n",
 			0x00000000UL, errno, strerror(errno));
 		exit(-2);
 	}
@@ -168,19 +170,19 @@
 	if (!lb_table)
 		lb_table = find_lb_table(low_1MB, 0x00000, 0x1000);
 	if (!lb_table)
-		lb_table = find_lb_table(low_1MB, 0xf0000, 1024*1024);
+		lb_table = find_lb_table(low_1MB, 0xf0000, 1024 * 1024);
 	if (lb_table) {
 		unsigned long addr;
 		addr = ((char *)lb_table) - ((char *)low_1MB);
 		printf_debug("lb_table found at address %p\n", lb_table);
-		rec  = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes);
+		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",
-		lb_table->header_bytes, lb_table->header_checksum,
-		lb_table->table_bytes, lb_table->table_checksum, lb_table->table_entries);
+		     lb_table->header_bytes, lb_table->header_checksum,
+		     lb_table->table_bytes, lb_table->table_checksum,
+		     lb_table->table_entries);
 		search_lb_records(rec, last, addr + lb_table->header_bytes);
-	}
-	else {
+	} else {
 		printf("No LinuxBIOS table found.\n");
 		return -1;
 	}
diff --git a/linuxbios_tables.h b/linuxbios_tables.h
index 527c44d..08fbff2 100644
--- a/linuxbios_tables.h
+++ b/linuxbios_tables.h
@@ -50,25 +50,22 @@
 
 static inline uint64_t unpack_lb64(struct lb_uint64 value)
 {
-        uint64_t result;
-        result = value.hi;
-        result = (result << 32) + value.lo;
-        return result;
+	uint64_t result;
+	result = value.hi;
+	result = (result << 32) + value.lo;
+	return result;
 }
 
 static inline struct lb_uint64 pack_lb64(uint64_t value)
 {
-        struct lb_uint64 result;
-        result.lo = (value >> 0) & 0xffffffff;
-        result.hi = (value >> 32) & 0xffffffff;
-        return result;
+	struct lb_uint64 result;
+	result.lo = (value >> 0) & 0xffffffff;
+	result.hi = (value >> 32) & 0xffffffff;
+	return result;
 }
 
-
-
-struct lb_header
-{
-	uint8_t  signature[4]; /* LBIO */
+struct lb_header {
+	uint8_t signature[4];	/* LBIO */
 	uint32_t header_bytes;
 	uint32_t header_checksum;
 	uint32_t table_bytes;
@@ -117,9 +114,9 @@
 struct lb_mainboard {
 	uint32_t tag;
 	uint32_t size;
-	uint8_t  vendor_idx;
-	uint8_t  part_number_idx;
-	uint8_t  strings[0];
+	uint8_t vendor_idx;
+	uint8_t part_number_idx;
+	uint8_t strings[0];
 };
 
 #define LB_TAG_VERSION		0x0004
@@ -135,16 +132,16 @@
 struct lb_string {
 	uint32_t tag;
 	uint32_t size;
-	uint8_t  string[0];
+	uint8_t string[0];
 };
 
 /* The following structures are for the cmos definitions table */
 #define LB_TAG_CMOS_OPTION_TABLE 200
 /* cmos header record */
 struct cmos_option_table {
-	uint32_t tag;               /* CMOS definitions table type */
-	uint32_t size;               /* size of the entire table */
-	uint32_t header_length;      /* length of header */
+	uint32_t tag;		/* CMOS definitions table type */
+	uint32_t size;		/* size of the entire table */
+	uint32_t header_length;	/* length of header */
 };
 
 /* cmos entry record
@@ -156,31 +153,30 @@
 */
 #define LB_TAG_OPTION 201
 struct cmos_entries {
-	uint32_t tag;                /* entry type */
-	uint32_t size;               /* length of this record */
-	uint32_t bit;                /* starting bit from start of image */
-	uint32_t length;             /* length of field in bits */
-	uint32_t config;             /* e=enumeration, h=hex, r=reserved */
-	uint32_t config_id;          /* a number linking to an enumeration record */
+	uint32_t tag;		/* entry type */
+	uint32_t size;		/* length of this record */
+	uint32_t bit;		/* starting bit from start of image */
+	uint32_t length;	/* length of field in bits */
+	uint32_t config;	/* e=enumeration, h=hex, r=reserved */
+	uint32_t config_id;	/* a number linking to an enumeration record */
 #define CMOS_MAX_NAME_LENGTH 32
-	uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii, 
-					       variable length int aligned */
+	uint8_t name[CMOS_MAX_NAME_LENGTH];	/* name of entry in ascii, 
+						   variable length int aligned */
 };
 
-
 /* cmos enumerations record
         This record is variable length.  The text field may be
         shorter than CMOS_MAX_TEXT_LENGTH.
 */
 #define LB_TAG_OPTION_ENUM 202
 struct cmos_enums {
-	uint32_t tag;		     /* enumeration type */
-	uint32_t size; 		     /* length of this record */
-	uint32_t config_id;          /* a number identifying the config id */
-	uint32_t value;              /* the value associated with the text */
+	uint32_t tag;		/* enumeration type */
+	uint32_t size;		/* length of this record */
+	uint32_t config_id;	/* a number identifying the config id */
+	uint32_t value;		/* the value associated with the text */
 #define CMOS_MAX_TEXT_LENGTH 32
-	uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii, 
-						variable length int aligned */
+	uint8_t text[CMOS_MAX_TEXT_LENGTH];	/* enum description in ascii, 
+						   variable length int aligned */
 };
 
 /* cmos defaults record
@@ -188,16 +184,16 @@
 */
 #define LB_TAG_OPTION_DEFAULTS 203
 struct cmos_defaults {
-	uint32_t tag;                /* default type */
-	uint32_t size;               /* length of this record */
-	uint32_t name_length;        /* length of the following name field */
-	uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name identifying the default */
+	uint32_t tag;		/* default type */
+	uint32_t size;		/* length of this record */
+	uint32_t name_length;	/* length of the following name field */
+	uint8_t name[CMOS_MAX_NAME_LENGTH];	/* name identifying the default */
 #define CMOS_IMAGE_BUFFER_SIZE 128
-	uint8_t default_set[CMOS_IMAGE_BUFFER_SIZE]; /* default settings */
+	uint8_t default_set[CMOS_IMAGE_BUFFER_SIZE];	/* default settings */
 };
 
 #define LB_TAG_OPTION_CHECKSUM 204
-struct	cmos_checksum {
+struct cmos_checksum {
 	uint32_t tag;
 	uint32_t size;
 	/* In practice everything is byte aligned, but things are measured
@@ -211,6 +207,4 @@
 #define CHECKSUM_PCBIOS	1
 };
 
-
-
-#endif /* LINUXBIOS_TABLES_H */
+#endif				/* LINUXBIOS_TABLES_H */
diff --git a/m29f400bt.c b/m29f400bt.c
index a043a7c..26809d1 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -32,24 +32,23 @@
 	volatile uint8_t *bios = flash->virt_addr;
 	uint8_t id1, id2;
 
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
-	*(volatile uint8_t *) (bios + 0xAAA) = 0x90;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0x90;
 
 	myusec_delay(10);
 
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x02);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x02);
 
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xF0;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xF0;
 
 	myusec_delay(10);
 
 	printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
 
-
 	if (id1 == flash->manufacture_id && id2 == flash->model_id)
 		return 1;
 
@@ -60,13 +59,13 @@
 {
 	volatile uint8_t *bios = flash->virt_addr;
 
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
-	*(volatile uint8_t *) (bios + 0xAAA) = 0x80;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0x80;
 
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
-	*(volatile uint8_t *) (bios + 0xAAA) = 0x10;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0x10;
 
 	myusec_delay(10);
 	toggle_ready_m29f400bt(bios);
@@ -77,12 +76,12 @@
 int block_erase_m29f400bt(volatile uint8_t *bios, volatile uint8_t *dst)
 {
 
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
-	*(volatile uint8_t *) (bios + 0xAAA) = 0x80;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0x80;
 
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
 	//*(volatile uint8_t *) (bios + 0xAAA) = 0x10;
 	*dst = 0x30;
 
@@ -95,8 +94,8 @@
 int write_m29f400bt(struct flashchip *flash, uint8_t *buf)
 {
 	int i;
-	int total_size = flash->total_size * 1024, page_size =
-	    flash->page_size;
+	int total_size = flash->total_size * 1024;
+	int page_size = flash->page_size;
 	volatile uint8_t *bios = flash->virt_addr;
 
 	//erase_m29f400bt (flash);
@@ -122,29 +121,24 @@
 		block_erase_m29f400bt(bios, bios + i * page_size);
 		write_page_m29f400bt(bios, buf + i * page_size,
 				     bios + i * page_size, page_size);
-		printf
-		    ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
+		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
 
 	printf("%04d at address: 0x%08x\n", 7, 0x70000);
 	block_erase_m29f400bt(bios, bios + 0x70000);
-	write_page_m29f400bt(bios, buf + 0x70000, bios + 0x70000,
-			     32 * 1024);
+	write_page_m29f400bt(bios, buf + 0x70000, bios + 0x70000, 32 * 1024);
 
 	printf("%04d at address: 0x%08x\n", 8, 0x78000);
 	block_erase_m29f400bt(bios, bios + 0x78000);
-	write_page_m29f400bt(bios, buf + 0x78000, bios + 0x78000,
-			     8 * 1024);
+	write_page_m29f400bt(bios, buf + 0x78000, bios + 0x78000, 8 * 1024);
 
 	printf("%04d at address: 0x%08x\n", 9, 0x7a000);
 	block_erase_m29f400bt(bios, bios + 0x7a000);
-	write_page_m29f400bt(bios, buf + 0x7a000, bios + 0x7a000,
-			     8 * 1024);
+	write_page_m29f400bt(bios, buf + 0x7a000, bios + 0x7a000, 8 * 1024);
 
 	printf("%04d at address: 0x%08x\n", 10, 0x7c000);
 	block_erase_m29f400bt(bios, bios + 0x7c000);
-	write_page_m29f400bt(bios, buf + 0x7c000, bios + 0x7c000,
-			     16 * 1024);
+	write_page_m29f400bt(bios, buf + 0x7c000, bios + 0x7c000, 16 * 1024);
 
 	printf("\n");
 	//protect_m29f400bt (bios);
@@ -174,23 +168,19 @@
 	*********************************/
 	printf("%04d at address: 0x%08x\n", 7, 0x00000);
 	block_erase_m29f400bt(bios, bios + 0x00000);
-	write_page_m29f400bt(bios, buf + 0x00000, bios + 0x00000,
-			     64 * 1024);
+	write_page_m29f400bt(bios, buf + 0x00000, bios + 0x00000, 64 * 1024);
 
 	printf("%04d at address: 0x%08x\n", 7, 0x10000);
 	block_erase_m29f400bt(bios, bios + 0x10000);
-	write_page_m29f400bt(bios, buf + 0x10000, bios + 0x10000,
-			     64 * 1024);
+	write_page_m29f400bt(bios, buf + 0x10000, bios + 0x10000, 64 * 1024);
 
 	printf("%04d at address: 0x%08x\n", 7, 0x20000);
 	block_erase_m29f400bt(bios, bios + 0x20000);
-	write_page_m29f400bt(bios, buf + 0x20000, bios + 0x20000,
-			     64 * 1024);
+	write_page_m29f400bt(bios, buf + 0x20000, bios + 0x20000, 64 * 1024);
 
 	printf("%04d at address: 0x%08x\n", 7, 0x30000);
 	block_erase_m29f400bt(bios, bios + 0x30000);
-	write_page_m29f400bt(bios, buf + 0x30000, bios + 0x30000,
-			     64 * 1024);
+	write_page_m29f400bt(bios, buf + 0x30000, bios + 0x30000, 64 * 1024);
 
 	printf("\n");
 	//protect_m29f400bt (bios);
diff --git a/m29f400bt.h b/m29f400bt.h
index 30a7ee8..965f731 100644
--- a/m29f400bt.h
+++ b/m29f400bt.h
@@ -5,10 +5,10 @@
 
 extern int probe_m29f400bt(struct flashchip *flash);
 extern int erase_m29f400bt(struct flashchip *flash);
-extern int block_erase_m29f400bt(volatile uint8_t *bios, volatile uint8_t *dst);
+extern int block_erase_m29f400bt(volatile uint8_t *bios,
+				 volatile uint8_t *dst);
 extern int write_m29f400bt(struct flashchip *flash, uint8_t *buf);
-extern int write_linuxbios_m29f400bt(struct flashchip *flash,
-				     uint8_t *buf);
+extern int write_linuxbios_m29f400bt(struct flashchip *flash, uint8_t *buf);
 
 extern __inline__ void toggle_ready_m29f400bt(volatile uint8_t *dst)
 {
@@ -44,23 +44,24 @@
 
 extern __inline__ void protect_m29f400bt(volatile uint8_t *bios)
 {
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x555) = 0x55;
-	*(volatile uint8_t *) (bios + 0xAAA) = 0xA0;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x555) = 0x55;
+	*(volatile uint8_t *)(bios + 0xAAA) = 0xA0;
 
 	usleep(200);
 }
 
-extern __inline__ void write_page_m29f400bt(volatile uint8_t *bios, uint8_t *src,
+extern __inline__ void write_page_m29f400bt(volatile uint8_t *bios,
+					    uint8_t *src,
 					    volatile uint8_t *dst,
 					    int page_size)
 {
 	int i;
 
 	for (i = 0; i < page_size; i++) {
-		*(volatile uint8_t *) (bios + 0xAAA) = 0xAA;
-		*(volatile uint8_t *) (bios + 0x555) = 0x55;
-		*(volatile uint8_t *) (bios + 0xAAA) = 0xA0;
+		*(volatile uint8_t *)(bios + 0xAAA) = 0xAA;
+		*(volatile uint8_t *)(bios + 0x555) = 0x55;
+		*(volatile uint8_t *)(bios + 0xAAA) = 0xA0;
 
 		/* transfer data from source to destination */
 		*dst = *src;
diff --git a/msys_doc.c b/msys_doc.c
index c9f4b4f..04c5604 100644
--- a/msys_doc.c
+++ b/msys_doc.c
@@ -19,27 +19,18 @@
  *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-
-
 #include <stdio.h>
 #include <unistd.h>
 #include "flash.h"
 #include "msys_doc.h"
 #include "debug.h"
 
-
-
-
 static int doc_wait(volatile uint8_t *bios, int timeout);
 static uint8_t doc_read_chipid(volatile uint8_t *bios);
 static uint8_t doc_read_docstatus(volatile uint8_t *bios);
 static uint8_t doc_read_cdsncontrol(volatile uint8_t *bios);
 static void doc_write_cdsncontrol(volatile uint8_t *bios, uint8_t data);
 
-
-
-
-
 int probe_md2802(struct flashchip *flash)
 {
 	volatile uint8_t *bios = flash->virt_addr;
@@ -72,11 +63,9 @@
 
 	printf("%s: switching off write protection ...\n", __FUNCTION__);
 	doc_write_cdsncontrol(bios, doc_read_cdsncontrol(bios) & (~0x08));
-	printf("%s: switching off write protection ... done\n",
-	       __FUNCTION__);
+	printf("%s: switching off write protection ... done\n", __FUNCTION__);
 	printf("%s:\n", __FUNCTION__);
 
-
 	chipid = doc_read_chipid(bios);
 #ifndef MSYSTEMS_DOC_NO_55AA_CHECKING
 	id_0x55 = doc_read(bios, IPL_0x0000);
@@ -140,9 +129,8 @@
 	printf("\n%s: toggle result: %d/%d\n", __FUNCTION__, toggle_a,
 	       toggle_b);
 
-	if (chipid == flash->model_id
-	    && ((toggle_a == 5 && toggle_b == 0)
-		|| (toggle_a == 0 && toggle_b == 5))
+	if (chipid == flash->model_id && ((toggle_a == 5 && toggle_b == 0)
+					  || (toggle_a == 0 && toggle_b == 5))
 #ifndef MSYSTEMS_DOC_NO_55AA_CHECKING
 	    && id_0x55 == 0x55 && id_0xAA == 0xaa
 #endif				/* !MSYSTEMS_DOC_NO_55AA_CHECKING */
@@ -153,37 +141,31 @@
 	return (0);
 }				/* int probe_md2802(struct flashchip *flash) */
 
-
-
 int read_md2802(struct flashchip *flash, uint8_t *buf)
 {
 
 	return (0);
 }				/* int read_md2802(struct flashchip *flash, uint8_t *buf) */
 
-
-
 int erase_md2802(struct flashchip *flash)
 {
 	volatile uint8_t *bios = flash->virt_addr;
 
 	return (1);
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0x80;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x80;
 
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0x10;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x10;
 }				/* int erase_md2802(struct flashchip *flash) */
 
-
-
 int write_md2802(struct flashchip *flash, uint8_t *buf)
 {
 	int i;
-	int total_size = flash->total_size * 1024, page_size =
-	    flash->page_size;
+	int total_size = flash->total_size * 1024;
+	int page_size = flash->page_size;
 	volatile uint8_t *bios = flash->virt_addr;
 
 	return (1);
@@ -205,11 +187,6 @@
 	return 0;
 }				/* int write_md2802(struct flashchip *flash, uint8_t *buf) */
 
-
-
-
-
-
 /*
 	wait timeout msec for doc to become ready
 	return:
@@ -237,8 +214,6 @@
 	return (0);
 }				/* static int doc_wait(volatile uint8_t *bios, int timeout) */
 
-
-
 static uint8_t doc_read_docstatus(volatile uint8_t *bios)
 {
 	doc_read(bios, CDSNSlowIO);
@@ -247,8 +222,6 @@
 	return (doc_read(bios, _DOCStatus));
 }				/* static uint8_t doc_read_docstatus(volatile uint8_t *bios) */
 
-
-
 static uint8_t doc_read_chipid(volatile uint8_t *bios)
 {
 	doc_read(bios, CDSNSlowIO);
@@ -257,8 +230,6 @@
 	return (doc_read(bios, _ChipID));
 }				/* static uint8_t doc_read_chipid(volatile uint8_t *bios) */
 
-
-
 static uint8_t doc_read_cdsncontrol(volatile uint8_t *bios)
 {
 	uint8_t value;
@@ -273,8 +244,6 @@
 	return (value);
 }				/* static uint8_t doc_read_chipid(volatile char *bios) */
 
-
-
 static void doc_write_cdsncontrol(volatile uint8_t *bios, uint8_t data)
 {
 	doc_write(data, bios, _CDSNControl);
diff --git a/sharplhf00l04.c b/sharplhf00l04.c
index fc41fbf..5be1cbc 100644
--- a/sharplhf00l04.c
+++ b/sharplhf00l04.c
@@ -51,9 +51,9 @@
 	uint8_t id1, id2;
 
 #if 0
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0x90;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0x90;
 #endif
 
 	*bios = 0xff;
@@ -61,13 +61,13 @@
 	*bios = 0x90;
 	myusec_delay(10);
 
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 #if 1
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0xF0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xF0;
 
 #endif
 	myusec_delay(10);
@@ -86,7 +86,8 @@
 		}
 
 		flash->virt_addr_2 = bios;
-		printf("bios %p, *bios 0x%x, bios[1] 0x%x\n", bios, *bios, bios[1]);
+		printf("bios %p, *bios 0x%x, bios[1] 0x%x\n", bios, *bios,
+		       bios[1]);
 		return 1;
 	}
 
@@ -101,7 +102,7 @@
 
 	*bios = 0x70;
 	if ((*bios & 0x80) == 0) {	// it's busy
-		while ((*bios & 0x80) == 0);
+		while ((*bios & 0x80) == 0) ;
 	}
 
 	status = *bios;
@@ -111,21 +112,20 @@
 	*bios = 0x90;
 	myusec_delay(10);
 
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 	// this is needed to jam it out of "read id" mode
-	*(volatile uint8_t *) (bios + 0x5555) = 0xAA;
-	*(volatile uint8_t *) (bios + 0x2AAA) = 0x55;
-	*(volatile uint8_t *) (bios + 0x5555) = 0xF0;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xAA;
+	*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
+	*(volatile uint8_t *)(bios + 0x5555) = 0xF0;
 	return status;
 
 }
 int erase_lhf00l04_block(struct flashchip *flash, int offset)
 {
 	volatile uint8_t *bios = flash->virt_addr + offset;
-	volatile uint8_t *wrprotect =
-	    flash->virt_addr_2 + offset + 2;
+	volatile uint8_t *wrprotect = flash->virt_addr_2 + offset + 2;
 	uint8_t status;
 
 	// clear status register
@@ -140,8 +140,8 @@
 	printf("write protect is 0x%x\n", *(wrprotect));
 
 	// now start it
-	*(volatile uint8_t *) (bios) = 0x20;
-	*(volatile uint8_t *) (bios) = 0xd0;
+	*(volatile uint8_t *)(bios) = 0x20;
+	*(volatile uint8_t *)(bios) = 0xd0;
 	myusec_delay(10);
 	// now let's see what the register is
 	status = wait_lhf00l04(flash->virt_addr);
@@ -162,8 +162,8 @@
 	return (0);
 }
 
-void write_page_lhf00l04(volatile uint8_t *bios, uint8_t *src, volatile uint8_t *dst,
-			int page_size)
+void write_page_lhf00l04(volatile uint8_t *bios, uint8_t *src,
+			 volatile uint8_t *dst, int page_size)
 {
 	int i;
 
@@ -179,8 +179,8 @@
 int write_lhf00l04(struct flashchip *flash, uint8_t *buf)
 {
 	int i;
-	int total_size = flash->total_size * 1024, page_size =
-	    flash->page_size;
+	int total_size = flash->total_size * 1024;
+	int page_size = flash->page_size;
 	volatile uint8_t *bios = flash->virt_addr;
 
 	erase_lhf00l04(flash);
@@ -192,9 +192,8 @@
 	for (i = 0; i < total_size / page_size; i++) {
 		printf("%04d at address: 0x%08x", i, i * page_size);
 		write_page_lhf00l04(bios, buf + i * page_size,
-				   bios + i * page_size, page_size);
-		printf
-		    ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
+				    bios + i * page_size, page_size);
+		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
 	printf("\n");
 	protect_lhf00l04(bios);
diff --git a/sst28sf040.c b/sst28sf040.c
index 3de991d..7b3db15 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -43,13 +43,13 @@
 	/* ask compiler not to optimize this */
 	volatile uint8_t tmp;
 
-	tmp = *(volatile uint8_t *) (bios + 0x1823);
-	tmp = *(volatile uint8_t *) (bios + 0x1820);
-	tmp = *(volatile uint8_t *) (bios + 0x1822);
-	tmp = *(volatile uint8_t *) (bios + 0x0418);
-	tmp = *(volatile uint8_t *) (bios + 0x041B);
-	tmp = *(volatile uint8_t *) (bios + 0x0419);
-	tmp = *(volatile uint8_t *) (bios + 0x040A);
+	tmp = *(volatile uint8_t *)(bios + 0x1823);
+	tmp = *(volatile uint8_t *)(bios + 0x1820);
+	tmp = *(volatile uint8_t *)(bios + 0x1822);
+	tmp = *(volatile uint8_t *)(bios + 0x0418);
+	tmp = *(volatile uint8_t *)(bios + 0x041B);
+	tmp = *(volatile uint8_t *)(bios + 0x0419);
+	tmp = *(volatile uint8_t *)(bios + 0x040A);
 }
 
 static __inline__ void unprotect_28sf040(volatile uint8_t *bios)
@@ -57,13 +57,13 @@
 	/* ask compiler not to optimize this */
 	volatile uint8_t tmp;
 
-	tmp = *(volatile uint8_t *) (bios + 0x1823);
-	tmp = *(volatile uint8_t *) (bios + 0x1820);
-	tmp = *(volatile uint8_t *) (bios + 0x1822);
-	tmp = *(volatile uint8_t *) (bios + 0x0418);
-	tmp = *(volatile uint8_t *) (bios + 0x041B);
-	tmp = *(volatile uint8_t *) (bios + 0x0419);
-	tmp = *(volatile uint8_t *) (bios + 0x041A);
+	tmp = *(volatile uint8_t *)(bios + 0x1823);
+	tmp = *(volatile uint8_t *)(bios + 0x1820);
+	tmp = *(volatile uint8_t *)(bios + 0x1822);
+	tmp = *(volatile uint8_t *)(bios + 0x0418);
+	tmp = *(volatile uint8_t *)(bios + 0x041B);
+	tmp = *(volatile uint8_t *)(bios + 0x0419);
+	tmp = *(volatile uint8_t *)(bios + 0x041A);
 }
 
 static __inline__ int erase_sector_28sf040(volatile uint8_t *bios,
@@ -116,9 +116,9 @@
 
 	*bios = READ_ID;
 	myusec_delay(10);
-	id1 = *(volatile uint8_t *) bios;
+	id1 = *(volatile uint8_t *)bios;
 	myusec_delay(10);
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 	*bios = RESET;
 	myusec_delay(10);
@@ -150,8 +150,8 @@
 int write_28sf040(struct flashchip *flash, uint8_t *buf)
 {
 	int i;
-	int total_size = flash->total_size * 1024, page_size =
-	    flash->page_size;
+	int total_size = flash->total_size * 1024;
+	int page_size = flash->page_size;
 	volatile uint8_t *bios = flash->virt_addr;
 
 	unprotect_28sf040(bios);
diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c
index 522cb9b..52f865a 100644
--- a/sst49lfxxxc.c
+++ b/sst49lfxxxc.c
@@ -50,9 +50,8 @@
 #define	STATUS_ESS		(1 << 6)
 #define	STATUS_WSMS		(1 << 7)
 
-
 static __inline__ int write_lockbits_49lfxxxc(volatile uint8_t *bios, int size,
-					    unsigned char bits)
+					      unsigned char bits)
 {
 	int i, left = size;
 	unsigned long address;
@@ -63,24 +62,23 @@
 		*(bios + (i * 65536) + 2) = bits;
 	}
 	address = i * 65536;
-		//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
+	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
 	*(bios + address + 2) = bits;
 	address += 32768;
-		//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
+	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
 	*(bios + address + 2) = bits;
 	address += 8192;
-		//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
+	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
 	*(bios + address + 2) = bits;
 	address += 8192;
-		//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
+	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
 	*(bios + address + 2) = bits;
 
-
 	return (0);
 }
 
 static __inline__ int erase_sector_49lfxxxc(volatile uint8_t *bios,
-					   unsigned long address)
+					    unsigned long address)
 {
 	unsigned char status;
 
@@ -88,21 +86,21 @@
 	*(bios + address) = ERASE;
 
 	do {
-    		status = *bios;
+		status = *bios;
 		if (status & (STATUS_ESS | STATUS_BPS)) {
-			printf("sector erase FAILED at address=0x%08lx status=0x%01x\n", (unsigned long)bios + address, status); 
+			printf("sector erase FAILED at address=0x%08lx status=0x%01x\n", (unsigned long)bios + address, status);
 			*bios = CLEAR_STATUS;
-			return(-1);
+			return (-1);
 		}
-        } while (!(status & STATUS_WSMS));
+	} while (!(status & STATUS_WSMS));
 
 	return (0);
 }
 
 static __inline__ int write_sector_49lfxxxc(volatile uint8_t *bios,
-					   uint8_t *src,
-					   volatile uint8_t *dst,
-					   unsigned int page_size)
+					    uint8_t *src,
+					    volatile uint8_t *dst,
+					    unsigned int page_size)
 {
 	int i;
 	unsigned char status;
@@ -122,9 +120,9 @@
 		do {
 			status = *bios;
 			if (status & (STATUS_ESS | STATUS_BPS)) {
-				printf("sector write FAILED at address=0x%08lx status=0x%01x\n", (unsigned long)dst, status); 
+				printf("sector write FAILED at address=0x%08lx status=0x%01x\n", (unsigned long)dst, status);
 				*bios = CLEAR_STATUS;
-				return(-1);
+				return (-1);
 			}
 		} while (!(status & STATUS_WSMS));
 	}
@@ -141,8 +139,8 @@
 	*bios = RESET;
 
 	*bios = READ_ID;
-	id1 = *(volatile uint8_t *) bios;
-	id2 = *(volatile uint8_t *) (bios + 0x01);
+	id1 = *(volatile uint8_t *)bios;
+	id2 = *(volatile uint8_t *)(bios + 0x01);
 
 	*bios = RESET;
 
@@ -170,8 +168,8 @@
 
 	write_lockbits_49lfxxxc(bios2, total_size, 0);
 	for (i = 0; i < total_size; i += flash->page_size)
-		if (erase_sector_49lfxxxc(bios, i) != 0 )
-		    return (-1);
+		if (erase_sector_49lfxxxc(bios, i) != 0)
+			return (-1);
 
 	*bios = RESET;
 	return (0);
@@ -180,11 +178,10 @@
 int write_49lfxxxc(struct flashchip *flash, uint8_t *buf)
 {
 	int i;
-	int total_size = flash->total_size * 1024, page_size =
-	    flash->page_size;
+	int total_size = flash->total_size * 1024;
+	int page_size = flash->page_size;
 	volatile uint8_t *bios = flash->virt_addr;
 
-
 	write_lockbits_49lfxxxc(flash->virt_addr_2, total_size, 0);
 	printf("Programming Page: ");
 	for (i = 0; i < total_size / page_size; i++) {
@@ -194,7 +191,7 @@
 		/* write to the sector */
 		printf("%04d at address: 0x%08x", i, i * page_size);
 		write_sector_49lfxxxc(bios, buf + i * page_size,
-				     bios + i * page_size, page_size);
+				      bios + i * page_size, page_size);
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
 	printf("\n");
