]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
USB: Remove bitmap #define from hcd.h
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 30 Nov 2010 23:55:51 +0000 (15:55 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:07:07 +0000 (18:07 -0700)
Using a #define to redefine a common variable name is a bad thing,
especially when the #define is in a header.  include/linux/usb/hcd.h
redefined bitmap to DeviceRemovable to avoid typing a long field in the
hub descriptor.  This has unintended side effects for files like
drivers/usb/core/devio.c that include that file, since another header
included after hcd.h has different variables named bitmap.

Remove the bitmap #define and replace instances of it in the host
controller code.  Cleanup the spaces around function calls and square
brackets while we're at it.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Max Vozeler <mvz@vozeler.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Anton Vorontsov <avorontsov@mvista.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Martin Fuzzey <mfuzzey@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
15 files changed:
drivers/staging/usbip/vhci_hcd.c
drivers/usb/gadget/dummy_hcd.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/imx21-hcd.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp1362-hcd.c
drivers/usb/host/isp1760-hcd.c
drivers/usb/host/ohci-hub.c
drivers/usb/host/oxu210hp-hcd.c
drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/sl811-hcd.c
drivers/usb/host/u132-hcd.c
drivers/usb/host/xhci-hub.c
drivers/usb/wusbcore/rh.c
include/linux/usb/hcd.h

index a35fe61268de3e974f8ece7f2edb0bd1e28b0468..0fe7e49cdc37a980f0e42a9203794915177d6a00 100644 (file)
@@ -255,8 +255,8 @@ static inline void hub_descriptor(struct usb_hub_descriptor *desc)
        desc->wHubCharacteristics = (__force __u16)
                (__constant_cpu_to_le16(0x0001));
        desc->bNbrPorts = VHCI_NPORTS;
-       desc->bitmap[0] = 0xff;
-       desc->bitmap[1] = 0xff;
+       desc->DeviceRemovable[0] = 0xff;
+       desc->DeviceRemovable[1] = 0xff;
 }
 
 static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
index 13b9f47feecd6e3e4719444f8c730b9e2f2129dc..f2040e8af8b154bafac79f0cfe8cfe48397b88a7 100644 (file)
@@ -1593,8 +1593,8 @@ hub_descriptor (struct usb_hub_descriptor *desc)
        desc->bDescLength = 9;
        desc->wHubCharacteristics = cpu_to_le16(0x0001);
        desc->bNbrPorts = 1;
-       desc->bitmap [0] = 0xff;
-       desc->bitmap [1] = 0xff;
+       desc->DeviceRemovable[0] = 0xff;
+       desc->DeviceRemovable[1] = 0xff;
 }
 
 static int dummy_hub_control (
index ae0140dd9b9b59ff1518e77864832d99c28f8cdd..dfa1e1d371c8590086a31cfea64a1a303f713d71 100644 (file)
@@ -717,8 +717,8 @@ ehci_hub_descriptor (
        desc->bDescLength = 7 + 2 * temp;
 
        /* two bitmaps:  ports removable, and usb 1.0 legacy PortPwrCtrlMask */
-       memset (&desc->bitmap [0], 0, temp);
-       memset (&desc->bitmap [temp], 0xff, temp);
+       memset(&desc->DeviceRemovable[0], 0, temp);
+       memset(&desc->DeviceRemovable[temp], 0xff, temp);
 
        temp = 0x0008;                  /* per-port overcurrent reporting */
        if (HCS_PPC (ehci->hcs_params))
index b7dfda8a1d51c3a32121f05fe6fed1f950800c6d..2f180dfe5371fb1ff78ca44dad718df9baf88045 100644 (file)
@@ -1472,8 +1472,8 @@ static int get_hub_descriptor(struct usb_hcd *hcd,
                0x0010 |        /* No over current protection */
                0);
 
-       desc->bitmap[0] = 1 << 1;
-       desc->bitmap[1] = ~0;
+       desc->DeviceRemovable[0] = 1 << 1;
+       desc->DeviceRemovable[1] = ~0;
        return 0;
 }
 
index 0da7fc05f453756415e16299947bea7142408f58..2a60a50bc420250af5aaaaeca8c908d75acaebb2 100644 (file)
@@ -951,9 +951,9 @@ static void isp116x_hub_descriptor(struct isp116x *isp116x,
        /* Power switching, device type, overcurrent. */
        desc->wHubCharacteristics = cpu_to_le16((u16) ((reg >> 8) & 0x1f));
        desc->bPwrOn2PwrGood = (u8) ((reg >> 24) & 0xff);
-       /* two bitmaps:  ports removable, and legacy PortPwrCtrlMask */
-       desc->bitmap[0] = 0;
-       desc->bitmap[1] = ~0;
+       /* ports removable, and legacy PortPwrCtrlMask */
+       desc->DeviceRemovable[0] = 0;
+       desc->DeviceRemovable[1] = ~0;
 }
 
 /* Perform reset of a given port.
index 02b742df332a2827b44a736a180e72a002aa57cd..6dd94b997d972d381308614ae8235f4f101084ca 100644 (file)
@@ -1552,9 +1552,9 @@ static void isp1362_hub_descriptor(struct isp1362_hcd *isp1362_hcd,
        desc->wHubCharacteristics = cpu_to_le16((reg >> 8) & 0x1f);
        DBG(0, "%s: hubcharacteristics = %02x\n", __func__, cpu_to_le16((reg >> 8) & 0x1f));
        desc->bPwrOn2PwrGood = (reg >> 24) & 0xff;
-       /* two bitmaps:  ports removable, and legacy PortPwrCtrlMask */
-       desc->bitmap[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1;
-       desc->bitmap[1] = ~0;
+       /* ports removable, and legacy PortPwrCtrlMask */
+       desc->DeviceRemovable[0] = desc->bNbrPorts == 1 ? 1 << 1 : 3 << 1;
+       desc->DeviceRemovable[1] = ~0;
 
        DBG(3, "%s: exit\n", __func__);
 }
index c7c1e0aa0b8ec5447039842e9191eb270b22bd65..1c8de7666d6ae544ddfc1407dbe1f005b2f35e6a 100644 (file)
@@ -1751,9 +1751,9 @@ static void isp1760_hub_descriptor(struct isp1760_hcd *priv,
        temp = 1 + (ports / 8);
        desc->bDescLength = 7 + 2 * temp;
 
-       /* two bitmaps:  ports removable, and usb 1.0 legacy PortPwrCtrlMask */
-       memset(&desc->bitmap[0], 0, temp);
-       memset(&desc->bitmap[temp], 0xff, temp);
+       /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
+       memset(&desc->DeviceRemovable[0], 0, temp);
+       memset(&desc->DeviceRemovable[temp], 0xff, temp);
 
        /* per-port overcurrent reporting */
        temp = 0x0008;
index cddcda95b57930f40698e3d2752226b85b6fbd4b..cd4b74f27d06b4ec3b99abcba4bde6b08c86f197 100644 (file)
@@ -580,15 +580,15 @@ ohci_hub_descriptor (
            temp |= 0x0008;
        desc->wHubCharacteristics = (__force __u16)cpu_to_hc16(ohci, temp);
 
-       /* two bitmaps:  ports removable, and usb 1.0 legacy PortPwrCtrlMask */
+       /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
        rh = roothub_b (ohci);
-       memset(desc->bitmap, 0xff, sizeof(desc->bitmap));
-       desc->bitmap [0] = rh & RH_B_DR;
+       memset(desc->DeviceRemovable, 0xff, sizeof(desc->DeviceRemovable));
+       desc->DeviceRemovable[0] = rh & RH_B_DR;
        if (ohci->num_ports > 7) {
-               desc->bitmap [1] = (rh & RH_B_DR) >> 8;
-               desc->bitmap [2] = 0xff;
+               desc->DeviceRemovable[1] = (rh & RH_B_DR) >> 8;
+               desc->DeviceRemovable[2] = 0xff;
        } else
-               desc->bitmap [1] = 0xff;
+               desc->DeviceRemovable[1] = 0xff;
 }
 
 /*-------------------------------------------------------------------------*/
index e0cb12b573f910523e78c9240497e9744cb1c0ec..ad54a41447567f0a28a26214e993b27b726cede6 100644 (file)
@@ -451,9 +451,9 @@ static void ehci_hub_descriptor(struct oxu_hcd *oxu,
        temp = 1 + (ports / 8);
        desc->bDescLength = 7 + 2 * temp;
 
-       /* two bitmaps:  ports removable, and usb 1.0 legacy PortPwrCtrlMask */
-       memset(&desc->bitmap[0], 0, temp);
-       memset(&desc->bitmap[temp], 0xff, temp);
+       /* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
+       memset(&desc->DeviceRemovable[0], 0, temp);
+       memset(&desc->DeviceRemovable[temp], 0xff, temp);
 
        temp = 0x0008;                  /* per-port overcurrent reporting */
        if (HCS_PPC(oxu->hcs_params))
index 3076b1cc05df3508cc991425f3f39fe3ddb77222..98afe75500ccdd38d21a0ffef7d71b1539457249 100644 (file)
@@ -2150,8 +2150,8 @@ static void r8a66597_hub_descriptor(struct r8a66597 *r8a66597,
        desc->bDescLength = 9;
        desc->bPwrOn2PwrGood = 0;
        desc->wHubCharacteristics = cpu_to_le16(0x0011);
-       desc->bitmap[0] = ((1 << r8a66597->max_root_hub) - 1) << 1;
-       desc->bitmap[1] = ~0;
+       desc->DeviceRemovable[0] = ((1 << r8a66597->max_root_hub) - 1) << 1;
+       desc->DeviceRemovable[1] = ~0;
 }
 
 static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
index 2e9602a10e9bfe0ab267cb2bb09995f4f23b2796..f3899b334c73af0e0bea3a18c22001ee2c3a0428 100644 (file)
@@ -1111,9 +1111,9 @@ sl811h_hub_descriptor (
 
        desc->wHubCharacteristics = cpu_to_le16(temp);
 
-       /* two bitmaps:  ports removable, and legacy PortPwrCtrlMask */
-       desc->bitmap[0] = 0 << 1;
-       desc->bitmap[1] = ~0;
+       /* ports removable, and legacy PortPwrCtrlMask */
+       desc->DeviceRemovable[0] = 0 << 1;
+       desc->DeviceRemovable[1] = ~0;
 }
 
 static void
index fab764946c745fd141fe497c4ec5bfcc75788d2d..a659e1590bca5ee51bb053127d37611a47132aaf 100644 (file)
@@ -2604,13 +2604,13 @@ static int u132_roothub_descriptor(struct u132 *u132,
        retval = u132_read_pcimem(u132, roothub.b, &rh_b);
        if (retval)
                return retval;
-       memset(desc->bitmap, 0xff, sizeof(desc->bitmap));
-       desc->bitmap[0] = rh_b & RH_B_DR;
+       memset(desc->DeviceRemovable, 0xff, sizeof(desc->DeviceRemovable));
+       desc->DeviceRemovable[0] = rh_b & RH_B_DR;
        if (u132->num_ports > 7) {
-               desc->bitmap[1] = (rh_b & RH_B_DR) >> 8;
-               desc->bitmap[2] = 0xff;
+               desc->DeviceRemovable[1] = (rh_b & RH_B_DR) >> 8;
+               desc->DeviceRemovable[2] = 0xff;
        } else
-               desc->bitmap[1] = 0xff;
+               desc->DeviceRemovable[1] = 0xff;
        return 0;
 }
 
index 5d963e350494ee44983e6ac72428899e32db9a04..d83c27b9725bc99f5f9ed8aa1ea1392b478e2e62 100644 (file)
@@ -45,7 +45,6 @@ static void xhci_hub_descriptor(struct xhci_hcd *xhci,
        temp = 1 + (ports / 8);
        desc->bDescLength = 7 + 2 * temp;
 
-       /* Why does core/hcd.h define bitmap?  It's just confusing. */
        memset(&desc->DeviceRemovable[0], 0, temp);
        memset(&desc->DeviceRemovable[temp], 0xff, temp);
 
index 785772e66ed0f034d2ed57ea7f145174f19b9fe3..cff246b7cb26e255b0568a7afd81a05176866f31 100644 (file)
@@ -184,8 +184,8 @@ static int wusbhc_rh_get_hub_descr(struct wusbhc *wusbhc, u16 wValue,
        descr->bPwrOn2PwrGood = 0;
        descr->bHubContrCurrent = 0;
        /* two bitmaps:  ports removable, and usb 1.0 legacy PortPwrCtrlMask */
-       memset(&descr->bitmap[0], 0, temp);
-       memset(&descr->bitmap[temp], 0xff, temp);
+       memset(&descr->DeviceRemovable[0], 0, temp);
+       memset(&descr->DeviceRemovable[temp], 0xff, temp);
        return 0;
 }
 
index 8b65068c6af9604cdfd805605a7547616159da13..0be61970074e70022135d611ea1c31ee91102012 100644 (file)
@@ -639,13 +639,6 @@ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
 
 #endif /* CONFIG_USB_MON || CONFIG_USB_MON_MODULE */
 
-/*-------------------------------------------------------------------------*/
-
-/* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */
-/* bleech -- resurfaced in 2.4.11 or 2.4.12 */
-#define bitmap DeviceRemovable
-
-
 /*-------------------------------------------------------------------------*/
 
 /* random stuff */