Skip to contentSkip to conversation

Change ep93xx gpio_irq static inlines to macros

PATCH New H Hartley Sweeten 2 participants 2 messages Oct 5, 2009 1 message not in the archive

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

PATCH 1/1 Change ep93xx gpio_irq static inlines to macros

In reply to a message not in the archive

From: Ryan Mallon <[email protected]>

Change the gpio_to_irq and irq_to_gpio static inline functions to macros so that they can be used in variable initialisers.

---

This patch seems to have been lost, originally posted 4/19/2009. Updated so that the macro parameters are wrapped with ().

arch/arm/mach-ep93xx/include/mach/gpio.h +4 -12
index 0a1498a..c991b14 100644
@@ -114,17 +114,9 @@ extern void ep93xx_gpio_int_debounce(unsigned int irq, int enable);
  *          B0..B7  (7..15) to irq 72..79, and
  *          F0..F7 (16..24) to irq 80..87.
  */
-static inline int gpio_to_irq(unsigned gpio)
-{
-	if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ)
-		return 64 + gpio;
-
-	return -EINVAL;
-}
-
-static inline int irq_to_gpio(unsigned irq)
-{
-	return irq - gpio_to_irq(0);
-}
+#define gpio_to_irq(gpio)	\
+	(((gpio) <= EP93XX_GPIO_LINE_MAX_IRQ) ? (64 + (gpio)) : -EINVAL)
+
+#define irq_to_gpio(irq)	((irq) - gpio_to_irq(0))
 
 #endif 
#2 lore raw

PATCH 1/1 Change ep93xx gpio_irq static inlines to macros

Quoted 5 lines · H Hartley Sweeten

From: Ryan Mallon <[email protected]>

Change the gpio_to_irq and irq_to_gpio static inline functions to macros so that they can be used in variable initialisers.

Quoted 8 lines

---

This patch seems to have been lost, originally posted 4/19/2009. Updated so that the macro parameters are wrapped with ().

Thanks Hartley. I think this patch should still be okay, I don't think anything relies on these being functions.

Can you please submit to the patch system since you have the patch ready to go.

Thanks,
~Ryan

Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934