Commit a3c97192 authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by Greg Kroah-Hartman

staging: ozwpan: Remove useless return variables

This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
- return ret;
+ return C;
// </smpl>
Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba910808
...@@ -2011,7 +2011,6 @@ static void oz_get_hub_descriptor(struct usb_hcd *hcd, ...@@ -2011,7 +2011,6 @@ static void oz_get_hub_descriptor(struct usb_hcd *hcd,
static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
{ {
struct oz_port *port; struct oz_port *port;
int err = 0;
u8 port_id = (u8)windex; u8 port_id = (u8)windex;
struct oz_hcd *ozhcd = oz_hcd_private(hcd); struct oz_hcd *ozhcd = oz_hcd_private(hcd);
unsigned set_bits = 0; unsigned set_bits = 0;
...@@ -2078,7 +2077,7 @@ static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) ...@@ -2078,7 +2077,7 @@ static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
spin_unlock_bh(&port->port_lock); spin_unlock_bh(&port->port_lock);
} }
oz_dbg(HUB, "Port[%d] status = 0x%x\n", port_id, port->status); oz_dbg(HUB, "Port[%d] status = 0x%x\n", port_id, port->status);
return err; return 0;
} }
/* /*
...@@ -2087,7 +2086,6 @@ static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) ...@@ -2087,7 +2086,6 @@ static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
{ {
struct oz_port *port; struct oz_port *port;
int err = 0;
u8 port_id = (u8)windex; u8 port_id = (u8)windex;
struct oz_hcd *ozhcd = oz_hcd_private(hcd); struct oz_hcd *ozhcd = oz_hcd_private(hcd);
unsigned clear_bits = 0; unsigned clear_bits = 0;
...@@ -2154,7 +2152,7 @@ static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) ...@@ -2154,7 +2152,7 @@ static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
} }
oz_dbg(HUB, "Port[%d] status = 0x%x\n", oz_dbg(HUB, "Port[%d] status = 0x%x\n",
port_id, ozhcd->ports[port_id-1].status); port_id, ozhcd->ports[port_id-1].status);
return err; return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment