drivers/usb/core: refactor max with max_t

Ensure type safety by using max_t() instead of max().

Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Link: https://lore.kernel.org/r/20241112155817.3512577-3-snovitoll@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sabyrzhan Tasbolatov
2024-11-12 20:58:11 +05:00
committed by Greg Kroah-Hartman
parent b7d49096d5
commit 28d96b7a92

View File

@@ -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 */