All of lore.kernel.org
 help / color / mirror / Atom feed
From: Teck Choon Giam <giamteckchoon@gmail.com>
To: xen-devel@lists.xensource.com
Subject: Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a
Date: Sat, 30 Oct 2010 21:04:54 +0800	[thread overview]
Message-ID: <AANLkTikO3iFaof1LWmBONuAJP-4rnNtNq3nYzKiNiPF6@mail.gmail.com> (raw)

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

             reply	other threads:[~2010-10-30 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 13:04 Teck Choon Giam [this message]
2010-11-01 10:15 ` Fix format warning for drivers/xen/blktap/device.c for xen/stable-2.6.32.x pvops commit 6c72eadd151f6f1b904989532a83988af0ea661a 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

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=AANLkTikO3iFaof1LWmBONuAJP-4rnNtNq3nYzKiNiPF6@mail.gmail.com \
    --to=giamteckchoon@gmail.com \
    --cc=xen-devel@lists.xensource.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.