Hi,<br><br>I saw it on sandbox platform. Does this depend on 32 bit or 64 bit system?<br><br>I found this for __kernel_size_t:<br>arch/sandbox/include/asm/posix_types.h:18:typedef unsigned long    __kernel_size_t;<br><br>so we need to change this to:<br>
typedef unsigned int    __kernel_size_t;<br><br>but in mips arch there is unsigned long, too.<br><br>Regards<br>Alex<br><br><div class="gmail_quote">2012/9/5 Jan Lübbe <span dir="ltr"><<a href="mailto:jlu@pengutronix.de" target="_blank">jlu@pengutronix.de</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div class="im"><br>
On Mon, 2012-09-03 at 07:58 +0200, Alexander Aring wrote:<br>
> Fix some compiler warnings.<br>
</div><div class="im">> --- a/drivers/mtd/core.c<br>
> +++ b/drivers/mtd/core.c<br>
> @@ -79,7 +79,7 @@ static ssize_t mtd_write(struct cdev* cdev, const void *buf, size_t _count,<br>
>               return -EINVAL;<br>
>       }<br>
><br>
> -     dev_dbg(cdev->dev, "write: 0x%08lx 0x%08x\n", offset, count);<br>
> +     dev_dbg(cdev->dev, "write: 0x%08lx 0x%08lx\n", offset, count);<br>
>       while (count) {<br>
<br>
</div>This causes some new warnings for me:<br>
drivers/mtd/core.c: In function 'mtd_write':<br>
drivers/mtd/core.c:82:2: warning: format '%08lx' expects type 'long unsigned int', but argument 5 has type 'size_t'<br>
drivers/mtd/core.c:102:4: warning: format '%08lx' expects type 'long unsigned int', but argument 5 has type 'size_t'<br>
drivers/mtd/core.c:102:4: warning: format '%08lx' expects type 'long unsigned int', but argument 6 has type 'size_t'<br>
<br>
They go away when reverting this. It seems that different achitectures<br>
have different ideas about size_t:<br>
./include/linux/types.h:54:typedef __kernel_size_t              size_t;<br>
./arch/ppc/include/asm/posix_types.h:17:typedef unsigned int    __kernel_size_t;<br>
./arch/blackfin/include/asm/posix_types.h:45:typedef unsigned int __kernel_size_t;<br>
./arch/mips/include/asm/posix_types.h:34:typedef unsigned int   __kernel_size_t;<br>
./arch/mips/include/asm/posix_types.h:39:typedef unsigned long  __kernel_size_t;<br>
./arch/x86/include/asm/posix_types.h:34:typedef unsigned int    __kernel_size_t;<br>
./arch/sandbox/include/asm/posix_types.h:18:typedef unsigned long       __kernel_size_t;<br>
./arch/nios2/include/asm/posix_types.h:30:typedef unsigned int          __kernel_size_t;<br>
./arch/openrisc/include/asm/posix_types.h:28:typedef unsigned int       __kernel_size_t;<br>
./arch/arm/include/asm/posix_types.h:30:typedef unsigned int            __kernel_size_t;<br>
<br>
On which arch did you see the warnings with the original code?<br>
<br>
Regards,<br>
Jan<br>
<div class="HOEnZb"><div class="h5">--<br>
Pengutronix e.K.                           |                             |<br>
Industrial Linux Solutions                 | <a href="http://www.pengutronix.de/" target="_blank">http://www.pengutronix.de/</a>  |<br>
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: <a href="tel:%2B49-5121-206917-0" value="+4951212069170">+49-5121-206917-0</a>    |<br>
Amtsgericht Hildesheim, HRA 2686           | Fax:   <a href="tel:%2B49-5121-206917-5555" value="+4951212069175555">+49-5121-206917-5555</a> |<br>
<br>
</div></div></blockquote></div><br>