* [PATCH] [arch/arm/mach-pnx4008/gpio.c] duplication in if ... else if branches
@ 2008-02-10 15:11 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2008-02-10 15:11 UTC (permalink / raw)
To: vitalywool; +Cc: i2c, lkml
There is a duplication of code in the following section. Possibly it was
copy-pasted and it was forgotten to edit these lines? otherwise consider
removing the duplicate lines with the patch below.
---
Different if ... else if branches do the same, remove duplication
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/arm/mach-pnx4008/gpio.c b/arch/arm/mach-pnx4008/gpio.c
index 1ab84ce..7a3b190 100644
--- a/arch/arm/mach-pnx4008/gpio.c
+++ b/arch/arm/mach-pnx4008/gpio.c
@@ -122,16 +122,11 @@ int pnx4008_gpio_register_pin(unsigned short pin)
unsigned long bit = GPIO_BIT(pin);
int ret = -EBUSY; /* Already in use */
gpio_lock();
- if (GPIO_ISBID(pin)) {
- if (access_map[GPIO_INDEX] & bit)
- goto out;
- access_map[GPIO_INDEX] |= bit;
-
- } else if (GPIO_ISRAM(pin)) {
+ if (GPIO_ISBID(pin) || GPIO_ISRAM(pin)) {
if (access_map[GPIO_INDEX] & bit)
goto out;
access_map[GPIO_INDEX] |= bit;
} else if (GPIO_ISMUX(pin)) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-10 15:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-10 15:11 [PATCH] [arch/arm/mach-pnx4008/gpio.c] duplication in if ... else if branches Roel Kluin
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).