summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.c
diff options
context:
space:
mode:
authorChangcheng Deng <deng.changcheng@zte.com.cn>2021-12-15 09:16:02 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-21 08:48:24 +0100
commitf28fb27ef72a045dc2a3db5621f178bb3216a00e (patch)
treeceb2b927d409a89267a0853e9139b7674fba32a2 /drivers/usb/host/xhci.c
parent4daf08a0afa898d52f1f40db3ddf00489f2dc712 (diff)
downloadlinux-f28fb27ef72a045dc2a3db5621f178bb3216a00e.tar.bz2
xhci: use max() to make code cleaner
Use max() in order to make code cleaner. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn> Link: https://lore.kernel.org/r/20211215091602.445009-1-deng.changcheng@zte.com.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r--drivers/usb/host/xhci.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index f5b1bcc875de..dc357cabb265 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4998,10 +4998,8 @@ static int calculate_max_exit_latency(struct usb_device *udev,
enabling_u2)
u2_mel_us = DIV_ROUND_UP(udev->u2_params.mel, 1000);
- if (u1_mel_us > u2_mel_us)
- mel_us = u1_mel_us;
- else
- mel_us = u2_mel_us;
+ mel_us = max(u1_mel_us, u2_mel_us);
+
/* xHCI host controller max exit latency field is only 16 bits wide. */
if (mel_us > MAX_EXIT) {
dev_warn(&udev->dev, "Link PM max exit latency of %lluus "