Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da13051c authored by Sarah Sharp's avatar Sarah Sharp
Browse files

USB: Remove bitmap #define from hcd.h



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: default avatarSarah 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>
parent 0b8ca72a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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,
+2 −2
Original line number Diff line number Diff line
@@ -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 (
+2 −2
Original line number Diff line number Diff line
@@ -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))
+2 −2
Original line number Diff line number Diff line
@@ -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;
}

+3 −3
Original line number Diff line number Diff line
@@ -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.
Loading