Skip to contentSkip to conversation

xhci: use max() to make code cleaner

PATCH New [email protected] 1 participant 1 message Dec 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xhci: use max() to make code cleaner

From: Changcheng Deng <[email protected]>

Use max() in order to make code cleaner.

---
 drivers/usb/host/xhci.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/host/xhci.c +2 -4
index f5b1bcc875de..dc357cabb265 100644
@@ -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 "
Signature · 1 line
2.25.1