lkml.org 
[lkml]   [2008]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/6] usb: musb: - kill the compile warning
Date
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@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
drivers/usb/musb/musb_regs.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index 37f90f0..6f6b1f9 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -331,9 +331,9 @@ static inline u16 musb_read_hwvers(void __iomem *mbase)
return musb_readw(mbase, MUSB_HWVERS);
}

-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 (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

\
 
 \ /
  Last update: 2008-11-18 09:27    [W:0.037 / U:4.548 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site