Skip to contentSkip to conversation

drivers/net/wireless/orinoco.h: "extern inline" -> "static inline"

PATCH In review Adrian Bunk 2 participants 3 messages Nov 18, 2005

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

PATCH 1/1 drivers/net/wireless/orinoco.h: "extern inline" -> "static inline"

"extern inline" doesn't make much sense.

---

 drivers/net/wireless/orinoco.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/orinoco.h renamed from drivers/net/wireless/orinoco.h.old +2 -2
@@ -155,7 +155,7 @@
  * 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,
+static inline int orinoco_lock(struct orinoco_private *priv,
 			       unsigned long *flags)
 {
 	spin_lock_irqsave(&priv->lock, *flags);
@@ -168,7 +168,7 @@
 	return 0;
 }
 
-extern inline void orinoco_unlock(struct orinoco_private *priv,
+static inline void orinoco_unlock(struct orinoco_private *priv,
 				  unsigned long *flags)
 {
 	spin_unlock_irqrestore(&priv->lock, *flags);
#1 lore raw
Quoted 1 line · Adrian Bunk

"extern inline" doesn't make much sense.

Yes it does. "extern inline" tells gcc not to fall back to out of line version if it can't inline the function. These functions *must* by inlined, or they'll break horribly on Sparc, at least.

Quoted 21 lines
drivers/net/wireless/orinoco.h renamed from drivers/net/wireless/orinoco.h.old +2 -2
@@ -155,7 +155,7 @@
  * 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,
+static inline int orinoco_lock(struct orinoco_private *priv,
 			       unsigned long *flags)
 {
 	spin_lock_irqsave(&priv->lock, *flags);
@@ -168,7 +168,7 @@
 	return 0;
 }
 
-extern inline void orinoco_unlock(struct orinoco_private *priv,
+static inline void orinoco_unlock(struct orinoco_private *priv,
 				  unsigned long *flags)
 {
 	spin_unlock_irqrestore(&priv->lock, *flags);
Signature · 11 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
#2 lore raw
Quoted 7 lines · David Gibson
Quoted 1 line · Adrian Bunk

"extern inline" doesn't make much sense.

Yes it does. "extern inline" tells gcc not to fall back to out of line version if it can't inline the function. These functions *must* by inlined, or they'll break horribly on Sparc, at least.
...

For any non-ancient gcc and !alpha, we are already telling gcc via __attribute__((always_inline)) that it should abort compilation if it can't inline the function.

The problem is that "extern inline" gives warnings with -Wmissing-prototypes, and I want to add this flag to the CFLAGS since it helps us to avoid a class of nasty runtime errors.

Quoted 1 line

David Gibson

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed