[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1339057498-5256-1-git-send-email-magomez@igalia.com>
Date: Thu, 7 Jun 2012 10:24:50 +0200
From: Miguel Gómez <magomez@...lia.com>
To: gregkh@...uxfoundation.org, siglesias@...lia.com,
dan.carpenter@...cle.com
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Miguel Gómez <magomez@...lia.com>
Subject: [PATCH 1/9] Staging: ipack/bridges/tpci200: remove gotos in tpci200_free_irq().
Handle error conditions with simple returns instead of usig gotos.
Signed-off-by: Miguel Gómez <magomez@...lia.com>
---
drivers/staging/ipack/bridges/tpci200.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c
index c39499a..31f6b5d 100644
--- a/drivers/staging/ipack/bridges/tpci200.c
+++ b/drivers/staging/ipack/bridges/tpci200.c
@@ -512,24 +512,19 @@ static void __tpci200_free_irq(struct tpci200_board *tpci200,
static int tpci200_free_irq(struct ipack_device *dev)
{
- int res;
struct slot_irq *slot_irq;
struct tpci200_board *tpci200;
tpci200 = check_slot(dev);
- if (tpci200 == NULL) {
- res = -EINVAL;
- goto out;
- }
+ if (tpci200 == NULL)
+ return -EINVAL;
- if (mutex_lock_interruptible(&tpci200->mutex)) {
- res = -ERESTARTSYS;
- goto out;
- }
+ if (mutex_lock_interruptible(&tpci200->mutex))
+ return -ERESTARTSYS;
if (tpci200->slots[dev->slot].irq == NULL) {
- res = -EINVAL;
- goto out_unlock;
+ mutex_unlock(&tpci200->mutex);
+ return -EINVAL;
}
__tpci200_free_irq(tpci200, dev);
@@ -537,10 +532,7 @@ static int tpci200_free_irq(struct ipack_device *dev)
tpci200->slots[dev->slot].irq = NULL;
kfree(slot_irq);
-out_unlock:
- mutex_unlock(&tpci200->mutex);
-out:
- return res;
+ return 0;
}
static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists