From: "Randy.Dunlap" <randy.dunlap@oracle.com>
To: Ben Dooks <ben@fluff.org>
Cc: akpm <akpm@osdl.org>, dwmw2@infradead.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] MTD: fix printk format warning
Date: Tue, 24 Oct 2006 08:29:31 -0700 [thread overview]
Message-ID: <453E315B.8090801@oracle.com> (raw)
In-Reply-To: <20061024100245.GA21695@home.fluff.org>
Ben Dooks wrote:
> On Tue, Oct 24, 2006 at 12:24:10PM +0300, Artem Bityutskiy wrote:
>> On Mon, 2006-10-23 at 21:48 -0700, Randy Dunlap wrote:
>>> (may be a gcc phenomenon)
>>> Fix printk format warning:
>>> drivers/mtd/maps/physmap.c:93: warning: long long unsigned int format, long unsigned int arg (arg 2)
>>>
>>> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>> ... snip ...
>>
>>> printk(KERN_NOTICE "physmap platform flash device: %.8llx at %.8llx\n",
>>> - (unsigned long long)dev->resource->end - dev->resource->start + 1,
>>> + (unsigned long long)(dev->resource->end - dev->resource->start + 1),
>>> (unsigned long long)dev->resource->start);
>> Hmm, AFAIK
>>
>> "(unsigned long) dev->resource->end - dev->resource->start + 1" should
>
> I thought that 'z' was the modifier to %x for resources?
Maybe you are thinking of 'z' for use with size_t ? From the C99 spec:
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
size_t or the corresponding signed integer type argument; or that a
following n conversion specifier applies to a pointer to a signed integer type
corresponding to size_t argument. But a resource_size_t is not a size_t.
Depending on CONFIG, it's either:
#ifdef CONFIG_RESOURCES_64BIT
typedef u64 resource_size_t;
#else
typedef u32 resource_size_t;
#endif
which I suppose is what Artem missed. I.e., it's not always unsigned long.
However, I won't deny that gcc seems odd here.
--
~Randy
next prev parent reply other threads:[~2006-10-24 15:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-24 4:48 [PATCH] MTD: fix printk format warning Randy Dunlap
2006-10-24 9:24 ` Artem Bityutskiy
2006-10-24 10:02 ` Ben Dooks
2006-10-24 15:29 ` Randy.Dunlap [this message]
2006-10-24 16:57 ` Artem Bityutskiy
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=453E315B.8090801@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@osdl.org \
--cc=ben@fluff.org \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/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