Skip to contentSkip to conversation

mtd-core: fix compiler warning

PATCH Applied Alexander Aring 2 participants 2 messages Jan 16, 2013 – Jan 17, 2013 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd-core: fix compiler warning

Got this compile warning if MTD_WRITE support isn't set.

drivers/mtd/core.c: In function 'mtd_ioctl':
drivers/mtd/core.c:117:26: warning: unused variable 'ei' [-Wunused-variable]

Add a #ifdef to declaration of variable 'ei' to solve it.

---
 drivers/mtd/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/core.c +2 -0
index af6e195..070fda6 100644
@@ -114,7 +114,9 @@ int mtd_ioctl(struct cdev *cdev, int request, void *buf)
 	struct mtd_ecc_stats *ecc = buf;
 #endif
 	struct region_info_user *reg = buf;
+#ifdef CONFIG_MTD_WRITE
 	struct erase_info_user *ei = buf;
+#endif
 	loff_t *offset = buf;
 
 	switch (request) {
Signature · 7 lines
1.8.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Alexander Aring

Got this compile warning if MTD_WRITE support isn't set.

drivers/mtd/core.c: In function 'mtd_ioctl':
drivers/mtd/core.c:117:26: warning: unused variable 'ei' [-Wunused-variable]

Add a #ifdef to declaration of variable 'ei' to solve it.

Applied, thanks

Sascha

Quoted 27 lines
---
 drivers/mtd/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/core.c +2 -0
index af6e195..070fda6 100644
@@ -114,7 +114,9 @@ int mtd_ioctl(struct cdev *cdev, int request, void *buf)
 	struct mtd_ecc_stats *ecc = buf;
 #endif
 	struct region_info_user *reg = buf;
+#ifdef CONFIG_MTD_WRITE
 	struct erase_info_user *ei = buf;
+#endif
 	loff_t *offset = buf;
 
 	switch (request) {
Signature · 7 lines
1.8.1


_______________________________________________
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