From: Wolfgang Grandegger <wg@grandegger.com>
To: David Miller <davem@davemloft.net>
Cc: sfr@canb.auug.org.au, linux-next@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: linux-next: net tree build warning
Date: Wed, 10 Jun 2009 09:38:55 +0200 [thread overview]
Message-ID: <4A2F630F.5020602@grandegger.com> (raw)
In-Reply-To: <20090609.173806.193714555.davem@davemloft.net>
David Miller wrote:
> From: Wolfgang Grandegger <wg@grandegger.com>
> Date: Tue, 09 Jun 2009 15:14:38 +0200
>
>> David Miller wrote:
>>> From: Wolfgang Grandegger <wg@grandegger.com>
>>> Date: Tue, 09 Jun 2009 13:25:27 +0200
>>>
>>>> [PATCH] can: sja1000_of_platform: fix build problems with printk format
>>>>
>>>> Variables of type size_t should be printed with the format "%zx".
>>>>
>>>> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
>>> It's not a "size_t", it's a "resource_size_t" which can be
>>> "unsigned long long" on some platforms.
>> Right, but I assume that the %zx handles that type properly as well.
>
> It absolutely does not.b
>
> resource_size_t is a arch specifically defined type that
> could be anything, it does not conform to the definitions
> of size_t.
Right, I'm now compiling on a x86_64 system and can reproduce the
warnings. Below is a revised patch.
Thanks for your patience.
Wolfgang.
[PATCH v2] can: sja1000_of_platform: fix build problems with printk format
According to "Documentation/printk-formats.txt", if the type is
dependent on a config option for its size, like resource_size_t,
we should use a format specifier of its largest possible type and
explicitly cast to it.
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/sja1000/sja1000_of_platform.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: net-next-2.6/drivers/net/can/sja1000/sja1000_of_platform.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/sja1000/sja1000_of_platform.c 2009-06-09 12:45:38.000000000 +0200
+++ net-next-2.6/drivers/net/can/sja1000/sja1000_of_platform.c 2009-06-10 09:23:47.208720083 +0200
@@ -108,15 +108,17 @@
res_size = resource_size(&res);
if (!request_mem_region(res.start, res_size, DRV_NAME)) {
- dev_err(&ofdev->dev, "couldn't request %#x..%#x\n",
- res.start, res.end);
+ dev_err(&ofdev->dev, "couldn't request %#llx..%#llx\n",
+ (unsigned long long)res.start,
+ (unsigned long long)res.end);
return -EBUSY;
}
base = ioremap_nocache(res.start, res_size);
if (!base) {
- dev_err(&ofdev->dev, "couldn't ioremap %#x..%#x\n",
- res.start, res.end);
+ dev_err(&ofdev->dev, "couldn't ioremap %#llx..%#llx\n",
+ (unsigned long long)res.start,
+ (unsigned long long)res.end);
err = -ENOMEM;
goto exit_release_mem;
}
next prev parent reply other threads:[~2009-06-10 7:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 10:36 linux-next: net tree build warning Stephen Rothwell
2009-06-09 11:25 ` Wolfgang Grandegger
2009-06-09 11:26 ` David Miller
2009-06-09 13:14 ` Wolfgang Grandegger
2009-06-10 0:38 ` David Miller
2009-06-10 7:38 ` Wolfgang Grandegger [this message]
2009-06-10 8:12 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2009-11-30 5:40 Stephen Rothwell
2009-11-30 9:49 ` Andrei Pelinescu-Onciul
2009-11-12 2:24 Stephen Rothwell
2009-11-12 2:53 ` David Miller
2009-11-12 2:55 ` Eric Dumazet
2009-11-12 3:10 ` Stephen Rothwell
2009-11-05 2:30 Stephen Rothwell
[not found] <20090904144232.1f6ccf45.sfr@canb.auug.org.au>
2009-09-07 9:04 ` David Miller
2009-09-07 9:37 ` Stephen Rothwell
2009-09-04 4:28 Stephen Rothwell
2009-09-04 4:35 ` David Miller
2009-05-22 5:16 Stephen Rothwell
2009-05-22 6:30 ` David Miller
2009-05-22 8:20 ` Stephen Rothwell
2009-05-22 10:31 ` Neil Horman
2009-03-12 5:58 Stephen Rothwell
2009-03-12 6:24 ` David Miller
2009-03-12 6:42 ` Stephen Rothwell
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=4A2F630F.5020602@grandegger.com \
--to=wg@grandegger.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.