From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, kernel test robot <lkp@intel.com>,
Julia Lawall <julia.lawall@inria.fr>,
Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 9/9] usb: xhci: fix minmax.cocci warnings
Date: Wed, 16 Feb 2022 11:09:38 +0200 [thread overview]
Message-ID: <20220216090938.1260899-10-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <20220216090938.1260899-1-mathias.nyman@linux.intel.com>
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 --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,
--
2.25.1
next prev parent reply other threads:[~2022-02-16 9:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 9:09 [PATCH 0/9] xhci and hub features for usb-next Mathias Nyman
2022-02-16 9:09 ` [PATCH 1/9] xhci: dbc: refactor xhci_dbc_init() Mathias Nyman
2022-02-16 9:09 ` [PATCH 2/9] xhci: dbc: create and remove dbc structure in dbgtty driver Mathias Nyman
2022-02-16 9:09 ` [PATCH 3/9] xhci: dbc: Rename xhci_dbc_init and xhci_dbc_exit Mathias Nyman
2022-02-16 9:09 ` [PATCH 4/9] xhci: dbc: Don't call dbc_tty_init() on every dbc tty probe Mathias Nyman
2022-02-16 9:09 ` [PATCH 5/9] xhci: dbgtty: use IDR to support several dbc instances Mathias Nyman
2022-02-16 9:09 ` [PATCH 6/9] xhci: Allocate separate command structures for each LPM command Mathias Nyman
2022-02-16 9:09 ` [PATCH 7/9] usb: remove Link Powermanagement (LPM) disable before port reset Mathias Nyman
2022-02-16 9:09 ` [PATCH 8/9] usb: host: xhci: drop redundant checks Mathias Nyman
2022-02-16 9:09 ` Mathias Nyman [this message]
2022-02-16 9:21 ` [PATCH 0/9] xhci and hub features for usb-next Mathias Nyman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220216090938.1260899-10-mathias.nyman@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@inria.fr \
--cc=linux-usb@vger.kernel.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox