aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-12-15 11:56:29 -0800
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-03-13 18:07:08 -0700
commit518e848ea8e2932ce18ce2daef8ad5f55a145f27 (patch)
tree623b2a258580f6fd28584d83c276c133ed423a15 /drivers/usb/host/xhci-ring.c
parent1d5810b6923c76fc95e52d9d3491c91824c2f075 (diff)
downloadkernel_samsung_smdk4412-518e848ea8e2932ce18ce2daef8ad5f55a145f27.zip
kernel_samsung_smdk4412-518e848ea8e2932ce18ce2daef8ad5f55a145f27.tar.gz
kernel_samsung_smdk4412-518e848ea8e2932ce18ce2daef8ad5f55a145f27.tar.bz2
xhci: Rename variables and reduce register reads.
The xhci_bus_suspend() and xhci_bus_resume() functions are a bit hard to read, because they have an ambiguously named variable "port". Rename it to "port_index". Introduce a new temporary variable, "max_ports" that holds the maximum number of roothub ports the host controller supports. This will reduce the number of register reads, and make it easy to change the maximum number of ports when there are two roothubs. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index b36d3b0..3264d62 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1163,7 +1163,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
u32 port_id;
u32 temp, temp1;
u32 __iomem *addr;
- int ports;
+ int max_ports;
int slot_id;
/* Port status change events always have a successful completion code */
@@ -1174,8 +1174,8 @@ static void handle_port_status(struct xhci_hcd *xhci,
port_id = GET_PORT_ID(event->generic.field[0]);
xhci_dbg(xhci, "Port Status Change Event for port %d\n", port_id);
- ports = HCS_MAX_PORTS(xhci->hcs_params1);
- if ((port_id <= 0) || (port_id > ports)) {
+ max_ports = HCS_MAX_PORTS(xhci->hcs_params1);
+ if ((port_id <= 0) || (port_id > max_ports)) {
xhci_warn(xhci, "Invalid port id %d\n", port_id);
goto cleanup;
}