CC: [email protected]
CC: [email protected]
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: Mathias Nyman <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max()


 Check for opencoded min(), max() implementations.
 Generated patches sometimes require adding a cast to fix compile warning.
 Warnings/patches scope intentionally limited to a function body.

Generated by: scripts/coccinelle/misc/minmax.cocci

CC: Denis Efremov <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   83e396641110663d3c7bb25b9bc0c6a750359ecf
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax 
script
:::::: branch date: 5 hours ago
:::::: commit date: 10 months ago

Please take the patch only if it's a positive warning. Thanks!

 xhci-mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd
                                (TRBS_PER_SEGMENT - 1);
 
        /* Allocate number of segments we needed, or double the ring size */
-       num_segs = ring->num_segs > num_segs_needed ?
-                       ring->num_segs : num_segs_needed;
+       num_segs = max(ring->num_segs, num_segs_needed);
 
        ret = xhci_alloc_segments_for_ring(xhci, &first, &last,
                        num_segs, ring->cycle_state, ring->type,
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to