* [PATCH] Change ep93xx gpio_irq static inlines to macros
[not found] <49EBDE05.1050406@bluewatersys.com>
@ 2009-10-05 22:03 ` H Hartley Sweeten
2009-10-05 22:13 ` Ryan Mallon
0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2009-10-05 22:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Ryan Mallon <ryan@bluewatersys.com>
Change the gpio_to_irq and irq_to_gpio static inline functions to macros
so that they can be used in variable initialisers.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
This patch seems to have been lost, originally posted 4/19/2009.
Updated so that the macro parameters are wrapped with ().
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h
index 0a1498a..c991b14 100644
--- a/arch/arm/mach-ep93xx/include/mach/gpio.h
+++ b/arch/arm/mach-ep93xx/include/mach/gpio.h
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] Change ep93xx gpio_irq static inlines to macros
2009-10-05 22:03 ` [PATCH] Change ep93xx gpio_irq static inlines to macros H Hartley Sweeten
@ 2009-10-05 22:13 ` Ryan Mallon
0 siblings, 0 replies; 2+ messages in thread
From: Ryan Mallon @ 2009-10-05 22:13 UTC (permalink / raw)
To: linux-arm-kernel
H Hartley Sweeten wrote:
> From: Ryan Mallon <ryan@bluewatersys.com>
>
> Change the gpio_to_irq and irq_to_gpio static inline functions to macros
> so that they can be used in variable initialisers.
>
> Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>
> ---
>
> 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
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-05 22:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <49EBDE05.1050406@bluewatersys.com>
2009-10-05 22:03 ` [PATCH] Change ep93xx gpio_irq static inlines to macros H Hartley Sweeten
2009-10-05 22:13 ` Ryan Mallon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).