qemu-devel
[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: Kevin Wolf
Subject: Re: [PATCH] block/vvfat: Fix bad printf format specifiers
Date: Tue, 3 Nov 2020 10:30:07 +0100

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




reply via email to

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