diff --git a/board_enable.c b/board_enable.c
index 0e89137..5e57aff 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -79,7 +79,7 @@
 		break;
 	case SUPERIO_VENDOR_ITE:
 		enter_conf_mode_ite(superio.port);
-		/* Enable flash mapping. Works for most old ITE style SuperI/O. */
+		/* Enable flash mapping. Works for most old ITE style Super I/O. */
 		tmp = sio_read(superio.port, 0x24);
 		tmp |= 0xfc;
 		sio_write(superio.port, 0x24, tmp);
@@ -87,7 +87,7 @@
 		ret = 0;
 		break;
 	default:
-		printf_debug("Unhandled SuperI/O type!\n");
+		printf_debug("Unhandled Super I/O type!\n");
 		ret = -1;
 		break;
 	}
@@ -226,7 +226,7 @@
  *  - GIGABYTE GA-7VT600: VIA KT600 + VT8237 + IT8705
  *  - Shuttle AK38N: VIA KT333CF + VIA VT8235 + ITE IT8705F
  *
- * SIS950 superio probably requires the same flash write enable.
+ * The SIS950 Super I/O probably requires the same flash write enable.
  */
 static int it8705f_write_enable_2e(const char *name)
 {
@@ -239,36 +239,32 @@
         int gpio_bank = gpio / 8;
         int gpio_pin = gpio % 8;
         uint16_t baseport;
-        uint8_t id;
-        uint8_t val;
+        uint8_t id, val;
 
-        if (gpio_bank > 4)
-        {
+        if (gpio_bank > 4) {
                 fprintf(stderr, "PC87360: Invalid GPIO %d\n", gpio);
                 return -1;
         }
 
         id = sio_read(0x2E, 0x20);
-        if (id != 0xE1)
-        {
+        if (id != 0xE1) {
                 fprintf(stderr, "PC87360: unexpected ID %02x\n", id);
                 return -1;
         }
 
-        sio_write(0x2E, 0x07, 0x07);		/* select GPIO device */
+        sio_write(0x2E, 0x07, 0x07);		/* Select GPIO device */
         baseport = (sio_read(0x2E, 0x60) << 8) | sio_read(0x2E, 0x61);
-        if((baseport & 0xFFF0) == 0xFFF0 || baseport == 0)
-        {
+        if ((baseport & 0xFFF0) == 0xFFF0 || baseport == 0) {
                 fprintf (stderr, "PC87360: invalid GPIO base address %04x\n",
                          baseport);
                 return -1;
         }
         sio_mask (0x2E, 0x30, 0x01, 0x01);	/* Enable logical device */
-        sio_write(0x2E, 0xF0, gpio_bank*16 + gpio_pin);
+        sio_write(0x2E, 0xF0, gpio_bank * 16 + gpio_pin);
         sio_mask (0x2E, 0xF1, 0x01, 0x01);	/* Make pin output */
 
         val = INB(baseport + bankbase[gpio_bank]);
-        if(raise)
+        if (raise)
                 val |= 1 << gpio_pin;
         else
                 val &= ~(1 << gpio_pin);
@@ -1028,8 +1024,7 @@
 static int board_msi_651ml(const char *name)
 {
     	struct pci_dev *dev;
-	uint16_t base;
-	uint16_t temp;
+	uint16_t base, temp;
 
 	dev = pci_dev_find(0x1039, 0x0962);
 	if (!dev) {
@@ -1133,7 +1128,7 @@
 	w836xx_ext_leave(0x2E);
 
 	if (id != 0x8701) {
-		fprintf(stderr, "\nERROR: IT8703F SuperIO not found.\n");
+		fprintf(stderr, "\nERROR: IT8703F Super I/O not found.\n");
 		return -1;
 	}
 
@@ -1144,7 +1139,7 @@
 	w836xx_ext_leave(0x2E);
 
 	if (!base) {
-		fprintf(stderr, "\nERROR: Failed to read IT8703F SuperIO GPIO"
+		fprintf(stderr, "\nERROR: Failed to read IT8703F Super I/O GPIO"
 			" Base.\n");
 		return -1;
 	}
@@ -1161,8 +1156,7 @@
  * General routine for raising/dropping GPIO lines on the ITE IT8712F.
  * There is only some limited checking on the port numbers.
  */
-static int
-it8712f_gpio_set(unsigned int line, int raise)
+static int it8712f_gpio_set(unsigned int line, int raise)
 {
 	unsigned int port;
 	uint16_t id, base;
@@ -1186,7 +1180,7 @@
 	exit_conf_mode_ite(0x2E);
 
 	if (id != 0x8712) {
-		fprintf(stderr, "\nERROR: IT8712F SuperIO not found.\n");
+		fprintf(stderr, "\nERROR: IT8712F Super I/O not found.\n");
 		return -1;
 	}
 
@@ -1197,7 +1191,7 @@
 	exit_conf_mode_ite(0x2E);
 
 	if (!base) {
-		fprintf(stderr, "\nERROR: Failed to read IT8712F SuperIO GPIO"
+		fprintf(stderr, "\nERROR: Failed to read IT8712F Super I/O GPIO"
 			" Base.\n");
 		return -1;
 	}
@@ -1446,20 +1440,19 @@
 		board = board_match_pci_card_ids();
 
         if (board && board->status == NT) {
-                if (!force_boardenable)
-                {
+                if (!force_boardenable) {
                         printf("WARNING: Your mainboard is %s %s, but the mainboard-specific\n"
                                "code has not been tested, and thus will not not be executed by default.\n"
                                "Depending on your hardware environment, erasing, writing or even probing\n"
                                "can fail without running the board specific code.\n\n"
                                "Please see the man page (section PROGRAMMER SPECIFIC INFO, subsection\n"
-                               "\"internal programmer\") for details\n",
+                               "\"internal programmer\") for details.\n",
                                board->vendor_name, board->board_name);
                         board = NULL;
-                }
-                else
+                } else {
                         printf("NOTE: Running an untested board enable procedure.\n"
-                               "Please report success/failure to flashrom@flashrom.org\n");
+                               "Please report success/failure to flashrom@flashrom.org.\n");
+		}
         }
 
 	if (board) {
diff --git a/cli_output.c b/cli_output.c
index 2ced043..b3d4e04 100644
--- a/cli_output.c
+++ b/cli_output.c
@@ -27,25 +27,25 @@
 	va_list ap;
 	int ret;
 	FILE *output_type;
-	
-	switch (type)
-	{
+
+	switch (type) {
 	case MSG_ERROR:
 		output_type = stderr;
 		break;
 	case MSG_BARF:
-		if (verbose < 2) return 0;
+		if (verbose < 2)
+			return 0;
 	case MSG_DEBUG:
-		if (verbose < 1) return 0;
+		if (verbose < 1)
+			return 0;
 	case MSG_INFO:
 	default:
 		output_type = stdout;
 		break;
 	}
-	
+
 	va_start(ap, fmt);
 	ret = vfprintf(output_type, fmt, ap);
 	va_end(ap);
 	return ret;
 }
-
diff --git a/dmi.c b/dmi.c
index 30a4670..bb285f4 100644
--- a/dmi.c
+++ b/dmi.c
@@ -31,18 +31,20 @@
 	DMI_BB_MANUFACTURER,
 	DMI_BB_PRODUCT,
 	DMI_BB_VERSION,
-	DMI_ID_INVALID /* This must always be the last entry */
+	DMI_ID_INVALID, /* This must always be the last entry! */
 };
 
-/* The short_id for baseboard starts with "m" as in mainboard to leave
-   "b" available for BIOS */
+/*
+ * The short_id for baseboard starts with "m" as in mainboard to leave
+ * "b" available for BIOS.
+ */
 const char *dmidecode_names[DMI_ID_INVALID] = {
 	"system-manufacturer",
 	"system-product-name",
 	"system-version",
 	"baseboard-manufacturer",
 	"baseboard-product-name",
-	"baseboard-version"
+	"baseboard-version",
 };
 
 #define DMI_COMMAND_LEN_MAX 260
@@ -51,7 +53,7 @@
 int has_dmi_support = 0;
 char *dmistrings[DMI_ID_INVALID];
 
-/* strings longer than 4096 in DMI are just insane */
+/* Strings longer than 4096 in DMI are just insane. */
 #define DMI_MAX_ANSWER_LEN 4096
 
 static char *get_dmi_string(const char *string_name)
@@ -59,7 +61,8 @@
 	FILE *dmidecode_pipe;
 	char *result;
 	char answerbuf[DMI_MAX_ANSWER_LEN];
-	char commandline[DMI_COMMAND_LEN_MAX+40];
+	char commandline[DMI_COMMAND_LEN_MAX + 40];
+
 	snprintf(commandline, sizeof(commandline),
 		 "%s -s %s", dmidecode_command, string_name);
 	dmidecode_pipe = popen(commandline, "r");
@@ -82,7 +85,7 @@
 		return NULL;
 	}
 
-	/* chomp trailing newline */
+	/* Chomp trailing newline. */
 	if (answerbuf[0] != 0 &&
 	    answerbuf[strlen(answerbuf) - 1] == '\n')
 		answerbuf[strlen(answerbuf) - 1] = 0;
@@ -99,6 +102,7 @@
 {
 	int i;
 	char *chassis_type;
+
 	has_dmi_support = 1;
 	for (i = 0; i < DMI_ID_INVALID; i++) {
 		dmistrings[i] = get_dmi_string(dmidecode_names[i]);
@@ -131,8 +135,9 @@
 {
 	int anchored = 0;
 	int patternlen;
+
 	printf_debug("matching %s against %s\n", value, pattern);
-	/* The empty string is part of all strings */
+	/* The empty string is part of all strings! */
 	if (pattern[0] == 0)
 		return 1;
 
@@ -145,11 +150,11 @@
 	if (pattern[patternlen - 1] == '$') {
 		int valuelen = strlen(value);
 		patternlen--;
-		if(patternlen > valuelen)
+		if (patternlen > valuelen)
 			return 0;
 
 		/* full string match: require same length */
-		if(anchored && (valuelen != patternlen))
+		if (anchored && (valuelen != patternlen))
 			return 0;
 
 		/* start character to make ends match */
@@ -166,11 +171,12 @@
 int dmi_match(const char *pattern)
 {
 	int i;
+
 	if (!has_dmi_support)
 		return 0;
 
-	for (i = 0;i < DMI_ID_INVALID; i++)
-		if(dmi_compare(dmistrings[i], pattern))
+	for (i = 0; i < DMI_ID_INVALID; i++)
+		if (dmi_compare(dmistrings[i], pattern))
 			return 1;
 
 	return 0;
diff --git a/flashrom.c b/flashrom.c
index 6a91089..988e010 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -664,7 +664,7 @@
 	case write_gran_256bytes:
 		for (j = 0; j < len / 256; j++) {
 			limit = min (256, len - j * 256);
-			/* Are have and want identical? */
+			/* Are 'have' and 'want' identical? */
 			if (!memcmp(have + j * 256, want + j * 256, limit))
 				continue;
 			/* have needs to be in erased state. */
@@ -1028,7 +1028,7 @@
 		 * layouts. That would imply "magic" erase functions. The
 		 * easiest way to check this is with function pointers.
 		 */
-		for (j = k + 1; j < NUM_ERASEFUNCTIONS; j++)
+		for (j = k + 1; j < NUM_ERASEFUNCTIONS; j++) {
 			if (eraser.block_erase ==
 			    flash->block_erasers[j].block_erase) {
 				msg_gerr("ERROR: Flash chip %s erase function "
@@ -1037,6 +1037,7 @@
 					flash->name, k, j);
 				ret = 1;
 			}
+		}
 	}
 	return ret;
 }
@@ -1198,7 +1199,7 @@
 		       "this flash part. Please include the flashrom\noutput "
 		       "with the additional -V option for all operations you "
 		       "tested (-V, -rV,\n-wV, -EV), and mention which "
-		       "mainboard or programmer you tested. Thanks for your "
+		       "mainboard or programmer you tested.\nThanks for your "
 		       "help!\n===\n");
 	}
 }
diff --git a/hwaccess.h b/hwaccess.h
index 89469b0..06817ab 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -15,8 +15,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- *
- *
+ */
+
+/*
  * Header file for hardware access and OS abstraction. Included from flash.h.
  */
 
@@ -89,42 +90,36 @@
     #endif
   #include <stdint.h>
 
-static inline void
-outb(uint8_t value, uint16_t port)
+static inline void outb(uint8_t value, uint16_t port)
 {
 	asm volatile ("outb %b0,%w1": :"a" (value), "Nd" (port));
 }
 
-static inline uint8_t
-inb(uint16_t port)
+static inline uint8_t inb(uint16_t port)
 {
 	uint8_t value;
 	asm volatile ("inb %w1,%0":"=a" (value):"Nd" (port));
 	return value;
 }
 
-static inline void
-outw(uint16_t value, uint16_t port)
+static inline void outw(uint16_t value, uint16_t port)
 {
 	asm volatile ("outw %w0,%w1": :"a" (value), "Nd" (port));
 }
 
-static inline uint16_t
-inw(uint16_t port)
+static inline uint16_t inw(uint16_t port)
 {
 	uint16_t value;
 	asm volatile ("inw %w1,%0":"=a" (value):"Nd" (port));
 	return value;
 }
 
-static inline void
-outl(uint32_t value, uint16_t port)
+static inline void outl(uint32_t value, uint16_t port)
 {
 	asm volatile ("outl %0,%w1": :"a" (value), "Nd" (port));
 }
 
-static inline uint32_t
-inl(uint16_t port)
+static inline uint32_t inl(uint16_t port)
 {
 	uint32_t value;
 	asm volatile ("inl %1,%0":"=a" (value):"Nd" (port));
diff --git a/internal.c b/internal.c
index 0afed72..e2444fd 100644
--- a/internal.c
+++ b/internal.c
@@ -105,7 +105,8 @@
 void probe_superio(void)
 {
 	superio = probe_superio_ite();
-#if 0	/* Winbond SuperI/O code is not yet available. */
+#if 0
+	/* Winbond Super I/O code is not yet available. */
 	if (superio.vendor == SUPERIO_VENDOR_NONE)
 		superio = probe_superio_winbond();
 #endif
@@ -150,17 +151,17 @@
 	coreboot_init();
 	dmi_init();
 
-	/* Probe for the SuperI/O chip and fill global struct superio. */
+	/* Probe for the Super I/O chip and fill global struct superio. */
 	probe_superio();
 
-	/* Warn if a laptop is detected */
+	/* Warn if a laptop is detected. */
 	if (is_laptop)
 		printf("========================================================================\n"
 		       "WARNING! You seem to be running flashrom on a laptop.\n"
 		       "Laptops, notebooks and netbooks are difficult to support and we recommend\n"
 		       "to use the vendor flashing utility. The embedded controller (EC) in these\n"
-		       "machines often interacts badly with flashing\n"
-		       "See http://www.flashrom.org/Laptops\n"
+		       "machines often interacts badly with flashing.\n"
+		       "See http://www.flashrom.org/Laptops for details.\n"
 		       "========================================================================\n");
 
 	/* try to enable it. Failure IS an option, since not all motherboards
diff --git a/it87spi.c b/it87spi.c
index ed72c90..0402211 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -81,7 +81,7 @@
 		case 0x82:
 		case 0x86:
 		case 0x87:
-			msg_pinfo("Found ITE SuperI/O, id %04hx\n",
+			msg_pinfo("Found ITE Super I/O, id %04hx\n",
 				     ret.model);
 			return ret;
 		}
@@ -170,7 +170,7 @@
 	int ret;
 
 	get_io_perms();
-	/* Probe for the SuperI/O chip and fill global struct superio. */
+	/* Probe for the Super I/O chip and fill global struct superio. */
 	probe_superio();
 	ret = it87spi_common_init();
 	if (!ret) {
diff --git a/serial.c b/serial.c
index 4d49e08..37f2549 100644
--- a/serial.c
+++ b/serial.c
@@ -105,13 +105,15 @@
 {
 #ifdef _WIN32
 	HANDLE fd;
-	char* dev2 = dev;
-	if ((strlen(dev) > 3) && (tolower(dev[0])=='c') && (tolower(dev[1])=='o') && (tolower(dev[2])=='m')) {
-		dev2 = malloc(strlen(dev)+5);
+	char *dev2 = dev;
+	if ((strlen(dev) > 3) && (tolower(dev[0]) == 'c')
+	    && (tolower(dev[1]) == 'o') && (tolower(dev[2]) == 'm')) {
+		dev2 = malloc(strlen(dev) + 5);
 		strcpy(dev2, "\\\\.\\");
-		strcpy(dev2+4, dev);
+		strcpy(dev2 + 4, dev);
 	}
-	fd = CreateFile(dev2, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+	fd = CreateFile(dev2, GENERIC_READ | GENERIC_WRITE, 0, NULL,
+			OPEN_EXISTING, 0, NULL);
 	if (dev2 != dev)
 		free(dev2);
 	if (fd == INVALID_HANDLE_VALUE) {
@@ -129,9 +131,9 @@
 		case 115200: dcb.BaudRate = CBR_115200; break;
 		default: sp_die("Error: Could not set baud rate");
 	}
-	dcb.ByteSize=8;
-	dcb.Parity=NOPARITY;
-	dcb.StopBits=ONESTOPBIT;
+	dcb.ByteSize = 8;
+	dcb.Parity = NOPARITY;
+	dcb.StopBits = ONESTOPBIT;
 	if (!SetCommState(fd, &dcb)) {
 		sp_die("Error: Could not change serial port configuration");
 	}
@@ -147,9 +149,8 @@
 	for (i = 0;; i++) {
 		if (sp_baudtable[i].baud == 0) {
 			close(fd);
-			msg_perr(
-				"Error: cannot configure for baudrate %d\n",
-				baud);
+			msg_perr("Error: cannot configure for baudrate %d\n",
+				 baud);
 			exit(1);
 		}
 		if (sp_baudtable[i].baud == baud) {
