]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drivers/usb/core: refactor max with max_t
authorSabyrzhan Tasbolatov <snovitoll@gmail.com>
Tue, 12 Nov 2024 15:58:11 +0000 (20:58 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Nov 2024 14:09:50 +0000 (15:09 +0100)
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>
drivers/usb/core/config.c

index 880d52c0949d4791a19f2cb2a9c9359cee530f4a..25a00f974934fb5a562caf3f5f259ba23031e457 100644 (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 */