Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ming Lei and committed by
Greg Kroah-Hartman
40fcd88b 756a2eed

+2 -1
+2 -1
drivers/usb/storage/protocol.c
··· 152 152 return cnt; 153 153 154 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 158 if (dir == FROM_XFER_BUF) 158 159 memcpy(buffer + cnt, miter.addr, len);