Skip to contentSkip to conversation

mtd: nand: Fix compiler warning

PATCH Applied Alexander Shiyan 2 participants 3 messages Mar 5, 2013 – Mar 6, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mtd: nand: Fix compiler warning

This patch fixes following warning:
drivers/mtd/nand/nand_write.c: In function 'nand_do_write_ops':
drivers/mtd/nand/nand_write.c:272: warning: 'ret' may be used uninitialized in this function

---
 drivers/mtd/nand/nand_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_write.c +1 -1
index eea5113..0e2f98f 100644
@@ -269,7 +269,7 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
 	uint32_t writelen = ops->len;
 	uint8_t *oob = ops->oobbuf;
 	uint8_t *buf = ops->datbuf;
-	int ret, subpage;
+	int ret = 0, subpage;
 
 	ops->retlen = 0;
 	if (!writelen)
Signature · 7 lines
1.7.12.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 w1: Fix compiler warning

This patch fixes following warning:
drivers/w1/w1.c: In function 'w1_found':
drivers/w1/w1.c:471: warning: integer constant is too large for 'long' type

---
 drivers/w1/w1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/w1/w1.c +1 -1
index eb6bec8..bbef470 100644
@@ -468,7 +468,7 @@ void w1_found(struct w1_bus *bus, u64 rn)
 
 	dev->reg_num = rn;
 	dev->fid = tmp >> 56;
-	dev->id = (tmp >> 8) & 0xffffffffffff;
+	dev->id = (tmp >> 8) & 0xffffffffffffULL;
 	dev->crc = tmp & 0xff;
 
 	dev_dbg(&bus->dev, "%s:  familly = 0x%x, id = 0x%llx, crc = 0x%x\n",
Signature · 7 lines
1.7.12.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#2 lore raw
In reply to Alexander Shiyan
Quoted 5 lines · Alexander Shiyan

This patch fixes following warning:
drivers/mtd/nand/nand_write.c: In function 'nand_do_write_ops':
drivers/mtd/nand/nand_write.c:272: warning: 'ret' may be used uninitialized in this function

Applied, thanks

Quoted 26 lines
---
 drivers/mtd/nand/nand_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_write.c +1 -1
index eea5113..0e2f98f 100644
@@ -269,7 +269,7 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
 	uint32_t writelen = ops->len;
 	uint8_t *oob = ops->oobbuf;
 	uint8_t *buf = ops->datbuf;
-	int ret, subpage;
+	int ret = 0, subpage;
 
 	ops->retlen = 0;
 	if (!writelen)
Signature · 7 lines
1.7.12.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox