From: Ming Lei Date: Tue, 10 Dec 2013 07:01:42 +0000 (+0800) Subject: USB: storage: fix compile warning X-Git-Tag: v3.14-rc1~148^2~94^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40fcd88b8d49fd911518190c985112097d3a8a17;p=kernel%2Fkernel-generic.git 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 Reported-by: Stephen Rothwell Signed-off-by: Ming Lei Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c index f54e5fe..12e3c2f 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, return cnt; while (sg_miter_next(&miter) && cnt < buflen) { - unsigned int len = min(miter.length, buflen - cnt); + unsigned int len = min_t(unsigned int, miter.length, + buflen - cnt); if (dir == FROM_XFER_BUF) memcpy(buffer + cnt, miter.addr, len);