[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xen: Fix format string
From: |
Paul Durrant |
Subject: |
Re: [Qemu-devel] [PATCH] xen: Fix format string |
Date: |
Wed, 16 Jan 2019 12:03:42 +0000 |
> -----Original Message-----
> From: Philippe Mathieu-Daudé [mailto:address@hidden
> Sent: 16 January 2019 12:01
> To: address@hidden
> Cc: Paul Durrant <address@hidden>; Anthony Perard
> <address@hidden>; Max Reitz <address@hidden>; qemu-
> address@hidden; Stefano Stabellini <address@hidden>; xen-
> address@hidden; Kevin Wolf <address@hidden>; Philippe
> Mathieu-Daudé <address@hidden>
> Subject: [PATCH] xen: Fix format string
>
> Trivial format string fix to solve:
>
> hw/block/xen-block.c: In function 'xen_block_realize':
> hw/block/xen-block.c:218:53: error: format '%lu' expects argument of
> type 'long unsigned int', but argument 4 has type 'int64_t {aka long long
> int}' [-Werror=format=]
> xen_device_backend_printf(xendev, "sectors", "%lu",
> ^
> blk_getlength(conf->blk) /
> conf->logical_block_size);
>
> blk_getlength() returns an int64_t.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Paul Durrant <address@hidden>
> ---
> hw/block/xen-block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
> index be28b63442..3cf215b730 100644
> --- a/hw/block/xen-block.c
> +++ b/hw/block/xen-block.c
> @@ -215,7 +215,7 @@ static void xen_block_realize(XenDevice *xendev, Error
> **errp)
>
> xen_device_backend_printf(xendev, "sector-size", "%u",
> conf->logical_block_size);
> - xen_device_backend_printf(xendev, "sectors", "%lu",
> + xen_device_backend_printf(xendev, "sectors", "%lld",
> blk_getlength(conf->blk) /
> conf->logical_block_size);
>
> --
> 2.17.2