From: AlexChen <alex.chen@huawei.com>
To: <alistair@alistair23.me>,
Peter Maydell <peter.maydell@linaro.org>, <jcd@tribudubois.net>,
<peter.chubb@nicta.com.au>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>, QEMU <qemu-devel@nongnu.org>,
zhang.zhanghailiang@huawei.com
Subject: [PATCH] ssi: Fix bad printf format specifiers
Date: Wed, 4 Nov 2020 18:22:45 +0800 [thread overview]
Message-ID: <5FA280F5.8060902@huawei.com> (raw)
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
next reply other threads:[~2020-11-04 10:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 10:22 AlexChen [this message]
2020-11-04 16:21 ` [PATCH] ssi: Fix bad printf format specifiers Alistair Francis
2020-11-04 17:58 ` Peter Maydell
2020-11-04 21:39 ` Chubb, Peter (Data61, Kensington NSW)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5FA280F5.8060902@huawei.com \
--to=alex.chen@huawei.com \
--cc=alistair@alistair23.me \
--cc=jcd@tribudubois.net \
--cc=peter.chubb@nicta.com.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).