Thread (12 messages) 12 messages, 2 authors, 2011-12-01

Re: [PATCH 6/8] powerpc/ps3: Fix pr_debug build warnings

flat view

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2011-11-30 20:57:48

Hi Geoff,

On Wed, Nov 30, 2011 at 02:38, Geoff Levand [off-list ref] wrote:
Fix some PS3 build warnings when DEBUG is defined.

Fixes warnings like these:

=C2=A0format '%lx' expects type 'long unsigned int', but argument 7 has t=
ype 'u64'
quoted hunk ↗ jump to hunk
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
=C2=A0arch/powerpc/platforms/ps3/repository.c | =C2=A0 14 ++++++++------
=C2=A01 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platf=
orms/ps3/repository.c
quoted hunk ↗ jump to hunk
index cb68729..2ce2782 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -1050,7 +1050,7 @@ int ps3_repository_dump_resource_info(const struct =
ps3_repository_device *repo)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pr_debug("%s:%d (%=
u:%u) reg_type %u, bus_addr %lxh, len %lxh\n",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0__func__, __LINE__, repo->bus_index, repo->dev_index,
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 reg_type, bus_addr, len);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 reg_type, (unsigned long)bus_addr, (unsigned long)len);
=C2=A0 =C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0 =C2=A0pr_debug(" <- %s:%d\n", __func__, __LINE__);
The correct way to format u64 is using the "ll" length modifier. That way y=
ou
don't need casts.

The code above was originally written before the u64 uniformization, when p=
pc64
was still using "unsigned long" for u64.

Gr{oetje,eeting}s,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0=C2=A0 -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help