lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 03 Feb 2010 11:37:17 +0100
From:	Michal Nazarewicz <m.nazarewicz@...sung.com>
To:	Greg KH <greg@...ah.com>, Stephen Rothwell <sfr@...b.auug.org.au>
Cc:	linux-next@...r.kernel.org,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Michal Nazarewicz <m.nazarewicz@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: [PATCH] USB: g_mass_storage: min(...) warning fixed

From: Michal Nazarewicz <m.nazarewicz@...sung.com>

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

This fixes commit a736e2758c6390b854219e6f6bb4f9a0e3be66df.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@...sung.com>
Cc: Marek Szyprowski <m.nazarewicz@...sung.com>
Cc: Kyungmin Park <kyungmin.park@...sung.com>
---
 drivers/usb/gadget/f_mass_storage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Hello,

On Wed, 03 Feb 2010 06:57:26 +0100, Stephen Rothwell <sfr@...b.auug.org.au> wrote:

> today's linux-next build produced these warnings:
> 
> drivers/usb/gadget/f_mass_storage.c: In function 'fsg_setup':
> drivers/usb/gadget/f_mass_storage.c:623: warning: comparison of distinct pointer types lacks a cast
> 
> Introduced by commit a736e2758c6390b854219e6f6bb4f9a0e3be66df ("USB:
> g_mass_storage: superfluous and missing packets fixed").

Sorry about that.  Attached is patch fixing that.  I've overlooked the
fact that w_length is u16 not int.

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index b5a8902..b5cad39 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.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ