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-next>] [day] [month] [year] [list]
Message-Id: <1233915810-18616-1-git-send-email-cooloney@kernel.org>
Date:	Fri,  6 Feb 2009 18:23:30 +0800
From:	Bryan Wu <cooloney@...nel.org>
To:	felipe.balbi@...ia.com
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Bryan Wu <cooloney@...nel.org>,
	Mike Frysinger <vapier.adi@...il.com>
Subject: [PATCH] usb: musb: - kill the compile warning

drivers/usb/musb/musb_core.c:1433: warning: assignment makes pointer
from integer without a cast
	hw_ep->target_regs = musb_read_target_reg_base(i, mbase);

static inline u16 musb_read_target_reg_base(u8 i, void __iomem *mbase);

this is a common bug, but a bug still ?  mbase is a 32/64 bit pointer,
but we return a u16 to assign to a pointer ?  seems odd :)

So return right pointer in the stub.

Cc: Mike Frysinger <vapier.adi@...il.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
 drivers/usb/musb/musb_regs.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index de3b2f1..c2f6a16 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -333,7 +333,7 @@ static inline u16 musb_read_hwvers(void __iomem *mbase)
 
 static inline void __iomem *musb_read_target_reg_base(u8 i, void __iomem *mbase)
 {
-	return (MUSB_BUSCTL_OFFSET(i, 0) + mbase);
+	return (void __iomem *)(MUSB_BUSCTL_OFFSET(i, 0) + mbase);
 }
 
 static inline void musb_write_rxfunaddr(void __iomem *ep_target_regs,
@@ -473,9 +473,9 @@ static inline u16 musb_read_hwvers(void __iomem *mbase)
 	return 0;
 }
 
-static inline u16 musb_read_target_reg_base(u8 i, void __iomem *mbase)
+static inline void __iomem *musb_read_target_reg_base(u8 i, void __iomem *mbase)
 {
-	return 0;
+	return NULL;
 }
 
 static inline void musb_write_rxfunaddr(void __iomem *ep_target_regs,
-- 
1.5.6.3
--
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