[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a



On Sat, 2010-10-30 at 14:04 +0100, Teck Choon Giam wrote:
> Hi,
> 
> Anyone can check whether the below patch is fine?  Basically I just
> cast the type accordingly and won't know it is right or not... ...

It seems to be the pattern used in the (very small number of) other
places which want to print a sector_t so I think it is OK.

Please add a Signed-off-by as described in
Documentation/SubmittingPatches.

Thanks,
Ian.

> 
> Fix below warnings with gcc version 4.1.2 20080704 (Red Hat 4.1.2-48):
> 
> drivers/xen/blktap/device.c: In function âblktap_device_createâ:
> drivers/xen/blktap/device.c:869: warning: format â%lluâ expects type
> âlong long unsigned intâ, but argument 5 has type âsector_tâ
> drivers/xen/blktap/device.c: In function âblktap_device_debugâ:
> drivers/xen/blktap/device.c:898: warning: format â%lluâ expects type
> âlong long unsigned intâ, but argument 4 has type âsector_tâ
> 
> Patch below:
> 
> ====================================================================
> 
> --- a/drivers/xen/blktap/device.c     2010-10-30 20:39:57.000000000 +0800
> +++ b/drivers/xen/blktap/device.c     2010-10-30 20:43:08.000000000 +0800
> @@ -867,7 +867,7 @@
>       set_bit(BLKTAP_DEVICE, &tap->dev_inuse);
> 
>       dev_info(disk_to_dev(gd), "sector-size: %u capacity: %llu\n",
> -              queue_logical_block_size(rq), get_capacity(gd));
> +              queue_logical_block_size(rq), (unsigned long 
> long)get_capacity(gd));
> 
>       return 0;
> 
> @@ -895,7 +895,7 @@
> 
>       s += snprintf(s, end - s,
>                     "disk capacity:%llu sector size:%u\n",
> -                   get_capacity(disk), queue_logical_block_size(q));
> +                   (unsigned long long)get_capacity(disk), 
> queue_logical_block_size(q));
> 
>       s += snprintf(s, end - s,
>                     "queue flags:%#lx plugged:%d stopped:%d empty:%d\n",
> 
> 
> ====================================================================
> 
> Thanks.
> 
> Kindest regards,
> Giam Teck Choon
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.