mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/1] nand: fix compile warnings
@ 2011-01-07  5:12 Sanjeev Premi
  2011-01-07  5:13 ` [PATCH 1/1] nand: Fix warnings due to incompatible format strings Sanjeev Premi
  0 siblings, 1 reply; 2+ messages in thread
From: Sanjeev Premi @ 2011-01-07  5:12 UTC (permalink / raw)
  To: barebox

The patch fixes these compiler warnings reported by
Cory Walker (cwalker32@gmail.com):

  CC      drivers/mtd/nand/nand.o
drivers/mtd/nand/nand.c: In function 'nand_write':
drivers/mtd/nand/nand.c:73: warning: format '%08x' expects type
 'unsigned int', but argument 2 has type 'ulong'
  CC      drivers/mtd/nand/nand_ecc.o
  CC      drivers/mtd/nand/nand_ids.o
  CC      drivers/mtd/nand/nand_base.o
drivers/mtd/nand/nand_base.c: In function 'nand_select_chip':
drivers/mtd/nand/nand_base.c:170: warning: format '%s' expects t
ype 'char *', but argument 2 has type 'int'
drivers/mtd/nand/nand_base.c:170: warning: too few arguments for
 format

While fixing them, came across similar incompatible formats in
debug() messages:

drivers/mtd/nand/nand.c: In function 'nand_read':
drivers/mtd/nand/nand.c:42: warning: format '%08x' expects type
 'unsigned int', but argument 2 has type 'ulong'
drivers/mtd/nand/nand.c: In function 'nand_write':
drivers/mtd/nand/nand.c:79: warning: format '%08x' expects type
 'unsigned int', but argument 2 has type 'ulong'
drivers/mtd/nand/nand.c:85: warning: format '%d' expects type '
int', but argument 3 has type 'long unsigned int'
drivers/mtd/nand/nand.c:96: warning: format '%08x' expects type
 'unsigned int', but argument 2 has type 'ulong'
drivers/mtd/nand/nand.c: In function 'nand_ioctl':
drivers/mtd/nand/nand.c:117: warning: format '%08x' expects typ
e 'unsigned int', but argument 2 has type 'long int'
drivers/mtd/nand/nand.c:120: warning: format '%08x' expects typ
e 'unsigned int', but argument 2 has type 'long int'


Sanjeev Premi (1):
  nand: Fix warnings due to incompatible format strings

 drivers/mtd/nand/nand.c      |   14 +++++++-------
 drivers/mtd/nand/nand_base.c |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

-- 
1.7.2.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 1/1] nand: Fix warnings due to incompatible format strings
  2011-01-07  5:12 [PATCH 0/1] nand: fix compile warnings Sanjeev Premi
@ 2011-01-07  5:13 ` Sanjeev Premi
  0 siblings, 0 replies; 2+ messages in thread
From: Sanjeev Premi @ 2011-01-07  5:13 UTC (permalink / raw)
  To: barebox

This patch fixes warnings due to incompatible format strings
specified in the printf().

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 drivers/mtd/nand/nand.c      |   14 +++++++-------
 drivers/mtd/nand/nand_base.c |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 6a150fe..08b5cc1 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -37,7 +37,7 @@ static 	ssize_t nand_read(struct cdev *cdev, void* buf, size_t count, ulong offs
 	size_t retlen;
 	int ret;
 
-	debug("nand_read: 0x%08x 0x%08x\n", offset, count);
+	debug("nand_read: 0x%08lx 0x%08x\n", offset, count);
 
 	ret = info->read(info, offset, count, &retlen, buf);
 
@@ -70,17 +70,17 @@ static ssize_t nand_write(struct cdev* cdev, const void *buf, size_t _count, ulo
 	size_t count = _count;
 
 	if (NOTALIGNED(offset)) {
-		printf("offset 0x%08x not page aligned\n", offset);
+		printf("offset 0x%0lx not page aligned\n", offset);
 		return -EINVAL;
 	}
 
-	debug("write: 0x%08x 0x%08x\n", offset, count);
+	debug("write: 0x%08lx 0x%08x\n", offset, count);
 
 	while (count) {
 		now = count > info->writesize ? info->writesize : count;
 
 		if (NOTALIGNED(now)) {
-			debug("not aligned: %d %d\n", info->writesize, (offset % info->writesize));
+			debug("not aligned: %d %ld\n", info->writesize, (offset % info->writesize));
 			wrbuf = xmalloc(info->writesize);
 			memset(wrbuf, 0xff, info->writesize);
 			memcpy(wrbuf + (offset % info->writesize), buf, now);
@@ -91,7 +91,7 @@ static ssize_t nand_write(struct cdev* cdev, const void *buf, size_t _count, ulo
 		} else {
 			if (!all_ff(buf, info->writesize))
 				ret = info->write(info, offset, now, &retlen, buf);
-			debug("offset: 0x%08x now: 0x%08x retlen: 0x%08x\n", offset, now, retlen);
+			debug("offset: 0x%08lx now: 0x%08x retlen: 0x%08x\n", offset, now, retlen);
 		}
 		if (ret)
 			goto out;
@@ -112,10 +112,10 @@ static int nand_ioctl(struct cdev *cdev, int request, void *buf)
 
 	switch (request) {
 	case MEMGETBADBLOCK:
-		debug("MEMGETBADBLOCK: 0x%08x\n", (off_t)buf);
+		debug("MEMGETBADBLOCK: 0x%08lx\n", (off_t)buf);
 		return info->block_isbad(info, (off_t)buf);
 	case MEMSETBADBLOCK:
-		debug("MEMSETBADBLOCK: 0x%08x\n", (off_t)buf);
+		debug("MEMSETBADBLOCK: 0x%08lx\n", (off_t)buf);
 		return info->block_markbad(info, (off_t)buf);
 	case MEMGETINFO:
 		user->type	= info->type;
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 56fafb0..22d2127 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -167,7 +167,7 @@ static void nand_select_chip(struct mtd_info *mtd, int chipnr)
 	case 0:
 		break;
 	default:
-		printf("%s: illegal chip number %d\n", chipnr);
+		printf("%s: illegal chip number %d\n", __func__, chipnr);
 	}
 }
 
-- 
1.7.2.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2011-01-07  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-07  5:12 [PATCH 0/1] nand: fix compile warnings Sanjeev Premi
2011-01-07  5:13 ` [PATCH 1/1] nand: Fix warnings due to incompatible format strings Sanjeev Premi

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