Skip to content

Commit 7e2bd7d

Browse files
Epicuriusgregkh
authored andcommitted
usb: xhci: remove redundant variable 'erst_size'
'erst_size' represents the maximum capacity of entries that ERST can hold, while 'num_entries' indicates the actual number of entries currently held in the ERST. These two values are identical because the xhci driver does not support ERST expansion. Thus, 'erst_size' is removed. Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20240429140245.3955523-7-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5adc1cc commit 7e2bd7d

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/usb/host/xhci-dbgcap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static int xhci_dbc_mem_init(struct xhci_dbc *dbc, gfp_t flags)
516516
goto string_fail;
517517

518518
/* Setup ERST register: */
519-
writel(dbc->erst.erst_size, &dbc->regs->ersts);
519+
writel(dbc->erst.num_entries, &dbc->regs->ersts);
520520

521521
lo_hi_writeq(dbc->erst.erst_dma_addr, &dbc->regs->erstba);
522522
deq = xhci_trb_virt_to_dma(dbc->ring_evt->deq_seg,

drivers/usb/host/xhci.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,8 +1376,6 @@ struct xhci_erst {
13761376
unsigned int num_entries;
13771377
/* xhci->event_ring keeps track of segment dma addresses */
13781378
dma_addr_t erst_dma_addr;
1379-
/* Num entries the ERST can contain */
1380-
unsigned int erst_size;
13811379
};
13821380

13831381
struct xhci_scratchpad {

0 commit comments

Comments
 (0)