USB: g_mass_storage: min(...) warning fixed

This patch fixes warning caused by calling min() macro
with arguments of different types:

  drivers/usb/gadget/f_mass_storage.c:623: warning: \
  comparison of distinct pointer types lacks a cast

Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Michal Nazarewicz <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Kyungmin Park <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Michal Nazarewicz 2010-02-03 11:37:17 +01:00 • committed by Greg Kroah-Hartman
commit d7e18a9f2c

View file

@ -620,7 +620,7 @@ static int fsg_setup(struct usb_function *f,
*(u8 *) req->buf = fsg->common->nluns - 1;
/* Respond with data/status */
req->length = min(1, w_length);
req->length = min((u16)1, w_length);
fsg->common->ep0req_name =
ctrl->bRequestType & USB_DIR_IN ? "ep0-in" : "ep0-out";
return ep0_queue(fsg->common);