From: Kevin Wolf <kwolf@redhat.com>
To: AlexChen <alex.chen@huawei.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 10:30:07 +0100 [thread overview]
Message-ID: <20201103093007.GB5509@merkur.fritz.box> (raw)
In-Reply-To: <5F9FF319.7060108@huawei.com>
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.
Kevin
next prev parent reply other threads:[~2020-11-03 9:31 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 [this message]
2020-11-03 9:38 ` AlexChen
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=20201103093007.GB5509@merkur.fritz.box \
--to=kwolf@redhat.com \
--cc=alex.chen@huawei.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 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).