All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
@ 2010-10-30 13:04 Teck Choon Giam
  2010-11-01 10:15 ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Teck Choon Giam @ 2010-10-30 13:04 UTC (permalink / raw)
  To: xen-devel

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... ...

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
  2010-10-30 13:04 Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a Teck Choon Giam
@ 2010-11-01 10:15 ` Ian Campbell
  2010-11-02 13:49   ` Teck Choon Giam
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2010-11-01 10:15 UTC (permalink / raw)
  To: Teck Choon Giam; +Cc: xen-devel

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@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
  2010-11-01 10:15 ` Ian Campbell
@ 2010-11-02 13:49   ` Teck Choon Giam
  2010-11-02 13:50     ` Teck Choon Giam
  0 siblings, 1 reply; 6+ messages in thread
From: Teck Choon Giam @ 2010-11-02 13:49 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Hi Ian,

On Mon, Nov 1, 2010 at 6:15 PM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> 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.
>

Ok.  I will try to post the format as described in
Documentation/SubmittingPatches in next post/reply.  Hopefully gmail
won't screwed up the format though... ...

Thanks for your time ;)

Kindest regards,
Giam Teck Choon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
  2010-11-02 13:49   ` Teck Choon Giam
@ 2010-11-02 13:50     ` Teck Choon Giam
  2010-11-09 11:19       ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Teck Choon Giam @ 2010-11-02 13:50 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

From: Giam Teck Choon <giamteckchoon@gmail.com>

Fix compilation format warning in drivers/xen/blktap/device.c

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’

Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>
---
 drivers/xen/blktap/device.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/blktap/device.c b/drivers/xen/blktap/device.c
index e4fc23e..8f1d3a9 100644
--- a/drivers/xen/blktap/device.c
+++ b/drivers/xen/blktap/device.c
@@ -867,7 +867,8 @@ blktap_device_create(struct blktap *tap, struct
blktap_params *params)
 	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 +896,8 @@ blktap_device_debug(struct blktap *tap, char *buf,
size_t size)

 	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",

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
  2010-11-02 13:50     ` Teck Choon Giam
@ 2010-11-09 11:19       ` Ian Campbell
  2010-11-09 19:01         ` Daniel Stodden
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2010-11-09 11:19 UTC (permalink / raw)
  To: Teck Choon Giam; +Cc: Daniel, Jeremy Fitzhardinge, xen-devel, Stodden

On Tue, 2010-11-02 at 13:50 +0000, Teck Choon Giam wrote:
> From: Giam Teck Choon <giamteckchoon@gmail.com>
> 
> Fix compilation format warning in drivers/xen/blktap/device.c
> 
> 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’
> 
> Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>

Seems reasonable to me.

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---
>  drivers/xen/blktap/device.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/xen/blktap/device.c b/drivers/xen/blktap/device.c
> index e4fc23e..8f1d3a9 100644
> --- a/drivers/xen/blktap/device.c
> +++ b/drivers/xen/blktap/device.c
> @@ -867,7 +867,8 @@ blktap_device_create(struct blktap *tap, struct
> blktap_params *params)
>  	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 +896,8 @@ blktap_device_debug(struct blktap *tap, char *buf,
> size_t size)
> 
>  	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",

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
  2010-11-09 11:19       ` Ian Campbell
@ 2010-11-09 19:01         ` Daniel Stodden
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Stodden @ 2010-11-09 19:01 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Jeremy Fitzhardinge, xen-devel, Teck Choon Giam

On Tue, 2010-11-09 at 06:19 -0500, Ian Campbell wrote:
> On Tue, 2010-11-02 at 13:50 +0000, Teck Choon Giam wrote:
> > From: Giam Teck Choon <giamteckchoon@gmail.com>
> > 
> > Fix compilation format warning in drivers/xen/blktap/device.c
> > 
> > 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’
> > 
> > Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>
> 
> Seems reasonable to me.

Sure.

Building without large device support is rarely asked for, but why not.

Daniel

> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> > ---
> >  drivers/xen/blktap/device.c |    6 ++++--
> >  1 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/xen/blktap/device.c b/drivers/xen/blktap/device.c
> > index e4fc23e..8f1d3a9 100644
> > --- a/drivers/xen/blktap/device.c
> > +++ b/drivers/xen/blktap/device.c
> > @@ -867,7 +867,8 @@ blktap_device_create(struct blktap *tap, struct
> > blktap_params *params)
> >  	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 +896,8 @@ blktap_device_debug(struct blktap *tap, char *buf,
> > size_t size)
> > 
> >  	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",
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-09 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 13:04 Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a Teck Choon Giam
2010-11-01 10:15 ` Ian Campbell
2010-11-02 13:49   ` Teck Choon Giam
2010-11-02 13:50     ` Teck Choon Giam
2010-11-09 11:19       ` Ian Campbell
2010-11-09 19:01         ` Daniel Stodden

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.