[PATCH] [arch/arm/mach-pnx4008/gpio.c] duplication in if ... else if branches

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <vitalywool@...>
Cc: <i2c@...>, lkml <linux-kernel@...>
Date: Sunday, February 10, 2008 - 11:11 am

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)) {
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [arch/arm/mach-pnx4008/gpio.c] duplication in if ......, Roel Kluin, (Sun Feb 10, 11:11 am)