public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] mtd redboot (also gcc 4.1 warning fix)
@ 2006-05-10  2:56 Daniel Walker
  2006-05-10  3:14 ` Matheus Izvekov
  2006-05-10  5:37 ` Adrian Bunk
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Walker @ 2006-05-10  2:56 UTC (permalink / raw)
  To: linux-kernel

unsigned long may not always be 32 bits, right ? This patch fixes the 
warning, but not the bug .

Fixes the following warning,

drivers/mtd/redboot.c: In function 'parse_redboot_partitions':
drivers/mtd/redboot.c:103: warning: passing argument 1 of '__swab32s' from incompatible pointer type
drivers/mtd/redboot.c:104: warning: passing argument 1 of '__swab32s' from incompatible pointer type
drivers/mtd/redboot.c:105: warning: passing argument 1 of '__swab32s' from incompatible pointer type
drivers/mtd/redboot.c:106: warning: passing argument 1 of '__swab32s' from incompatible pointer type
drivers/mtd/redboot.c:107: warning: passing argument 1 of '__swab32s' from incompatible pointer type
drivers/mtd/redboot.c:108: warning: passing argument 1 of '__swab32s' from incompatible pointer type
drivers/mtd/redboot.c:109: warning: passing argument 1 of '__swab32s' from incompatible pointer type

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

Index: linux-2.6.16/drivers/mtd/redboot.c
===================================================================
--- linux-2.6.16.orig/drivers/mtd/redboot.c
+++ linux-2.6.16/drivers/mtd/redboot.c
@@ -100,13 +100,13 @@ static int parse_redboot_partitions(stru
 					/* The unsigned long fields were written with the
 					 * wrong byte sex, name and pad have no byte sex.
 					 */
-					swab32s(&buf[j].flash_base);
-					swab32s(&buf[j].mem_base);
-					swab32s(&buf[j].size);
-					swab32s(&buf[j].entry_point);
-					swab32s(&buf[j].data_length);
-					swab32s(&buf[j].desc_cksum);
-					swab32s(&buf[j].file_cksum);
+					swab32s((unsigned int *)&buf[j].flash_base);
+					swab32s((unsigned int *)&buf[j].mem_base);
+					swab32s((unsigned int *)&buf[j].size);
+					swab32s((unsigned int *)&buf[j].entry_point);
+					swab32s((unsigned int *)&buf[j].data_length);
+					swab32s((unsigned int *)&buf[j].desc_cksum);
+					swab32s((unsigned int *)&buf[j].file_cksum);
 				}
 			}
 			break;

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

end of thread, other threads:[~2006-05-10 14:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-10  2:56 [BUG] mtd redboot (also gcc 4.1 warning fix) Daniel Walker
2006-05-10  3:14 ` Matheus Izvekov
2006-05-10  3:20   ` Daniel Walker
2006-05-10  3:29   ` Olof Johansson
2006-05-10  3:31     ` Daniel Walker
2006-05-10  4:54     ` Matheus Izvekov
2006-05-10  9:04   ` Steven Rostedt
2006-05-10  5:37 ` Adrian Bunk
2006-05-10  9:00   ` Steven Rostedt
2006-05-10 14:43     ` Daniel Walker
2006-05-10 14:35   ` Daniel Walker

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