* [PATCH] hw/arm: Fix bad print format specifiers
@ 2020-11-02 9:55 AlexChen
2020-11-19 2:27 ` Alex Chen
2020-11-20 16:40 ` Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: AlexChen @ 2020-11-02 9:55 UTC (permalink / raw)
To: balrogg, Peter Maydell; +Cc: QEMU Trivial, qemu-arm, QEMU, zhang.zhanghailiang
We should use printf format specifier "%u" instead of "%i" for
argument of type "unsigned int".
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
---
hw/arm/pxa2xx.c | 2 +-
hw/arm/spitz.c | 2 +-
hw/arm/tosa.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 591776ba88..1a98f3bd5c 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -675,7 +675,7 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr,
if (value & SSCR0_MOD)
printf("%s: Attempt to use network mode\n", __func__);
if (s->enable && SSCR0_DSS(value) < 4)
- printf("%s: Wrong data size: %i bits\n", __func__,
+ printf("%s: Wrong data size: %u bits\n", __func__,
SSCR0_DSS(value));
if (!(value & SSCR0_SSE)) {
s->sssr = 0;
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 32bdeacfd3..772662f149 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -586,7 +586,7 @@ struct SpitzLCDTG {
static void spitz_bl_update(SpitzLCDTG *s)
{
if (s->bl_power && s->bl_intensity)
- zaurus_printf("LCD Backlight now at %i/63\n", s->bl_intensity);
+ zaurus_printf("LCD Backlight now at %u/63\n", s->bl_intensity);
else
zaurus_printf("LCD Backlight now off\n");
}
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index fe88ed89fe..66b244aeff 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -150,7 +150,7 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value)
{
- fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
+ fprintf(stderr, "TG: %u %02x\n", value >> 5, value & 0x1f);
return 0;
}
--
2.19.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm: Fix bad print format specifiers
2020-11-02 9:55 [PATCH] hw/arm: Fix bad print format specifiers AlexChen
@ 2020-11-19 2:27 ` Alex Chen
2020-11-20 16:40 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Alex Chen @ 2020-11-19 2:27 UTC (permalink / raw)
To: balrogg, Peter Maydell; +Cc: QEMU Trivial, qemu-arm, QEMU, zhang.zhanghailiang
Kindly ping.
On 2020/11/2 17:55, AlexChen wrote:
> We should use printf format specifier "%u" instead of "%i" for
> argument of type "unsigned int".
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Alex Chen <alex.chen@huawei.com>
> ---
> hw/arm/pxa2xx.c | 2 +-
> hw/arm/spitz.c | 2 +-
> hw/arm/tosa.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
> index 591776ba88..1a98f3bd5c 100644
> --- a/hw/arm/pxa2xx.c
> +++ b/hw/arm/pxa2xx.c
> @@ -675,7 +675,7 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr,
> if (value & SSCR0_MOD)
> printf("%s: Attempt to use network mode\n", __func__);
> if (s->enable && SSCR0_DSS(value) < 4)
> - printf("%s: Wrong data size: %i bits\n", __func__,
> + printf("%s: Wrong data size: %u bits\n", __func__,
> SSCR0_DSS(value));
> if (!(value & SSCR0_SSE)) {
> s->sssr = 0;
> diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
> index 32bdeacfd3..772662f149 100644
> --- a/hw/arm/spitz.c
> +++ b/hw/arm/spitz.c
> @@ -586,7 +586,7 @@ struct SpitzLCDTG {
> static void spitz_bl_update(SpitzLCDTG *s)
> {
> if (s->bl_power && s->bl_intensity)
> - zaurus_printf("LCD Backlight now at %i/63\n", s->bl_intensity);
> + zaurus_printf("LCD Backlight now at %u/63\n", s->bl_intensity);
> else
> zaurus_printf("LCD Backlight now off\n");
> }
> diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
> index fe88ed89fe..66b244aeff 100644
> --- a/hw/arm/tosa.c
> +++ b/hw/arm/tosa.c
> @@ -150,7 +150,7 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
>
> static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value)
> {
> - fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
> + fprintf(stderr, "TG: %u %02x\n", value >> 5, value & 0x1f);
> return 0;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/arm: Fix bad print format specifiers
2020-11-02 9:55 [PATCH] hw/arm: Fix bad print format specifiers AlexChen
2020-11-19 2:27 ` Alex Chen
@ 2020-11-20 16:40 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2020-11-20 16:40 UTC (permalink / raw)
To: AlexChen; +Cc: QEMU Trivial, qemu-arm, QEMU, zhanghailiang
On Mon, 2 Nov 2020 at 09:56, AlexChen <alex.chen@huawei.com> wrote:
>
> We should use printf format specifier "%u" instead of "%i" for
> argument of type "unsigned int".
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Alex Chen <alex.chen@huawei.com>
> ---
> hw/arm/pxa2xx.c | 2 +-
> hw/arm/spitz.c | 2 +-
> hw/arm/tosa.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
Applied to target-arm.next for 5.2, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-20 16:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 9:55 [PATCH] hw/arm: Fix bad print format specifiers AlexChen
2020-11-19 2:27 ` Alex Chen
2020-11-20 16:40 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.