[Cbe-oss-dev] [PATCH 6/8] powerpc/ps3: Fix pr_debug build warnings
Geert Uytterhoeven
geert at linux-m68k.org
Thu Dec 1 07:57:48 EST 2011
Hi Geoff,
On Wed, Nov 30, 2011 at 02:38, Geoff Levand <geoff at infradead.org> wrote:
> Fix some PS3 build warnings when DEBUG is defined.
>
> Fixes warnings like these:
>
> format '%lx' expects type 'long unsigned int', but argument 7 has type 'u64'
>
> Signed-off-by: Geoff Levand <geoff at infradead.org>
> ---
> arch/powerpc/platforms/ps3/repository.c | 14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
> 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)
>
> pr_debug("%s:%d (%u:%u) reg_type %u, bus_addr %lxh, len %lxh\n",
> __func__, __LINE__, repo->bus_index, repo->dev_index,
> - reg_type, bus_addr, len);
> + reg_type, (unsigned long)bus_addr, (unsigned long)len);
> }
>
> pr_debug(" <- %s:%d\n", __func__, __LINE__);
The correct way to format u64 is using the "ll" length modifier. That way you
don't need casts.
The code above was originally written before the u64 uniformization, when ppc64
was still using "unsigned long" for u64.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
More information about the cbe-oss-dev
mailing list