[BUG] mtd redboot (also gcc 4.1 warning fix)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux