From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Alex Chen <alex.chen@huawei.com>,
quintela@redhat.com, pbonzini@redhat.com
Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org,
qemu-devel@nongnu.org, zhang.zhanghailiang@huawei.com
Subject: Re: [PATCH] display/vmware_vga: Fix bad printf format specifiers
Date: Thu, 19 Nov 2020 07:16:22 +0100 [thread overview]
Message-ID: <7eca99aa-54c9-de70-cb72-25cd6f805128@redhat.com> (raw)
In-Reply-To: <20201119030151.87393-1-alex.chen@huawei.com>
Hi Alex,
On 11/19/20 4:01 AM, Alex Chen 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>
> ---
> hw/display/vmware_vga.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index bef0d7d69a..f93bbe15c2 100644
> --- a/hw/display/vmware_vga.c
> +++ b/hw/display/vmware_vga.c
> @@ -534,7 +534,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
> #endif
> break;
> default:
> - fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n",
> + fprintf(stderr, "%s: unhandled bpp %u, using fallback cursor\n",
> __func__, c->bpp);
The format fix is correct, but since you change that line,
"fprintf(stderr)" is old code, nowadays we prefer get rid of it
by using warn_report() in place (see "qemu/error-report.h").
Preferably using warn_report():
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> cursor_put(qc);
> qc = cursor_builtin_left_ptr();
>
next prev parent reply other threads:[~2020-11-19 6:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 3:01 [PATCH] display/vmware_vga: Fix bad printf format specifiers Alex Chen
2020-11-19 6:16 ` Philippe Mathieu-Daudé [this message]
2020-11-19 9:18 ` Alex Chen
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=7eca99aa-54c9-de70-cb72-25cd6f805128@redhat.com \
--to=philmd@redhat.com \
--cc=alex.chen@huawei.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=quintela@redhat.com \
--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).