提交 c88db160 编写于 作者: S Sarah Sharp

xhci: Fix DIV_ROUND_UP compile error.

Fengguang reports that the xHCI driver isn't linked properly on his
machine:

ERROR: "__udivdi3" [drivers/usb/host/xhci-hcd.ko] undefined!
ERROR: "handle_edge_irq" [drivers/gpio/gpio-pch.ko] undefined!
ERROR: "irq_to_desc" [drivers/gpio/gpio-pch.ko] undefined!

The driver compiles fine on my 64-bit box (gcc version 4.6.1).
Fengguang thinks it's because the xHCI driver was using DIV_ROUND_UP()
instead of DIV_ROUND_UP_ULL() with arguments that were unsigned long
long variables.
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: NWu Fengguang <wfg@linux.intel.com>
上级 b01bcbf7
...@@ -3956,7 +3956,7 @@ static u16 xhci_calculate_intel_u1_timeout(struct usb_device *udev, ...@@ -3956,7 +3956,7 @@ static u16 xhci_calculate_intel_u1_timeout(struct usb_device *udev,
/* Otherwise the calculation is the same as isoc eps */ /* Otherwise the calculation is the same as isoc eps */
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
timeout_ns = xhci_service_interval_to_ns(desc); timeout_ns = xhci_service_interval_to_ns(desc);
timeout_ns = DIV_ROUND_UP(timeout_ns * 105, 100); timeout_ns = DIV_ROUND_UP_ULL(timeout_ns * 105, 100);
if (timeout_ns < udev->u1_params.sel * 2) if (timeout_ns < udev->u1_params.sel * 2)
timeout_ns = udev->u1_params.sel * 2; timeout_ns = udev->u1_params.sel * 2;
break; break;
...@@ -3965,7 +3965,7 @@ static u16 xhci_calculate_intel_u1_timeout(struct usb_device *udev, ...@@ -3965,7 +3965,7 @@ static u16 xhci_calculate_intel_u1_timeout(struct usb_device *udev,
} }
/* The U1 timeout is encoded in 1us intervals. */ /* The U1 timeout is encoded in 1us intervals. */
timeout_ns = DIV_ROUND_UP(timeout_ns, 1000); timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 1000);
/* Don't return a timeout of zero, because that's USB3_LPM_DISABLED. */ /* Don't return a timeout of zero, because that's USB3_LPM_DISABLED. */
if (timeout_ns == USB3_LPM_DISABLED) if (timeout_ns == USB3_LPM_DISABLED)
timeout_ns++; timeout_ns++;
...@@ -4004,7 +4004,7 @@ static u16 xhci_calculate_intel_u2_timeout(struct usb_device *udev, ...@@ -4004,7 +4004,7 @@ static u16 xhci_calculate_intel_u2_timeout(struct usb_device *udev,
timeout_ns = u2_del_ns; timeout_ns = u2_del_ns;
/* The U2 timeout is encoded in 256us intervals */ /* The U2 timeout is encoded in 256us intervals */
timeout_ns = DIV_ROUND_UP(timeout_ns, 256 * 1000); timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 256 * 1000);
/* If the necessary timeout value is bigger than what we can set in the /* If the necessary timeout value is bigger than what we can set in the
* USB 3.0 hub, we have to disable hub-initiated U2. * USB 3.0 hub, we have to disable hub-initiated U2.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册