mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@googlemail.com>
To: "Jan Lübbe" <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] mtd: fix compiler warnings
Date: Wed, 5 Sep 2012 20:53:29 +0200	[thread overview]
Message-ID: <CAB_54W5c4tBoaoiRoRM6vOXJGZwfXg+zhiSyb3A4hPGo0o+10A@mail.gmail.com> (raw)
In-Reply-To: <1346858724.3388.24.camel@coredoba.hi.pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 2729 bytes --]

Hi,

I saw it on sandbox platform. Does this depend on 32 bit or 64 bit system?

I found this for __kernel_size_t:
arch/sandbox/include/asm/posix_types.h:18:typedef unsigned long
__kernel_size_t;

so we need to change this to:
typedef unsigned int    __kernel_size_t;

but in mips arch there is unsigned long, too.

Regards
Alex

2012/9/5 Jan Lübbe <jlu@pengutronix.de>

> Hi,
>
> On Mon, 2012-09-03 at 07:58 +0200, Alexander Aring wrote:
> > Fix some compiler warnings.
> > --- a/drivers/mtd/core.c
> > +++ b/drivers/mtd/core.c
> > @@ -79,7 +79,7 @@ static ssize_t mtd_write(struct cdev* cdev, const void
> *buf, size_t _count,
> >               return -EINVAL;
> >       }
> >
> > -     dev_dbg(cdev->dev, "write: 0x%08lx 0x%08x\n", offset, count);
> > +     dev_dbg(cdev->dev, "write: 0x%08lx 0x%08lx\n", offset, count);
> >       while (count) {
>
> This causes some new warnings for me:
> drivers/mtd/core.c: In function 'mtd_write':
> drivers/mtd/core.c:82:2: warning: format '%08lx' expects type 'long
> unsigned int', but argument 5 has type 'size_t'
> drivers/mtd/core.c:102:4: warning: format '%08lx' expects type 'long
> unsigned int', but argument 5 has type 'size_t'
> drivers/mtd/core.c:102:4: warning: format '%08lx' expects type 'long
> unsigned int', but argument 6 has type 'size_t'
>
> They go away when reverting this. It seems that different achitectures
> have different ideas about size_t:
> ./include/linux/types.h:54:typedef __kernel_size_t              size_t;
> ./arch/ppc/include/asm/posix_types.h:17:typedef unsigned int
>  __kernel_size_t;
> ./arch/blackfin/include/asm/posix_types.h:45:typedef unsigned int
> __kernel_size_t;
> ./arch/mips/include/asm/posix_types.h:34:typedef unsigned int
> __kernel_size_t;
> ./arch/mips/include/asm/posix_types.h:39:typedef unsigned long
>  __kernel_size_t;
> ./arch/x86/include/asm/posix_types.h:34:typedef unsigned int
>  __kernel_size_t;
> ./arch/sandbox/include/asm/posix_types.h:18:typedef unsigned long
> __kernel_size_t;
> ./arch/nios2/include/asm/posix_types.h:30:typedef unsigned int
>  __kernel_size_t;
> ./arch/openrisc/include/asm/posix_types.h:28:typedef unsigned int
> __kernel_size_t;
> ./arch/arm/include/asm/posix_types.h:30:typedef unsigned int
>  __kernel_size_t;
>
> On which arch did you see the warnings with the original code?
>
> Regards,
> Jan
> --
> 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 |
>
>

[-- Attachment #1.2: Type: text/html, Size: 3597 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

      reply	other threads:[~2012-09-05 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03  5:58 Alexander Aring
2012-09-03  5:58 ` [PATCH 2/2] mtd: add private data to mtddev-hook Alexander Aring
2012-09-03  9:06 ` [PATCH 1/2] mtd: fix compiler warnings Sascha Hauer
2012-09-05 15:25 ` Jan Lübbe
2012-09-05 18:53   ` Alexander Aring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAB_54W5c4tBoaoiRoRM6vOXJGZwfXg+zhiSyb3A4hPGo0o+10A@mail.gmail.com \
    --to=alex.aring@googlemail.com \
    --cc=barebox@lists.infradead.org \
    --cc=jlu@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox