summaryrefslogtreecommitdiff
path: root/drivers/usb/usbip/vhci_sysfs.c
diff options
context:
space:
mode:
authorYuyang Du <yuyang.du@intel.com>2017-06-08 08:04:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-13 11:51:10 +0300
commitb891245bff79583b9c69b14b4429362a5d54096e (patch)
treeb4fb6991d5b1d79cc6e6283081ac6fad7b5e4b05 /drivers/usb/usbip/vhci_sysfs.c
parenta5c7f019c7d602c508b3eedc470568df4633c642 (diff)
downloadlinux-b891245bff79583b9c69b14b4429362a5d54096e.tar.xz
usbip: vhci-hcd: Clean up the code by adding a new macro
Each vhci has 2*VHCI_HC_PORTS ports, in which VHCI_HC_PORTS ports are HighSpeed (or below), and VHCI_HC_PORTS are SuperSpeed. This new macro VHCI_PORTS reflects this configuration. Signed-off-by: Yuyang Du <yuyang.du@intel.com> Acked-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/vhci_sysfs.c')
-rw-r--r--drivers/usb/usbip/vhci_sysfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c
index 3ad68ff4da2d..5778b640ba9c 100644
--- a/drivers/usb/usbip/vhci_sysfs.c
+++ b/drivers/usb/usbip/vhci_sysfs.c
@@ -92,7 +92,7 @@ static ssize_t status_show_vhci(int pdev_nr, char *out)
spin_lock(&vdev->ud.lock);
port_show_vhci(&out, HUB_SPEED_HIGH,
- pdev_nr * VHCI_HC_PORTS * 2 + i, vdev);
+ pdev_nr * VHCI_PORTS + i, vdev);
spin_unlock(&vdev->ud.lock);
}
@@ -101,7 +101,7 @@ static ssize_t status_show_vhci(int pdev_nr, char *out)
spin_lock(&vdev->ud.lock);
port_show_vhci(&out, HUB_SPEED_SUPER,
- pdev_nr * VHCI_HC_PORTS * 2 + VHCI_HC_PORTS + i, vdev);
+ pdev_nr * VHCI_PORTS + VHCI_HC_PORTS + i, vdev);
spin_unlock(&vdev->ud.lock);
}
@@ -117,7 +117,7 @@ static ssize_t status_show_not_ready(int pdev_nr, char *out)
for (i = 0; i < VHCI_HC_PORTS; i++) {
out += sprintf(out, "hs %04u %03u ",
- (pdev_nr * VHCI_HC_PORTS * 2) + i,
+ (pdev_nr * VHCI_PORTS) + i,
VDEV_ST_NOTASSIGNED);
out += sprintf(out, "000 00000000 0000000000000000 0-0");
out += sprintf(out, "\n");
@@ -125,7 +125,7 @@ static ssize_t status_show_not_ready(int pdev_nr, char *out)
for (i = 0; i < VHCI_HC_PORTS; i++) {
out += sprintf(out, "ss %04u %03u ",
- (pdev_nr * VHCI_HC_PORTS * 2) + VHCI_HC_PORTS + i,
+ (pdev_nr * VHCI_PORTS) + VHCI_HC_PORTS + i,
VDEV_ST_NOTASSIGNED);
out += sprintf(out, "000 00000000 0000000000000000 0-0");
out += sprintf(out, "\n");
@@ -176,7 +176,7 @@ static ssize_t nports_show(struct device *dev, struct device_attribute *attr,
/*
* Half the ports are for SPEED_HIGH and half for SPEED_SUPER, thus the * 2.
*/
- out += sprintf(out, "%d\n", VHCI_HC_PORTS * vhci_num_controllers * 2);
+ out += sprintf(out, "%d\n", VHCI_PORTS * vhci_num_controllers);
return out - s;
}
static DEVICE_ATTR_RO(nports);