aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorkernel test robot <lkp@intel.com>2022-02-16 11:51:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-17 16:20:46 +0100
commit0b86f02d91c82c8348a8f3be960486e14a3dd479 (patch)
tree33e259122b74d8b898adca089204b77a6e0eb073 /drivers/usb/host
parentusb: host: xhci: drop redundant checks (diff)
downloadwireguard-linux-0b86f02d91c82c8348a8f3be960486e14a3dd479.tar.xz
wireguard-linux-0b86f02d91c82c8348a8f3be960486e14a3dd479.zip
usb: xhci: fix minmax.cocci warnings
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> Link: https://lore.kernel.org/r/20220216095153.1303105-10-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-mem.c3
1 files changed, 1 insertions, 2 deletions
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,