From: Deng-Cheng Zhu <dengcheng....@imgtec.com>

The logic "len = (x)" in OK(x) is dead. Clean it up.

Reviewed-by: James Hogan <james.ho...@imgtec.com>
Signed-off-by: Deng-Cheng Zhu <dengcheng....@imgtec.com>
---
 drivers/usb/host/uhci-hub.c |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index 9189bc9..e72973b 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -75,8 +75,6 @@ static inline int get_hub_status_data(struct uhci_hcd *uhci, 
char *buf)
        return !!*buf;
 }
 
-#define OK(x)                  len = (x); break
-
 #define CLR_RH_PORTSTAT(x) \
        status = uhci_readw(uhci, port_addr);   \
        status &= ~(RWC_BITS|WZ_BITS); \
@@ -258,7 +256,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
 
        case GetHubStatus:
                *(__le32 *)buf = cpu_to_le32(0);
-               OK(4);          /* hub power */
+               break; /* hub power */
        case GetPortStatus:
                if (port >= uhci->rh_numports)
                        goto err;
@@ -311,13 +309,13 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
 
                *(__le16 *)buf = cpu_to_le16(wPortStatus);
                *(__le16 *)(buf + 2) = cpu_to_le16(wPortChange);
-               OK(4);
+               break;
        case SetHubFeature:             /* We don't implement these */
        case ClearHubFeature:
                switch (wValue) {
                case C_HUB_OVER_CURRENT:
                case C_HUB_LOCAL_POWER:
-                       OK(0);
+                       break;
                default:
                        goto err;
                }
@@ -329,7 +327,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
                switch (wValue) {
                case USB_PORT_FEAT_SUSPEND:
                        SET_RH_PORTSTAT(USBPORTSC_SUSP);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_RESET:
                        SET_RH_PORTSTAT(USBPORTSC_PR);
 
@@ -338,10 +336,10 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
 
                        /* USB v2.0 7.1.7.5 */
                        uhci->ports_timeout = jiffies + msecs_to_jiffies(50);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_POWER:
                        /* UHCI has no power switching */
-                       OK(0);
+                       break;
                default:
                        goto err;
                }
@@ -356,10 +354,10 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
 
                        /* Disable terminates Resume signalling */
                        uhci_finish_suspend(uhci, port, port_addr);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_C_ENABLE:
                        CLR_RH_PORTSTAT(USBPORTSC_PEC);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_SUSPEND:
                        if (!(uhci_readw(uhci, port_addr) & USBPORTSC_SUSP)) {
 
@@ -382,22 +380,22 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
                                        uhci->ports_timeout = jiffies +
                                                msecs_to_jiffies(20);
                        }
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_C_SUSPEND:
                        clear_bit(port, &uhci->port_c_suspend);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_POWER:
                        /* UHCI has no power switching */
                        goto err;
                case USB_PORT_FEAT_C_CONNECTION:
                        CLR_RH_PORTSTAT(USBPORTSC_CSC);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_C_OVER_CURRENT:
                        CLR_RH_PORTSTAT(USBPORTSC_OCC);
-                       OK(0);
+                       break;
                case USB_PORT_FEAT_C_RESET:
                        /* this driver won't report these */
-                       OK(0);
+                       break;
                default:
                        goto err;
                }
@@ -407,7 +405,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
                memcpy(buf, root_hub_hub_des, len);
                if (len > 2)
                        buf[2] = uhci->rh_numports;
-               OK(len);
+               break;
        default:
 err:
                retval = -EPIPE;
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to