[PATCH 179/220] USB: g_mass_storage: min(...) warning fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michal Nazarewicz <m.nazarewicz@xxxxxxxxxxx>

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 <sfr@xxxxxxxxxxxxxxxx>
Signed-off-by: Michal Nazarewicz <m.nazarewicz@xxxxxxxxxxx>
Cc: Marek Szyprowski <m.nazarewicz@xxxxxxxxxxx>
Cc: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/usb/gadget/f_mass_storage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 3c83550..0553d9a 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -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);
-- 
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux