[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] display/vmware_vga: Fix bad printf format specifiers
From: |
Alex Chen |
Subject: |
Re: [PATCH] display/vmware_vga: Fix bad printf format specifiers |
Date: |
Thu, 19 Nov 2020 17:18:54 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
Hi Philippe,
On 2020/11/19 14:16, Philippe Mathieu-Daudé wrote:
> 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").
>
Thanks for your review, since fprintf() is used elsewhere in vmware_vga.c,
I will send a new patch to replace all fprintf() with warn_report() in
vmware_vga.c.
In addition, is there better to use error_report() instead of warn_report()
here?
Thanks,
Alex