Patchwork [1/1] Fix compilation: format string - acb->sector_num is long long

login
register
mail settings
Submitter Peter Lemenkov
Date Sept. 22, 2010, 7:33 p.m.
Message ID <1285184023-27762-1-git-send-email-lemenkov@gmail.com>
Download mbox | patch
Permalink /patch/65447/
State New
Headers show

Comments

Peter Lemenkov - Sept. 22, 2010, 7:33 p.m.
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
 block/blkverify.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Blue Swirl - Sept. 22, 2010, 7:44 p.m.
On Wed, Sep 22, 2010 at 7:33 PM, Peter Lemenkov <lemenkov@gmail.com> wrote:
> Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
> ---
>  block/blkverify.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/block/blkverify.c b/block/blkverify.c
> index 4202685..033eab2 100644
> --- a/block/blkverify.c
> +++ b/block/blkverify.c
> @@ -58,7 +58,7 @@ static void blkverify_err(BlkverifyAIOCB *acb, const char *fmt, ...)
>     va_list ap;
>
>     va_start(ap, fmt);
> -    fprintf(stderr, "blkverify: %s sector_num=%ld nb_sectors=%d ",
> +    fprintf(stderr, "blkverify: %s sector_num=%lld nb_sectors=%d ",

It's not 'long long' but int64_t, so the correct format is
...sector_num=%" PRId64 " nb_sectors=...
Anthony Liguori - Sept. 22, 2010, 7:47 p.m.
On 09/22/2010 02:33 PM, Peter Lemenkov wrote:
> Signed-off-by: Peter Lemenkov<lemenkov@gmail.com>
> ---
>   block/blkverify.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/block/blkverify.c b/block/blkverify.c
> index 4202685..033eab2 100644
> --- a/block/blkverify.c
> +++ b/block/blkverify.c
> @@ -58,7 +58,7 @@ static void blkverify_err(BlkverifyAIOCB *acb, const char *fmt, ...)
>       va_list ap;
>
>       va_start(ap, fmt);
> -    fprintf(stderr, "blkverify: %s sector_num=%ld nb_sectors=%d ",
> +    fprintf(stderr, "blkverify: %s sector_num=%lld nb_sectors=%d ",
>               acb->is_write ? "write" : "read", acb->sector_num,
>    

It's not a long long, it's a PRId64.  I've updated appropriately.

Regards,

Anthony Liguori

>               acb->nb_sectors);
>       vfprintf(stderr, fmt, ap);
>

Patch

diff --git a/block/blkverify.c b/block/blkverify.c
index 4202685..033eab2 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -58,7 +58,7 @@  static void blkverify_err(BlkverifyAIOCB *acb, const char *fmt, ...)
     va_list ap;
 
     va_start(ap, fmt);
-    fprintf(stderr, "blkverify: %s sector_num=%ld nb_sectors=%d ",
+    fprintf(stderr, "blkverify: %s sector_num=%lld nb_sectors=%d ",
             acb->is_write ? "write" : "read", acb->sector_num,
             acb->nb_sectors);
     vfprintf(stderr, fmt, ap);