qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ssi: Fix bad printf format specifiers
@ 2020-11-04 10:22 AlexChen
  2020-11-04 16:21 ` Alistair Francis
  2020-11-04 21:39 ` Chubb, Peter (Data61, Kensington NSW)
  0 siblings, 2 replies; 4+ messages in thread
From: AlexChen @ 2020-11-04 10:22 UTC (permalink / raw)
  To: alistair, Peter Maydell, jcd, peter.chubb
  Cc: QEMU Trivial, qemu-arm, QEMU, zhang.zhanghailiang

We should use printf format specifier "%u" instead of "%d" for
argument of type "unsigned int".

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
---
 hw/ssi/imx_spi.c    | 2 +-
 hw/ssi/xilinx_spi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
index 7f703d8328..d8885ae454 100644
--- a/hw/ssi/imx_spi.c
+++ b/hw/ssi/imx_spi.c
@@ -53,7 +53,7 @@ static const char *imx_spi_reg_name(uint32_t reg)
     case ECSPI_MSGDATA:
         return  "ECSPI_MSGDATA";
     default:
-        sprintf(unknown, "%d ?", reg);
+        sprintf(unknown, "%u ?", reg);
         return unknown;
     }
 }
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
index fec8817d94..49ff275593 100644
--- a/hw/ssi/xilinx_spi.c
+++ b/hw/ssi/xilinx_spi.c
@@ -142,7 +142,7 @@ static void xlx_spi_update_irq(XilinxSPI *s)
        irq chain unless things really changed.  */
     if (pending != s->irqline) {
         s->irqline = pending;
-        DB_PRINT("irq_change of state %d ISR:%x IER:%X\n",
+        DB_PRINT("irq_change of state %u ISR:%x IER:%X\n",
                     pending, s->regs[R_IPISR], s->regs[R_IPIER]);
         qemu_set_irq(s->irq, pending);
     }
-- 
2.19.1


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

* Re: [PATCH] ssi: Fix bad printf format specifiers
  2020-11-04 10:22 [PATCH] ssi: Fix bad printf format specifiers AlexChen
@ 2020-11-04 16:21 ` Alistair Francis
  2020-11-04 17:58   ` Peter Maydell
  2020-11-04 21:39 ` Chubb, Peter (Data61, Kensington NSW)
  1 sibling, 1 reply; 4+ messages in thread
From: Alistair Francis @ 2020-11-04 16:21 UTC (permalink / raw)
  To: AlexChen
  Cc: Peter Maydell, Zhanghailiang, QEMU Trivial, Alistair Francis,
	QEMU, Jean-Christophe Dubois, qemu-arm, Peter Chubb

On Wed, Nov 4, 2020 at 2:23 AM AlexChen <alex.chen@huawei.com> wrote:
>
> We should use printf format specifier "%u" instead of "%d" for
> argument of type "unsigned int".
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Alex Chen <alex.chen@huawei.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/ssi/imx_spi.c    | 2 +-
>  hw/ssi/xilinx_spi.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
> index 7f703d8328..d8885ae454 100644
> --- a/hw/ssi/imx_spi.c
> +++ b/hw/ssi/imx_spi.c
> @@ -53,7 +53,7 @@ static const char *imx_spi_reg_name(uint32_t reg)
>      case ECSPI_MSGDATA:
>          return  "ECSPI_MSGDATA";
>      default:
> -        sprintf(unknown, "%d ?", reg);
> +        sprintf(unknown, "%u ?", reg);
>          return unknown;
>      }
>  }
> diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
> index fec8817d94..49ff275593 100644
> --- a/hw/ssi/xilinx_spi.c
> +++ b/hw/ssi/xilinx_spi.c
> @@ -142,7 +142,7 @@ static void xlx_spi_update_irq(XilinxSPI *s)
>         irq chain unless things really changed.  */
>      if (pending != s->irqline) {
>          s->irqline = pending;
> -        DB_PRINT("irq_change of state %d ISR:%x IER:%X\n",
> +        DB_PRINT("irq_change of state %u ISR:%x IER:%X\n",
>                      pending, s->regs[R_IPISR], s->regs[R_IPIER]);
>          qemu_set_irq(s->irq, pending);
>      }
> --
> 2.19.1
>


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

* Re: [PATCH] ssi: Fix bad printf format specifiers
  2020-11-04 16:21 ` Alistair Francis
@ 2020-11-04 17:58   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2020-11-04 17:58 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Zhanghailiang, QEMU Trivial, Alistair Francis, QEMU,
	Jean-Christophe Dubois, AlexChen, qemu-arm, Peter Chubb

On Wed, 4 Nov 2020 at 16:33, Alistair Francis <alistair23@gmail.com> wrote:
>
> On Wed, Nov 4, 2020 at 2:23 AM AlexChen <alex.chen@huawei.com> wrote:
> >
> > We should use printf format specifier "%u" instead of "%d" for
> > argument of type "unsigned int".
> >
> > Reported-by: Euler Robot <euler.robot@huawei.com>
> > Signed-off-by: Alex Chen <alex.chen@huawei.com>
>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>



Applied to target-arm.next, thanks.

-- PMM


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

* Re: [PATCH] ssi: Fix bad printf format specifiers
  2020-11-04 10:22 [PATCH] ssi: Fix bad printf format specifiers AlexChen
  2020-11-04 16:21 ` Alistair Francis
@ 2020-11-04 21:39 ` Chubb, Peter (Data61, Kensington NSW)
  1 sibling, 0 replies; 4+ messages in thread
From: Chubb, Peter (Data61, Kensington NSW) @ 2020-11-04 21:39 UTC (permalink / raw)
  To: AlexChen
  Cc: Peter Maydell, zhang.zhanghailiang, QEMU Trivial, alistair, QEMU,
	jcd, qemu-arm, peter.chubb

>>>>> "AlexChen" == AlexChen  <alex.chen@huawei.com> writes:

AlexChen> We should use printf format specifier "%u" instead of "%d"
AlexChen> for argument of type "unsigned int".

AlexChen> Reported-by: Euler Robot <euler.robot@huawei.com>
AlexChen>Signed-off-by: Alex Chen <alex.chen@huawei.com> ---

LGTM,
add
Reviewed-By: Peter Chubb <peter.chubb@data61.csiro.au>

-- 
Peter Chubb            Tel: +61 2 9490 5852      http://ts.data61.csiro.au/
Trustworthy Systems Group                                    CSIRO's Data61

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

end of thread, other threads:[~2020-11-04 21:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 10:22 [PATCH] ssi: Fix bad printf format specifiers AlexChen
2020-11-04 16:21 ` Alistair Francis
2020-11-04 17:58   ` Peter Maydell
2020-11-04 21:39 ` Chubb, Peter (Data61, Kensington NSW)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).