qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] block/vvfat: Fix bad printf format specifiers


From: AlexChen
Subject: Re: [PATCH] block/vvfat: Fix bad printf format specifiers
Date: Tue, 3 Nov 2020 17:38:43 +0800
User-agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

On 2020/11/3 17:30, Kevin Wolf wrote:
> Am 02.11.2020 um 12:52 hat AlexChen geschrieben:
>> We should use printf format specifier "%u" instead of "%d" for
>> argument of type "unsigned int".
>> In addition, fix two error format problems found by checkpatch.pl:
>> ERROR: space required after that ',' (ctx:VxV)
>> +        fprintf(stderr,"%s attributes=0x%02x begin=%u size=%d\n",
>>                        ^
>> ERROR: line over 90 characters
>> +        fprintf(stderr, "%d, %s (%u, %d)\n", i, commit->path ? commit->path 
>> : "(null)", commit->param.rename.cluster, commit->action);
>>
>> Reported-by: Euler Robot <euler.robot@huawei.com>
>> Signed-off-by: Alex Chen <alex.chen@huawei.com>
>> ---
>>  block/vvfat.c | 12 +++++++-----
>>  1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/block/vvfat.c b/block/vvfat.c
>> index 5abb90e7c7..cc2ec9af21 100644
>> --- a/block/vvfat.c
>> +++ b/block/vvfat.c
>> @@ -1437,7 +1437,7 @@ static void print_direntry(const direntry_t* direntry)
>>          for(i=0;i<11;i++)
>>              ADD_CHAR(direntry->name[i]);
>>          buffer[j] = 0;
>> -        fprintf(stderr,"%s attributes=0x%02x begin=%d size=%d\n",
>> +        fprintf(stderr, "%s attributes=0x%02x begin=%u size=%d\n",
>>                  buffer,
>>                  direntry->attributes,
>>                  begin_of_direntry(direntry),le32_to_cpu(direntry->size));
> 
> direntry->size is unsigned, too, so if we want to fix this, I think we
> should fix both specifiers.
> 
> The rest of the patch looks good.
> 

Thanks for your review, I will fix it in my patch V2.

Thanks,
Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]