aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-12-10 02:01:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-10 02:45:39 -0500
commit40fcd88b8d49fd911518190c985112097d3a8a17 (patch)
treec91584f3e159c9f0ed3218a4605d6c690394c452
parent756a2eed67e61e9596c2b49a787441c2e0daf1e1 (diff)
USB: storage: fix compile warning
This patch should fix the below compile warning: drivers/usb/storage/protocol.c: In function 'usb_stor_access_xfer_buf': drivers/usb/storage/protocol.c:155:22: warning: comparison of distinct pointer types lacks a cast [enabled by default] Reported-by: kbuild test robot <fengguang.wu@intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/storage/protocol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
index f54e5fea9230..12e3c2fac642 100644
--- a/drivers/usb/storage/protocol.c
+++ b/drivers/usb/storage/protocol.c
@@ -152,7 +152,8 @@ unsigned int usb_stor_access_xfer_buf(unsigned char *buffer,
152 return cnt; 152 return cnt;
153 153
154 while (sg_miter_next(&miter) && cnt < buflen) { 154 while (sg_miter_next(&miter) && cnt < buflen) {
155 unsigned int len = min(miter.length, buflen - cnt); 155 unsigned int len = min_t(unsigned int, miter.length,
156 buflen - cnt);
156 157
157 if (dir == FROM_XFER_BUF) 158 if (dir == FROM_XFER_BUF)
158 memcpy(buffer + cnt, miter.addr, len); 159 memcpy(buffer + cnt, miter.addr, len);