Patchwork [2/2] mips_malta: Fix format strings

login
register
mail settings
Submitter Stefan Weil
Date Sept. 20, 2010, 8:18 p.m.
Message ID <1285013881-22169-2-git-send-email-weil@mail.berlios.de>
Download mbox | patch
Permalink /patch/65253/
State New
Headers show

Comments

Stefan Weil - Sept. 20, 2010, 8:18 p.m.
Fix two compiler warnings (when format attribute is applied).

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 hw/mips_malta.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Blue Swirl - Sept. 21, 2010, 7:48 p.m.
Thanks, applied.

On Mon, Sep 20, 2010 at 8:18 PM, Stefan Weil <weil@mail.berlios.de> wrote:
> Fix two compiler warnings (when format attribute is applied).
>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  hw/mips_malta.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/mips_malta.c b/hw/mips_malta.c
> index ec95cd8..1cb7880 100644
> --- a/hw/mips_malta.c
> +++ b/hw/mips_malta.c
> @@ -728,13 +728,13 @@ static int64_t load_kernel (void)
>     prom_size = ENVP_NB_ENTRIES * (sizeof(int32_t) + ENVP_ENTRY_SIZE);
>     prom_buf = qemu_malloc(prom_size);
>
> -    prom_set(prom_buf, prom_index++, loaderparams.kernel_filename);
> +    prom_set(prom_buf, prom_index++, "%s", loaderparams.kernel_filename);
>     if (initrd_size > 0) {
>         prom_set(prom_buf, prom_index++, "rd_start=0x%" PRIx64 " rd_size=%li %s",
>                  cpu_mips_phys_to_kseg0(NULL, initrd_offset), initrd_size,
>                  loaderparams.kernel_cmdline);
>     } else {
> -        prom_set(prom_buf, prom_index++, loaderparams.kernel_cmdline);
> +        prom_set(prom_buf, prom_index++, "%s", loaderparams.kernel_cmdline);
>     }
>
>     prom_set(prom_buf, prom_index++, "memsize");
> --
> 1.7.1
>
>

Patch

diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index ec95cd8..1cb7880 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -728,13 +728,13 @@  static int64_t load_kernel (void)
     prom_size = ENVP_NB_ENTRIES * (sizeof(int32_t) + ENVP_ENTRY_SIZE);
     prom_buf = qemu_malloc(prom_size);
 
-    prom_set(prom_buf, prom_index++, loaderparams.kernel_filename);
+    prom_set(prom_buf, prom_index++, "%s", loaderparams.kernel_filename);
     if (initrd_size > 0) {
         prom_set(prom_buf, prom_index++, "rd_start=0x%" PRIx64 " rd_size=%li %s",
                  cpu_mips_phys_to_kseg0(NULL, initrd_offset), initrd_size,
                  loaderparams.kernel_cmdline);
     } else {
-        prom_set(prom_buf, prom_index++, loaderparams.kernel_cmdline);
+        prom_set(prom_buf, prom_index++, "%s", loaderparams.kernel_cmdline);
     }
 
     prom_set(prom_buf, prom_index++, "memsize");