ssi: Fix bad printf format specifiers
Subsystems (2)
PATCH 1/1 ssi: Fix bad printf format specifiers
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int".
Reported-by Euler Robot <[email protected]>
Signed-off-by Alex Chen <[email protected]>
--- hw/ssi/imx_spi.c | 2 +- hw/ssi/xilinx_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/ssi/imx_spi.c +1 -1
@@ -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; } }
hw/ssi/xilinx_spi.c +1 -1
@@ -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); }
Signature · 1 line
2.19.1
Quoted 6 lines · AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int".
Reported-by Euler Robot <[email protected]>Signed-off-by Alex Chen <[email protected]>
Reviewed-by Alistair Francis <[email protected]>
Alistair
Quoted 34 lines
--- hw/ssi/imx_spi.c | 2 +- hw/ssi/xilinx_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)hw/ssi/imx_spi.c +1
-1@@ -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; } }hw/ssi/xilinx_spi.c +1
-2@@ -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
Peter Maydell
AppliedQuoted 10 lines · Alistair Francis
Quoted 6 lines · AlexChen
We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int".
Reported-by Euler Robot <[email protected]>Signed-off-by Alex Chen <[email protected]>Reviewed-by Alistair Francis <[email protected]>
Applied to target-arm.next, thanks.
-- PMM
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"AlexChen" == AlexChen <[email protected]> writes:
AlexChen> We should use printf format specifier "%u" instead of "%d" AlexChen> for argument of type "unsigned int".
AlexChen> Reported-by: Euler Robot <[email protected]> AlexChen>Signed-off-by: Alex Chen <[email protected]> ---
LGTM,
add
Reviewed-by Peter Chubb <[email protected]>
Signature · 2 lines
Peter Chubb Tel: +61 2 9490 5852 http://ts.data61.csiro.au/ Trustworthy Systems Group CSIRO's Data61