diff --git a/flash.h b/flash.h
index 0bb6c2b..526087c 100644
--- a/flash.h
+++ b/flash.h
@@ -231,7 +231,7 @@
 int max(int a, int b);
 void tolower_string(char *str);
 char *extract_param(char **haystack, const char *needle, const char *delim);
-int verify_range(struct flashctx *flash, uint8_t *cmpbuf, unsigned int start, unsigned int len, const char *message);
+int verify_range(struct flashctx *flash, uint8_t *cmpbuf, unsigned int start, unsigned int len);
 int need_erase(uint8_t *have, uint8_t *want, unsigned int len, enum write_granularity gran);
 char *strcat_realloc(char *dest, const char *src);
 void print_version(void);
diff --git a/flashrom.c b/flashrom.c
index 7d1ffa3..2299b06 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -544,6 +544,26 @@
 	return usable_erasefunctions;
 }
 
+int compare_range(uint8_t *wantbuf, uint8_t *havebuf, unsigned int start, unsigned int len)
+{
+	int ret = 0, failcount = 0;
+	unsigned int i;
+	for (i = 0; i < len; i++) {
+		if (wantbuf[i] != havebuf[i]) {
+			/* Only print the first failure. */
+			if (!failcount++)
+				msg_cerr("FAILED at 0x%08x! Expected=0x%02x, Found=0x%02x,",
+					 start + i, wantbuf[i], havebuf[i]);
+		}
+	}
+	if (failcount) {
+		msg_cerr(" failed byte count from 0x%08x-0x%08x: 0x%x\n",
+			 start, start + len - 1, failcount);
+		ret = -1;
+	}
+	return ret;
+}
+
 /* start is an offset to the base address of the flash chip */
 int check_erased_range(struct flashctx *flash, unsigned int start,
 		       unsigned int len)
@@ -556,7 +576,7 @@
 		exit(1);
 	}
 	memset(cmpbuf, 0xff, len);
-	ret = verify_range(flash, cmpbuf, start, len, "ERASE");
+	ret = verify_range(flash, cmpbuf, start, len);
 	free(cmpbuf);
 	return ret;
 }
@@ -566,15 +586,12 @@
  *		flash content at location start
  * @start	offset to the base address of the flash chip
  * @len		length of the verified area
- * @message	string to print in the "FAILED" message
  * @return	0 for success, -1 for failure
  */
-int verify_range(struct flashctx *flash, uint8_t *cmpbuf, unsigned int start,
-		 unsigned int len, const char *message)
+int verify_range(struct flashctx *flash, uint8_t *cmpbuf, unsigned int start, unsigned int len)
 {
-	unsigned int i;
 	uint8_t *readbuf = malloc(len);
-	int ret = 0, failcount = 0;
+	int ret = 0;
 
 	if (!len)
 		goto out_free;
@@ -595,8 +612,6 @@
 		ret = -1;
 		goto out_free;
 	}
-	if (!message)
-		message = "VERIFY";
 
 	ret = flash->chip->read(flash, readbuf, start, len);
 	if (ret) {
@@ -605,22 +620,7 @@
 		return ret;
 	}
 
-	for (i = 0; i < len; i++) {
-		if (cmpbuf[i] != readbuf[i]) {
-			/* Only print the first failure. */
-			if (!failcount++)
-				msg_cerr("%s FAILED at 0x%08x! "
-					 "Expected=0x%02x, Read=0x%02x,",
-					 message, start + i, cmpbuf[i],
-					 readbuf[i]);
-		}
-	}
-	if (failcount) {
-		msg_cerr(" failed byte count from 0x%08x-0x%08x: 0x%x\n",
-			 start, start + len - 1, failcount);
-		ret = -1;
-	}
-
+	ret = compare_range(cmpbuf, readbuf, start, len);
 out_free:
 	free(readbuf);
 	return ret;
@@ -1054,21 +1054,6 @@
 	return chip - flashchips;
 }
 
-int verify_flash(struct flashctx *flash, uint8_t *buf)
-{
-	int ret;
-	unsigned int total_size = flash->chip->total_size * 1024;
-
-	msg_cinfo("Verifying flash... ");
-
-	ret = verify_range(flash, buf, 0, total_size, NULL);
-
-	if (!ret)
-		msg_cinfo("VERIFIED.          \n");
-
-	return ret;
-}
-
 int read_buf_from_file(unsigned char *buf, unsigned long size,
 		       const char *filename)
 {
@@ -1424,10 +1409,8 @@
 {
 	msg_gerr("Your flash chip is in an unknown state.\n"
 		"Get help on IRC at chat.freenode.net (channel #flashrom) or\n"
-		"mail flashrom@flashrom.org with the subject "
-		"\"FAILED: <your board name>\"!\n"
-		"-------------------------------------------------------------"
-		  "------------------\n"
+		"mail flashrom@flashrom.org with the subject \"FAILED: <your board name>\"!\n"
+		"-------------------------------------------------------------------------------\n"
 		"DO NOT REBOOT OR POWEROFF!\n");
 }
 
@@ -1860,15 +1843,22 @@
 	}
 
 	if (verify_it) {
-		/* Work around chips which need some time to calm down. */
-		if (write_it)
+		msg_cinfo("Verifying flash... ");
+
+		if (write_it) {
+			/* Work around chips which need some time to calm down. */
 			programmer_delay(1000*1000);
-		ret = verify_flash(flash, newcontents);
-		/* If we tried to write, and verification now fails, we
-		 * might have an emergency situation.
-		 */
-		if (ret && write_it)
-			emergency_help_message();
+			ret = verify_range(flash, newcontents, 0, size);
+			/* If we tried to write, and verification now fails, we
+			 * might have an emergency situation.
+			 */
+			if (ret)
+				emergency_help_message();
+		} else {
+			ret = compare_range(newcontents, oldcontents, 0, size);
+		}
+		if (!ret)
+			msg_cinfo("VERIFIED.\n");
 	}
 
 out:
diff --git a/jedec.c b/jedec.c
index d8532c6..7bc9133 100644
--- a/jedec.c
+++ b/jedec.c
@@ -410,7 +410,7 @@
 
 	dst = d;
 	src = s;
-	failed = verify_range(flash, src, start, page_size, NULL);
+	failed = verify_range(flash, src, start, page_size);
 
 	if (failed && tried++ < MAX_REFLASH_TRIES) {
 		msg_cerr("retrying.\n");
