From: Randy Dunlap <randy.dunlap@oracle.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>,
gregkh@suse.de, David Vrabel <david.vrabel@csr.com>
Cc: linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
lud <linux-usb@vger.kernel.org>
Subject: [PATCH] whci: fix type and format warnings
Date: Tue, 13 Oct 2009 10:01:28 -0700 [thread overview]
Message-ID: <20091013100128.0f06d67c.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20091013162312.8b93998b.sfr@canb.auug.org.au>
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix format and type warnings in whci driver:
drivers/usb/host/whci/qset.c:440: warning: comparison of distinct pointer types lacks a cast
drivers/usb/host/whci/qset.c:442: warning: format '%d' expects type 'int', but argument 6 has type 'size_t'
drivers/usb/host/whci/qset.c:488: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
drivers/usb/host/whci/qset.c:509: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'dma_addr_t'
drivers/usb/host/whci/qset.c:568: warning: comparison of distinct pointer types lacks a cast
drivers/usb/host/whci/qset.c:571: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
drivers/usb/host/whci/qset.c:590: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
drivers/usb/host/whci/qset.c:590: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
drivers/usb/host/whci/qset.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
--- linux-next-20091012.orig/drivers/usb/host/whci/qset.c
+++ linux-next-20091012/drivers/usb/host/whci/qset.c
@@ -437,9 +437,9 @@ static int qset_add_urb_sg(struct whc *w
}
dma_addr = sg_dma_address(sg);
- dma_remaining = min(sg_dma_len(sg), remaining);
+ dma_remaining = min_t(size_t, sg_dma_len(sg), remaining);
- dev_dbg(&whc->umc->dev, "adding sg[%d] %08x %d\n", i, (unsigned)dma_addr,
+ dev_dbg(&whc->umc->dev, "adding sg[%d] %08x %zu\n", i, (unsigned)dma_addr,
dma_remaining);
while (dma_remaining) {
@@ -485,7 +485,7 @@ static int qset_add_urb_sg(struct whc *w
dma_len = ep - dma_addr;
}
- dev_dbg(&whc->umc->dev, "adding %d\n", dma_len);
+ dev_dbg(&whc->umc->dev, "adding %zu\n", dma_len);
std->len += dma_len;
std->ntds_remaining = -1; /* filled in later */
@@ -506,7 +506,8 @@ static int qset_add_urb_sg(struct whc *w
}
for (;p < std->num_pointers; p++, entry++) {
- dev_dbg(&whc->umc->dev, "e[%d] %08x\n", p, dma_addr);
+ dev_dbg(&whc->umc->dev, "e[%d] %08llx\n", p,
+ (unsigned long long)dma_addr);
std->pl_virt[p].buf_ptr = cpu_to_le64(dma_addr);
dma_addr = (dma_addr + WHCI_PAGE_SIZE) & ~(WHCI_PAGE_SIZE-1);
}
@@ -565,10 +566,10 @@ static int qset_add_urb_sg_linearize(str
break;
}
- sg_remaining = min(remaining, sg->length);
+ sg_remaining = min_t(size_t, remaining, sg->length);
orig = sg_virt(sg);
- dev_dbg(&whc->umc->dev, "adding sg[%d] %d\n", i, sg_remaining);
+ dev_dbg(&whc->umc->dev, "adding sg[%d] %zu\n", i, sg_remaining);
while (sg_remaining) {
if (!std || std->len == max_std_len) {
@@ -587,7 +588,7 @@ static int qset_add_urb_sg_linearize(str
len = min(sg_remaining, max_std_len - std->len);
- dev_dbg(&whc->umc->dev, "added %d from sg[%d] @ offset %d\n",
+ dev_dbg(&whc->umc->dev, "added %zu from sg[%d] @ offset %td\n",
len, i, orig - sg_virt(sg));
if (is_out)
next prev parent reply other threads:[~2009-10-13 17:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 5:23 linux-next: Tree for October 13 Stephen Rothwell
2009-10-13 10:06 ` [BUILD-FAILURE] next-20091013 - s390x build breaks at mm/fault with !CONFIG_S390_EXEC_PROTECT Kamalesh Babulal
2009-10-13 10:33 ` Martin Schwidefsky
2009-10-13 10:57 ` Kamalesh Babulal
2009-10-13 16:28 ` [BUILD_FAILURE] next-20091013 s390x - build breaks SCLP VT220 terminal driver Kamalesh Babulal
2009-10-14 9:02 ` Martin Schwidefsky
2009-10-14 10:45 ` Martin Schwidefsky
2009-10-14 16:02 ` Kamalesh Babulal
2009-10-13 17:00 ` [PATCH] wan: pci200syn needs capability.h Randy Dunlap
2009-10-13 17:19 ` Krzysztof Halasa
2009-10-13 17:01 ` Randy Dunlap [this message]
[not found] ` <20091013100128.0f06d67c.randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2009-10-13 17:51 ` [PATCH] whci: fix type and format warnings David Vrabel
2009-10-13 18:07 ` Randy Dunlap
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=20091013100128.0f06d67c.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=david.vrabel@csr.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).