From: Rupesh Gujare <rupesh.gujare@atmel.com>
To: <devel@linuxdriverproject.org>
Cc: <dan.carpenter@oracle.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <gregkh@linuxfoundation.org>
Subject: [PATCH 03/10] staging: ozwpan: Simply if condition
Date: Tue, 13 Aug 2013 18:24:23 +0100 [thread overview]
Message-ID: <1376414670-23257-4-git-send-email-rupesh.gujare@atmel.com> (raw)
In-Reply-To: <1376414670-23257-1-git-send-email-rupesh.gujare@atmel.com>
Making code simpler for readability.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
drivers/staging/ozwpan/ozhcd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 5a417c8..4b658d4 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -478,7 +478,7 @@ static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir,
struct urb *urb, u8 req_id)
{
struct oz_urb_link *urbl;
- struct oz_endpoint *ep;
+ struct oz_endpoint *ep = NULL;
int err = 0;
if (ep_addr >= OZ_NB_ENDPOINTS) {
@@ -506,11 +506,12 @@ static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir,
oz_free_urb_link(urbl);
return 0;
}
- if (in_dir && port->in_ep[ep_addr])
+
+ if (in_dir)
ep = port->in_ep[ep_addr];
- else if (!in_dir && port->out_ep[ep_addr])
+ else
ep = port->out_ep[ep_addr];
- else {
+ if (!ep) {
err = -ENOMEM;
goto out;
}
--
1.7.9.5
next prev parent reply other threads:[~2013-08-13 17:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 17:24 [PATCH 00/10] staging: ozwpan: Coding style fixes Rupesh Gujare
2013-08-13 17:24 ` [PATCH 01/10] staging: ozwpan: Add a blank line between declaraction and code Rupesh Gujare
2013-08-13 17:24 ` [PATCH 02/10] staging: ozwpan: Add a blank line between functions & declarations Rupesh Gujare
2013-08-13 17:24 ` Rupesh Gujare [this message]
2013-08-13 17:24 ` [PATCH 04/10] staging: ozwpan: Fix coding style Rupesh Gujare
2013-08-13 23:02 ` [PATCH 00/10] staging: ozwpan: Coding style fixes Dan Carpenter
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=1376414670-23257-4-git-send-email-rupesh.gujare@atmel.com \
--to=rupesh.gujare@atmel.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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
all inboxes | Powered by JetHome®