Commit 0b86f02d authored by kernel test robot's avatar kernel test robot Committed by Greg Kroah-Hartman
Browse files

usb: xhci: fix minmax.cocci warnings



Simplify the code using max().

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

Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220216095153.1303105-10-mathias.nyman@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 133da4b4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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,