All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l@tiscali.nl>
To: vitalywool@gmail.com
Cc: i2c@lm-sensors.org, lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] [arch/arm/mach-pnx4008/gpio.c] duplication in if ... else if branches
Date: Sun, 10 Feb 2008 16:11:14 +0100	[thread overview]
Message-ID: <47AF1412.4090908@tiscali.nl> (raw)

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)) {

                 reply	other threads:[~2008-02-10 15:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AF1412.4090908@tiscali.nl \
    --to=12o3l@tiscali.nl \
    --cc=i2c@lm-sensors.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vitalywool@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.