staging: ozwpan: Simply if condition
authorRupesh Gujare <rupesh.gujare@atmel.com>
Tue, 13 Aug 2013 17:24:23 +0000 (18:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2013 21:13:43 +0000 (14:13 -0700)
Making code simpler for readability.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozhcd.c

index 5a417c833400d90fad1fd146c17b3d30d45f8b1a..4b658d4adabcb9630560a564fb7a2e91b52a1273 100644 (file)
@@ -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;
        }