From: Kulikov Vasiliy <segooon@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Lior Dotan <liodot@gmail.com>, <charrer@alacritech.com>,
Denis Kirjanov <kirjanov@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jpirko@redhat.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] staging: slicoss: error handling with goto
Date: Sun, 27 Jun 2010 17:20:46 +0400 [thread overview]
Message-ID: <1277644847-16292-4-git-send-email-segooon@gmail.com> (raw)
In-Reply-To: <1277644847-16292-1-git-send-email-segooon@gmail.com>
This patch makes error handling more readable due to 'goto err' pattern.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 86bc733..d8c952e 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2646,22 +2646,21 @@ static int slic_upr_request(struct adapter *adapter,
u32 upr_data_h,
u32 upr_buffer, u32 upr_buffer_h)
{
- int status;
+ int rc;
spin_lock_irqsave(&adapter->upr_lock.lock, adapter->upr_lock.flags);
- status = slic_upr_queue_request(adapter,
+ rc = slic_upr_queue_request(adapter,
upr_request,
upr_data,
upr_data_h, upr_buffer, upr_buffer_h);
- if (status != 0) {
- spin_unlock_irqrestore(&adapter->upr_lock.lock,
- adapter->upr_lock.flags);
- return status;
- }
+ if (rc)
+ goto err_unlock_irq;
+
slic_upr_start(adapter);
+err_unlock_irq:
spin_unlock_irqrestore(&adapter->upr_lock.lock,
adapter->upr_lock.flags);
- return 0;
+ return rc;
}
static void slic_upr_request_complete(struct adapter *adapter, u32 isr)
--
1.7.0.4
next prev parent reply other threads:[~2010-06-27 13:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-27 13:20 [PATCH 1/5] staging: slicoss: Change return codes to -EYYY Kulikov Vasiliy
2010-06-27 13:20 ` [PATCH 3/5] staging: slicoss: Move NULL pointer assertion to else branch Kulikov Vasiliy
2010-07-08 20:11 ` Greg KH
2010-06-27 13:20 ` Kulikov Vasiliy [this message]
2010-06-27 13:20 ` [PATCH 5/5] staging: slicoss: error handling with goto Kulikov Vasiliy
2010-06-28 10:12 ` [PATCH 1/5] staging: slicoss: Change return codes to -EYYY Denis Kirjanov
2010-06-28 11:14 ` Kulikov Vasiliy
2010-06-28 14:12 ` Denis Kirjanov
2010-06-30 13:02 ` Kulikov Vasiliy
2010-06-30 13:02 ` Kulikov Vasiliy
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=1277644847-16292-4-git-send-email-segooon@gmail.com \
--to=segooon@gmail.com \
--cc=charrer@alacritech.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=jpirko@redhat.com \
--cc=kirjanov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liodot@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome