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

Commit 09ce0c0c authored by Peter Chen's avatar Peter Chen Committed by Sarah Sharp
Browse files

usb: xhci: fix build warning



/home/b29397/work/code/git/linus/linux-2.6/drivers/usb/host/xhci-ring.c: In function ‘handle_port_status’:
/home/b29397/work/code/git/linus/linux-2.6/drivers/usb/host/xhci-ring.c:1580: warning: ‘hcd’ may be used uninitialized in this function

Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 8bb96604
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -1599,14 +1599,20 @@ static void handle_port_status(struct xhci_hcd *xhci,
	max_ports = HCS_MAX_PORTS(xhci->hcs_params1);
	max_ports = HCS_MAX_PORTS(xhci->hcs_params1);
	if ((port_id <= 0) || (port_id > max_ports)) {
	if ((port_id <= 0) || (port_id > max_ports)) {
		xhci_warn(xhci, "Invalid port id %d\n", port_id);
		xhci_warn(xhci, "Invalid port id %d\n", port_id);
		bogus_port_status = true;
		inc_deq(xhci, xhci->event_ring);
		goto cleanup;
		return;
	}
	}


	/* Figure out which usb_hcd this port is attached to:
	/* Figure out which usb_hcd this port is attached to:
	 * is it a USB 3.0 port or a USB 2.0/1.1 port?
	 * is it a USB 3.0 port or a USB 2.0/1.1 port?
	 */
	 */
	major_revision = xhci->port_array[port_id - 1];
	major_revision = xhci->port_array[port_id - 1];

	/* Find the right roothub. */
	hcd = xhci_to_hcd(xhci);
	if ((major_revision == 0x03) != (hcd->speed == HCD_USB3))
		hcd = xhci->shared_hcd;

	if (major_revision == 0) {
	if (major_revision == 0) {
		xhci_warn(xhci, "Event for port %u not in "
		xhci_warn(xhci, "Event for port %u not in "
				"Extended Capabilities, ignoring.\n",
				"Extended Capabilities, ignoring.\n",
@@ -1629,10 +1635,6 @@ static void handle_port_status(struct xhci_hcd *xhci,
	 * into the index into the ports on the correct split roothub, and the
	 * into the index into the ports on the correct split roothub, and the
	 * correct bus_state structure.
	 * correct bus_state structure.
	 */
	 */
	/* Find the right roothub. */
	hcd = xhci_to_hcd(xhci);
	if ((major_revision == 0x03) != (hcd->speed == HCD_USB3))
		hcd = xhci->shared_hcd;
	bus_state = &xhci->bus_state[hcd_index(hcd)];
	bus_state = &xhci->bus_state[hcd_index(hcd)];
	if (hcd->speed == HCD_USB3)
	if (hcd->speed == HCD_USB3)
		port_array = xhci->usb3_ports;
		port_array = xhci->usb3_ports;