[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465393566-946-1-git-send-email-jarr@innercoder.com>
Date: Wed, 8 Jun 2016 08:46:06 -0500
From: Jaime Arrocha <jarr@...ercoder.com>
To: gregkh@...uxfoundation.org
Cc: liodot@...il.com, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, charrer@...critech.com,
Jaime Arrocha <jarr@...ercoder.com>
Subject: [PATCH] staging: slicoss: replacement of goto statements
From: Jaime Arrocha <jarr@...ercoder.com>
Replaced deprecated goto statements.
Signed-off-by: Jaime Arrocha <jarr@...ercoder.com>
---
drivers/staging/slicoss/slicoss.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index ac126d4..cc45f4c 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -1457,30 +1457,30 @@ static struct slic_hostcmd *slic_cmdq_getfree(struct adapter *adapter)
struct slic_hostcmd *cmd = NULL;
unsigned long flags;
-lock_and_retry:
spin_lock_irqsave(&cmdq->lock, flags);
-retry:
cmd = cmdq->head;
- if (cmd) {
- cmdq->head = cmd->next;
- cmdq->count--;
- spin_unlock_irqrestore(&cmdq->lock, flags);
- } else {
+ while (!cmd) {
slic_cmdq_getdone(adapter);
cmd = cmdq->head;
- if (cmd) {
- goto retry;
- } else {
+ if (cmd)
+ continue;
+ else {
u32 *pageaddr;
spin_unlock_irqrestore(&cmdq->lock, flags);
pageaddr = slic_cmdqmem_addpage(adapter);
if (pageaddr) {
slic_cmdq_addcmdpage(adapter, pageaddr);
- goto lock_and_retry;
+ spin_lock_irqsave(&cmdq->lock, flags);
+ cmd = cmdq->head;
+ continue;
}
+ return cmd;
}
}
+ cmdq->head = cmd->next;
+ cmdq->count--;
+ spin_unlock_irqrestore(&cmdq->lock, flags);
return cmd;
}
--
2.1.4
Powered by blists - more mailing lists