diff mbox series

[9/9] usb: xhci: fix minmax.cocci warnings

Message ID 20220216090938.1260899-10-mathias.nyman@linux.intel.com (mailing list archive)
State Superseded
Headers show
Series xhci and hub features for usb-next | expand

Commit Message

Mathias Nyman Feb. 16, 2022, 9:09 a.m. UTC
From: kernel test robot <lkp@intel.com>

Simplify the code using max().

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

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci-mem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 7a2dce730e9a..f8c2b6c79543 100644
--- 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 *xhci, struct xhci_ring *ring,
 				(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,