All of lore.kernel.org
 help / color / mirror / Atom feed
From: AlexChen <alex.chen@huawei.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	zhang.zhanghailiang@huawei.com, QEMU <qemu-devel@nongnu.org>,
	qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH] block/vvfat: Fix bad printf format specifiers
Date: Tue, 3 Nov 2020 17:38:43 +0800	[thread overview]
Message-ID: <5FA12523.5000603@huawei.com> (raw)
In-Reply-To: <20201103093007.GB5509@merkur.fritz.box>

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	other threads:[~2020-11-03  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 11:52 [PATCH] block/vvfat: Fix bad printf format specifiers AlexChen
2020-11-03  9:30 ` Kevin Wolf
2020-11-03  9:38   ` AlexChen [this message]

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=5FA12523.5000603@huawei.com \
    --to=alex.chen@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@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 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.