[PATCH] nwflash: fix build errors and warning

From: Akinobu Mita
Date: Sat Jul 26 2008 - 11:02:46 EST


On Sat, Jul 26, 2008 at 03:18:08PM +0100, Russell King - ARM Linux wrote:
> On Fri, Jul 25, 2008 at 01:48:18AM -0700, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> > From: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> >
> > Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> > Cc: Russell King <linux@xxxxxxxxxxxxxxxx>
> > Cc: Tim Schmielau <tim@xxxxxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
>
> Argh... Are people now submitting untested patches as a rule?
>
> drivers/char/nwflash.c: In function 'flash_read':
> drivers/char/nwflash.c:129: error: 'p' undeclared (first use in this function)
> drivers/char/nwflash.c:129: error: (Each undeclared identifier is reported only once
> drivers/char/nwflash.c:129: error: for each function it appears in.)
> drivers/char/nwflash.c:129: error: 'count' undeclared (first use in this function)
> drivers/char/nwflash.c:136: warning: passing argument 4 of 'simple_read_from_buffer' discards qualifiers from pointer target type
> make[2]: *** [drivers/char/nwflash.o] Error 1
> make[1]: *** [drivers/char] Error 2
> make: *** [drivers] Error 2

Sorry. I'm preparing cross compiler. But this patch should fix this
problem.

From: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Subject: nwflash: fix build errors and warning

The commit 6ee8928d94841aa764aeaf645ad16daff811dc26
(nwflash: use simple_read_from_buffer()) broke nwflash.

drivers/char/nwflash.c: In function 'flash_read':
drivers/char/nwflash.c:129: error: 'p' undeclared (first use in this function)
drivers/char/nwflash.c:129: error: (Each undeclared identifier is reported only once
drivers/char/nwflash.c:129: error: for each function it appears in.)
drivers/char/nwflash.c:129: error: 'count' undeclared (first use in this function)
drivers/char/nwflash.c:136: warning: passing argument 4 of 'simple_read_from_buffer' discards qualifiers from pointer target type
make[2]: *** [drivers/char/nwflash.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
---
drivers/char/nwflash.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Index: 2.6-mm/drivers/char/nwflash.c
===================================================================
--- 2.6-mm.orig/drivers/char/nwflash.c
+++ 2.6-mm/drivers/char/nwflash.c
@@ -126,14 +126,15 @@ static ssize_t flash_read(struct file *f

if (flashdebug)
printk(KERN_DEBUG "flash_read: flash_read: offset=0x%lX, "
- "buffer=%p, count=0x%X.\n", p, buf, count);
+ "buffer=%p, count=0x%zX.\n", *ppos, buf, size);
/*
* We now lock against reads and writes. --rmk
*/
if (mutex_lock_interruptible(&nwflash_mutex))
return -ERESTARTSYS;

- ret = simple_read_from_buffer(buf, size, ppos, FLASH_BASE, gbFlashSize);
+ ret = simple_read_from_buffer(buf, size, ppos, (void *)FLASH_BASE,
+ gbFlashSize);
mutex_unlock(&nwflash_mutex);

return ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/