All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] xen-blkback: Change statistics counter types to unsigned
Date: Fri, 8 Mar 2013 13:43:01 -0500	[thread overview]
Message-ID: <20130308184301.GA31104@phenom.dumpdata.com> (raw)
In-Reply-To: <1362506372-19079-1-git-send-email-zoltan.kiss@citrix.com>

On Tue, Mar 05, 2013 at 05:59:32PM +0000, Zoltan Kiss wrote:
> These values shouldn't be negative, but after an overflow their value
> can turn into negative, if they are signed. xentop can show bogus
> values in this case.

I get this during compilation:

/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_oo_req’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:233: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_rd_req’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:234: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_wr_req’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:235: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_f_req’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:236: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_ds_req’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:237: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_rd_sect’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:238: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c: In function ‘show_wr_sect’:
/home/konrad/linux/drivers/block/xen-blkback/xenbus.c:239: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
  CC      block/bsg-lib.o
  CC      mm/dmapool.o
  CC      kernel/debug/debug_core.o
  CC      mm/hugetlb.o
  CC      mm/mempolicy.o
  CC      drivers/acpi/sleep.o
/home/konrad/linux/drivers/block/xen-blkback/blkback.c: In function ‘print_stats’:
/home/konrad/linux/drivers/block/xen-blkback/blkback.c:384: warning: format ‘%3d’ expects type ‘int’, but argument 3 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/blkback.c:384: warning: format ‘%4d’ expects type ‘int’, but argument 4 has type ‘long long unsigned int’
/home/konrad/linux/drivers/block/xen-blkback/blkback.c:384: warning: format ‘%4d’ expects type ‘int’, but argument 5 has type ‘lo

Could you fix it up please as one big patch if possible?

> 
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> Reported-by: Ichiro Ogino <ichiro.ogino@citrix.co.jp>
> ---
>  drivers/block/xen-blkback/common.h |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
> index 6072390..72d09ac 100644
> --- a/drivers/block/xen-blkback/common.h
> +++ b/drivers/block/xen-blkback/common.h
> @@ -208,13 +208,13 @@ struct xen_blkif {
>  
>  	/* statistics */
>  	unsigned long		st_print;
> -	int			st_rd_req;
> -	int			st_wr_req;
> -	int			st_oo_req;
> -	int			st_f_req;
> -	int			st_ds_req;
> -	int			st_rd_sect;
> -	int			st_wr_sect;
> +	unsigned long long			st_rd_req;
> +	unsigned long long			st_wr_req;
> +	unsigned long long			st_oo_req;
> +	unsigned long long			st_f_req;
> +	unsigned long long			st_ds_req;
> +	unsigned long long			st_rd_sect;
> +	unsigned long long			st_wr_sect;
>  
>  	wait_queue_head_t	waiting_to_free;
>  };
> -- 
> 1.7.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

  reply	other threads:[~2013-03-08 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 17:59 [PATCH 1/1] xen-blkback: Change statistics counter types to unsigned Zoltan Kiss
2013-03-08 18:43 ` Konrad Rzeszutek Wilk [this message]
2013-03-11 16:15   ` Zoltan Kiss
2013-03-11 16:16   ` Zoltan Kiss

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=20130308184301.GA31104@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zoltan.kiss@citrix.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.