Skip to contentSkip to conversation

Use __always_inline in orinoco_lock()/orinoco_unlock()

PATCH In review Pavel Roskin 3 participants 5 messages Aug 15, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use __always_inline in orinoco_lock()/orinoco_unlock()

From: Pavel Roskin <[email protected]>

This is exactly the case when they are needed. This also fixed a warning with -Wmissing-prototypes

---

 drivers/net/wireless/orinoco.h |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/wireless/orinoco.h +5 -7
index 16db3e1..8fd9b32 100644
@@ -135,11 +135,9 @@ extern irqreturn_t orinoco_interrupt(int
 /********************************************************************/
 
 /* These functions *must* be inline or they will break horribly on
- * SPARC, due to its weird semantics for save/restore flags. extern
- * inline should prevent the kernel from linking or module from
- * loading if they are not inlined. */
-extern inline int orinoco_lock(struct orinoco_private *priv,
-			       unsigned long *flags)
+ * SPARC, due to its weird semantics for save/restore flags. */
+static __always_inline int orinoco_lock(struct orinoco_private *priv,
+					unsigned long *flags)
 {
 	spin_lock_irqsave(&priv->lock, *flags);
 	if (priv->hw_unavailable) {
@@ -151,8 +149,8 @@ extern inline int orinoco_lock(struct or
 	return 0;
 }
 
-extern inline void orinoco_unlock(struct orinoco_private *priv,
-				  unsigned long *flags)
+static __always_inline void orinoco_unlock(struct orinoco_private *priv,
+					   unsigned long *flags)
 {
 	spin_unlock_irqrestore(&priv->lock, *flags);
 }
#1 lore raw
Quoted 5 lines · Pavel Roskin
drivers/net/wireless/orinoco.h +0 -0
index 16db3e1..8fd9b32 100644

drivers/net/wireless/orinoco.h extern irqreturn_t orinoco_interrupt(int · line 138

Quoted 9 lines
drivers/net/wireless/orinoco.h +1 -5
@@ -135,11 +135,9 @@ extern irqreturn_t orinoco_interrupt(int
 /********************************************************************/
 
 /* These functions *must* be inline or they will break horribly on
- * SPARC, due to its weird semantics for save/restore flags. extern
- * inline should prevent the kernel from linking or module from
- * loading if they are not inlined. */
-extern inline int orinoco_lock(struct orinoco_private *priv,
-			       unsigned long *flags)
+ * SPARC, due to its weird semantics for save/restore flags. */

Didn't that get fixed up for SPARC a year or so back?

Dave

Signature · 1 line
http://www.codemonkey.org.uk
maintainer
#2 lore raw

From: Dave Jones <[email protected]>
Date: Tue, 15 Aug 2006 18:50:12 -0400

Quoted 9 lines · Pavel Roskin
Quoted 8 lines
drivers/net/wireless/orinoco.h +0 -0
index 16db3e1..8fd9b32 100644
@@ -135,11 +135,9 @@ extern irqreturn_t orinoco_interrupt(int
 /********************************************************************/
 
Quoted 9 lines

drivers/net/wireless/orinoco.h extern irqreturn_t orinoco_interrupt(int · line 138

Quoted 7 lines
drivers/net/wireless/orinoco.h +1 -5
 /* These functions *must* be inline or they will break horribly on
- * SPARC, due to its weird semantics for save/restore flags. extern
- * inline should prevent the kernel from linking or module from
- * loading if they are not inlined. */
-extern inline int orinoco_lock(struct orinoco_private *priv,
-			       unsigned long *flags)
+ * SPARC, due to its weird semantics for save/restore flags. */

Didn't that get fixed up for SPARC a year or so back?

That's right, this problem no longer exists.

#3 lore raw
Quoted 11 lines · David Miller
Quoted 9 lines

drivers/net/wireless/orinoco.h extern irqreturn_t orinoco_interrupt(int · line 138

Quoted 7 lines

/* These functions *must* be inline or they will break horribly on
- * SPARC, due to its weird semantics for save/restore flags. extern
- * inline should prevent the kernel from linking or module from
- * loading if they are not inlined. */

drivers/net/wireless/orinoco.h +1 -2
-extern inline int orinoco_lock(struct orinoco_private *priv,
-			       unsigned long *flags)
+ * SPARC, due to its weird semantics for save/restore flags. */

Didn't that get fixed up for SPARC a year or so back?

That's right, this problem no longer exists.

Then, I guess, "static inline" would be just fine, right?

Signature · 2 lines
Regards,
Pavel Roskin
maintainer
#4 lore raw

From: Pavel Roskin <[email protected]>
Date: Tue, 15 Aug 2006 19:14:32 -0400

Quoted 9 lines · David Miller
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

/* These functions *must* be inline or they will break horribly on
- * SPARC, due to its weird semantics for save/restore flags. extern
- * inline should prevent the kernel from linking or module from
- * loading if they are not inlined. */

drivers/net/wireless/orinoco.h +1 -2
-extern inline int orinoco_lock(struct orinoco_private *priv,
-			       unsigned long *flags)
+ * SPARC, due to its weird semantics for save/restore flags. */
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Didn't that get fixed up for SPARC a year or so back?

That's right, this problem no longer exists.

Then, I guess, "static inline" would be just fine, right?

Yep.