All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>,
	Michal Pecio <michal.pecio@gmail.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 02/33] usb: xhci: Remove unused parameters of next_trb()
Date: Wed,  6 Nov 2024 12:14:28 +0200	[thread overview]
Message-ID: <20241106101459.775897-3-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <20241106101459.775897-1-mathias.nyman@linux.intel.com>

From: Michal Pecio <michal.pecio@gmail.com>

The function has two parameters which it doesn't use and hasn't ever
used. One caller even puts NULL there, knowing it will work anyway.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
 drivers/usb/host/xhci-ring.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 9f1e150a1c76..36ccf0dac7fa 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -145,10 +145,8 @@ static void trb_to_noop(union xhci_trb *trb, u32 noop_type)
  * TRB is in a new segment.  This does not skip over link TRBs, and it does not
  * effect the ring dequeue or enqueue pointers.
  */
-static void next_trb(struct xhci_hcd *xhci,
-		struct xhci_ring *ring,
-		struct xhci_segment **seg,
-		union xhci_trb **trb)
+static void next_trb(struct xhci_segment **seg,
+			union xhci_trb **trb)
 {
 	if (trb_is_link(*trb) || last_trb_on_seg(*seg, *trb)) {
 		*seg = (*seg)->next;
@@ -446,9 +444,9 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags)
 	 * avoiding corrupting the command ring pointer in case the command ring
 	 * is stopped by the time the upper dword is written.
 	 */
-	next_trb(xhci, NULL, &new_seg, &new_deq);
+	next_trb(&new_seg, &new_deq);
 	if (trb_is_link(new_deq))
-		next_trb(xhci, NULL, &new_seg, &new_deq);
+		next_trb(&new_seg, &new_deq);
 
 	crcr = xhci_trb_virt_to_dma(new_seg, new_deq);
 	xhci_write_64(xhci, crcr | CMD_RING_ABORT, &xhci->op_regs->cmd_ring);
@@ -678,7 +676,7 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
 		    link_trb_toggles_cycle(new_deq))
 			new_cycle ^= 0x1;
 
-		next_trb(xhci, ep_ring, &new_seg, &new_deq);
+		next_trb(&new_seg, &new_deq);
 
 		/* Search wrapped around, bail out */
 		if (new_deq == ep->ring->dequeue) {
@@ -756,7 +754,7 @@ static void td_to_noop(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
 		if (trb == td->last_trb)
 			break;
 
-		next_trb(xhci, ep_ring, &seg, &trb);
+		next_trb(&seg, &trb);
 	}
 }
 
@@ -2273,7 +2271,7 @@ static int sum_trb_lengths(struct xhci_hcd *xhci, struct xhci_ring *ring,
 	union xhci_trb *trb = ring->dequeue;
 	struct xhci_segment *seg = ring->deq_seg;
 
-	for (sum = 0; trb != stop_trb; next_trb(xhci, ring, &seg, &trb)) {
+	for (sum = 0; trb != stop_trb; next_trb(&seg, &trb)) {
 		if (!trb_is_noop(trb) && !trb_is_link(trb))
 			sum += TRB_LEN(le32_to_cpu(trb->generic.field[2]));
 	}
-- 
2.25.1


  parent reply	other threads:[~2024-11-06 10:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 10:14 [PATCH 00/33] xhci features and fixes for usb-next Mathias Nyman
2024-11-06 10:14 ` [PATCH 01/33] xhci: Add Isochronous TRB fields to TRB tracer Mathias Nyman
2024-11-06 10:14 ` Mathias Nyman [this message]
2024-11-06 10:14 ` [PATCH 03/33] usb: xhci: Fix sum_trb_lengths() Mathias Nyman
2024-11-06 10:14 ` [PATCH 04/33] xhci: Cleanup Candence controller PCI device and vendor ID usage Mathias Nyman
2024-11-06 10:14 ` [PATCH 05/33] xhci: show DMA address of TRB when tracing TRBs Mathias Nyman
2024-11-06 10:14 ` [PATCH 06/33] xhci: Don't trace ring at every enqueue or dequeue increase Mathias Nyman
2024-11-06 10:14 ` [PATCH 07/33] xhci: add stream context tracing Mathias Nyman
2024-11-06 10:14 ` [PATCH 08/33] xhci: trace stream context at Set TR Deq command completion Mathias Nyman
2024-11-06 10:14 ` [PATCH 09/33] xhci: debugfs: Add virt endpoint state to xhci debugfs Mathias Nyman
2024-11-06 10:14 ` [PATCH 10/33] usb: xhci: introduce macro for ring segment list iteration Mathias Nyman
2024-11-06 10:14 ` [PATCH 11/33] usb: xhci: remove option to change a default ring's TRB cycle bit Mathias Nyman
2024-11-06 10:14 ` [PATCH 12/33] usb: xhci: adjust xhci_alloc_segments_for_ring() arguments Mathias Nyman
2024-11-06 10:14 ` [PATCH 13/33] usb: xhci: rework xhci_free_segments_for_ring() Mathias Nyman
2024-11-06 10:14 ` [PATCH 14/33] usb: xhci: refactor xhci_link_rings() to use source and destination rings Mathias Nyman
2024-11-06 10:14 ` [PATCH 15/33] usb: xhci: rework xhci_link_segments() Mathias Nyman
2024-11-06 10:14 ` [PATCH 16/33] usb: xhci: add xhci_initialize_ring_segments() Mathias Nyman
2024-11-06 10:14 ` [PATCH 17/33] xhci: Combine two if statements for Etron xHCI host Mathias Nyman
2024-11-06 10:14 ` [PATCH 18/33] xhci: Don't issue Reset Device command to " Mathias Nyman
2024-11-06 10:14 ` [PATCH 19/33] xhci: Fix control transfer error on " Mathias Nyman
2024-11-06 10:14 ` [PATCH 20/33] xhci: Don't perform Soft Retry for " Mathias Nyman
2024-11-06 10:14 ` [PATCH 21/33] xhci: pci: Use standard pattern for device IDs Mathias Nyman
2024-11-06 10:14 ` [PATCH 22/33] xhci: pci: Fix indentation in the PCI device ID definitions Mathias Nyman
2024-11-06 10:14 ` [PATCH 23/33] usb: xhci: simplify TDs start and end naming scheme in struct 'xhci_td' Mathias Nyman
2024-11-06 10:14 ` [PATCH 24/33] usb: xhci: move link TRB quirk to xhci_gen_setup() Mathias Nyman
2024-11-06 10:14 ` [PATCH 25/33] usb: xhci: request MSI/-X according to requested amount Mathias Nyman
2024-11-06 10:14 ` [PATCH 26/33] usb: xhci: improve xhci_clear_command_ring() Mathias Nyman
2024-11-06 10:14 ` [PATCH 27/33] usb: xhci: remove unused arguments from td_to_noop() Mathias Nyman
2024-11-06 10:14 ` [PATCH 28/33] usb: xhci: refactor xhci_td_cleanup() to return void Mathias Nyman
2024-11-06 10:14 ` [PATCH 29/33] usb: xhci: add help function xhci_dequeue_td() Mathias Nyman
2024-11-06 10:14 ` [PATCH 30/33] usb: xhci: remove irrelevant comment Mathias Nyman
2024-11-06 10:14 ` [PATCH 31/33] usb: xhci: Limit Stop Endpoint retries Mathias Nyman
2024-11-06 10:14 ` [PATCH 32/33] usb: xhci: Fix TD invalidation under pending Set TR Dequeue Mathias Nyman
2024-11-06 10:14 ` [PATCH 33/33] usb: xhci: Avoid queuing redundant Stop Endpoint commands 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=20241106101459.775897-3-mathias.nyman@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.