public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH] m68k: amiflop: *ptr incremented past 0x4489
@ 2009-02-11 14:42 Roel Kluin
  2009-02-13  8:07 ` Joerg Dorchain
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-02-11 14:42 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, Andrew Morton

With while (*ptr++ != 0x4489) { ... } *ptr will be incremented past 0x4489 after
the loop.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 8df436f..3320b00 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -662,8 +662,8 @@ static unsigned long scan_sync(unsigned long raw, unsigned long end)
 {
 	ushort *ptr = (ushort *)raw, *endp = (ushort *)end;
 
-	while (ptr < endp && *ptr++ != 0x4489)
-		;
+	while (ptr < endp && *ptr != 0x4489)
+		++ptr;
 	if (ptr < endp) {
 		while (*ptr == 0x4489 && ptr < endp)
 			ptr++;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-13  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 14:42 [PATCH] m68k: amiflop: *ptr incremented past 0x4489 Roel Kluin
2009-02-13  8:07 ` Joerg Dorchain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox