public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@kernel.org>
To: felipe.balbi@nokia.com, linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 4/4] usb: musb: use static inline functions to replace the macros in Blackfin version
Date: Mon, 10 Nov 2008 11:25:15 +0800	[thread overview]
Message-ID: <1226287515-27247-5-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1226287515-27247-1-git-send-email-cooloney@kernel.org>

As Mike pointed out, "these should be static inline's so that side
effects in function usage dont get messed up.  for example, if someone
used a ++ or -- or = operator in the argument list."

So I fixed all musb stubs here, but remain clk_xxx stubs because it needs to
define struck clk. IMO, we might add clk support in the future.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/usb/musb/musb_regs.h |   76 +++++++++++++++++++++++++++++++++---------
 1 files changed, 60 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index 3e50aef..37f90f0 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -447,22 +447,66 @@ static inline void  musb_write_txhubport(void __iomem *mbase, u8 epnum,
 #define clk_enable(clock)	do {} while (0)
 #define clk_disable(clock)	do {} while (0)
 
-#define musb_write_txfifosz(mbase, c_size)	do {} while (0)
-#define musb_write_txfifoadd(mbase, c_off)	do {} while (0)
-#define musb_write_rxfifosz(mbase, c_size)	do {} while (0)
-#define musb_write_rxfifoadd(mbase, c_off)	do {} while (0)
-
-#define musb_read_configdata(mbase)	0
-#define musb_read_hwvers(mbase)		0
-#define musb_read_target_reg_base(i, mbase)	0
-
-#define musb_write_rxfunaddr(ep_target_regs, qh_addr_reg)	do {} while (0)
-#define musb_write_rxhubaddr(ep_target_regs, qh_h_addr_reg)	do {} while (0)
-#define musb_write_rxhubport(ep_target_regs, qh_h_port_reg)	do {} while (0)
-
-#define musb_write_txfunaddr(mbase, epnum, qh_addr_reg)		do {} while (0)
-#define musb_write_txhubaddr(mbase, epnum, qh_h_addr_reg)	do {} while (0)
-#define musb_write_txhubport(mbase, epnum, qh_h_port_reg)	do {} while (0)
+static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size)
+{
+}
+
+static inline void musb_write_txfifoadd(void __iomem *mbase, u16 c_off)
+{
+}
+
+static inline void musb_write_rxfifosz(void __iomem *mbase, u8 c_size)
+{
+}
+
+static inline void  musb_write_rxfifoadd(void __iomem *mbase, u16 c_off)
+{
+}
+
+static inline u8 musb_read_configdata(void __iomem *mbase)
+{
+	return 0;
+}
+
+static inline u16 musb_read_hwvers(void __iomem *mbase)
+{
+	return 0;
+}
+
+static inline u16 musb_read_target_reg_base(u8 i, void __iomem *mbase)
+{
+	return 0;
+}
+
+static inline void musb_write_rxfunaddr(void __iomem *ep_target_regs,
+		u8 qh_addr_req)
+{
+}
+
+static inline void musb_write_rxhubaddr(void __iomem *ep_target_regs,
+		u8 qh_h_addr_reg)
+{
+}
+
+static inline void musb_write_rxhubport(void __iomem *ep_target_regs,
+		u8 qh_h_port_reg)
+{
+}
+
+static inline void  musb_write_txfunaddr(void __iomem *mbase, u8 epnum,
+		u8 qh_addr_reg)
+{
+}
+
+static inline void  musb_write_txhubaddr(void __iomem *mbase, u8 epnum,
+		u8 qh_addr_reg)
+{
+}
+
+static inline void  musb_write_txhubport(void __iomem *mbase, u8 epnum,
+		u8 qh_h_port_reg)
+{
+}
 
 #endif /* CONFIG_BLACKFIN */
 
-- 
1.5.6.3

  parent reply	other threads:[~2008-11-10  3:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-10  3:25 [PATCH 0/4] usb/musb Blackfin updates Bryan Wu
2008-11-10  3:25 ` [PATCH 1/4] usb: musb: add Blackfin specific configuration to MUSB (add missing file changes) Bryan Wu
2008-11-10  3:25 ` [PATCH 2/4] usb: musb: Blackfin provides read/write I/O accessor in header files Bryan Wu
2008-11-10  3:25 ` [PATCH 3/4] usb: musb: Kill some compiling warning in musb Blackfin part Bryan Wu
2008-11-10  3:25 ` Bryan Wu [this message]
2008-11-13  3:01 ` [PATCH 0/4] usb/musb Blackfin updates Bryan Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226287515-27247-5-git-send-email-cooloney@kernel.org \
    --to=cooloney@kernel.org \
    --cc=felipe.balbi@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox