diff mbox series

[v2,2/8] drivers/usb/core: refactor max with max_t

Message ID 20241112155817.3512577-3-snovitoll@gmail.com (mailing list archive)
State Accepted
Commit 28d96b7a925309a6a8024620d83a113f75a02b0d
Headers show
Series drivers/usb: refactor min/max with min_t/max_t | expand

Commit Message

Sabyrzhan Tasbolatov Nov. 12, 2024, 3:58 p.m. UTC
Ensure type safety by using max_t() instead of max().

Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
---
 drivers/usb/core/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 880d52c0949d..25a00f974934 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -924,7 +924,7 @@  int usb_get_configuration(struct usb_device *dev)
 			result = -EINVAL;
 			goto err;
 		}
-		length = max((int) le16_to_cpu(desc->wTotalLength),
+		length = max_t(int, le16_to_cpu(desc->wTotalLength),
 		    USB_DT_CONFIG_SIZE);
 
 		/* Now that we know the length, get the whole thing */