SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH 4/4] sh/kexec: Fix kexec build warning
@ 2013-12-12  0:18 Geoff Levand
  2013-12-12 14:48 ` Geert Uytterhoeven
  2013-12-12 19:30 ` Geoff Levand
  0 siblings, 2 replies; 3+ messages in thread
From: Geoff Levand @ 2013-12-12  0:18 UTC (permalink / raw)
  To: linux-sh

Add a cast to a printk argument to suppress a type mismatch compiler warning.

Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
 arch/sh/kernel/machine_kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 9fea49f..b7e65a8 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -60,7 +60,7 @@ static void kexec_info(struct kimage *image)
 		       i,
 		       (unsigned int)image->segment[i].mem,
 		       (unsigned int)image->segment[i].mem +
-				     image->segment[i].memsz,
+		       (unsigned int)image->segment[i].memsz,
 		       (unsigned int)image->segment[i].memsz);
 	}
 	printk("  start     : 0x%08x\n\n", (unsigned int)image->start);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] sh/kexec: Fix kexec build warning
  2013-12-12  0:18 [PATCH 4/4] sh/kexec: Fix kexec build warning Geoff Levand
@ 2013-12-12 14:48 ` Geert Uytterhoeven
  2013-12-12 19:30 ` Geoff Levand
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2013-12-12 14:48 UTC (permalink / raw)
  To: linux-sh

Hi Geoff,

On Thu, Dec 12, 2013 at 1:18 AM, Geoff Levand <geoff@infradead.org> wrote:
> Add a cast to a printk argument to suppress a type mismatch compiler warning.
>
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
>  arch/sh/kernel/machine_kexec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
> index 9fea49f..b7e65a8 100644
> --- a/arch/sh/kernel/machine_kexec.c
> +++ b/arch/sh/kernel/machine_kexec.c
> @@ -60,7 +60,7 @@ static void kexec_info(struct kimage *image)
>                        i,
>                        (unsigned int)image->segment[i].mem,
>                        (unsigned int)image->segment[i].mem +
> -                                    image->segment[i].memsz,
> +                      (unsigned int)image->segment[i].memsz,
>                        (unsigned int)image->segment[i].memsz);
>         }
>         printk("  start     : 0x%08x\n\n", (unsigned int)image->start);

Wouldn't it be better to remove all casts and correct the printf-style
format specifiers instead?

  - mem and start are unsigned long, hence use "0x%08lx",
  - memsz is size_t, hence use "0x%08zx".

Gr{oetje,eeting}s,

                        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. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] sh/kexec: Fix kexec build warning
  2013-12-12  0:18 [PATCH 4/4] sh/kexec: Fix kexec build warning Geoff Levand
  2013-12-12 14:48 ` Geert Uytterhoeven
@ 2013-12-12 19:30 ` Geoff Levand
  1 sibling, 0 replies; 3+ messages in thread
From: Geoff Levand @ 2013-12-12 19:30 UTC (permalink / raw)
  To: linux-sh

Hi,

On Thu, 2013-12-12 at 15:48 +0100, Geert Uytterhoeven wrote:
> On Thu, Dec 12, 2013 at 1:18 AM, Geoff Levand <geoff@infradead.org> wrote:
> > -                                    image->segment[i].memsz,
> > +                      (unsigned int)image->segment[i].memsz,e->start);
> 
> Wouldn't it be better to remove all casts and correct the printf-style
> format specifiers instead?

That would be better, I'll make a new patch.

Thanks Geert!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-12 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12  0:18 [PATCH 4/4] sh/kexec: Fix kexec build warning Geoff Levand
2013-12-12 14:48 ` Geert Uytterhoeven
2013-12-12 19:30 ` Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox