usb: xhci: remove redundant variable 'erst_size'
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Mon, 29 Apr 2024 14:02:33 +0000 (17:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 May 2024 06:47:14 +0000 (08:47 +0200)
'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>
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci.h

index 8a9869ef0db66a5df132a71c66f19f5fdcee14c4..872d9cddbcefa0e3695325022726b4bcff146b5c 100644 (file)
@@ -516,7 +516,7 @@ static int xhci_dbc_mem_init(struct xhci_dbc *dbc, gfp_t flags)
                goto string_fail;
 
        /* Setup ERST register: */
-       writel(dbc->erst.erst_size, &dbc->regs->ersts);
+       writel(dbc->erst.num_entries, &dbc->regs->ersts);
 
        lo_hi_writeq(dbc->erst.erst_dma_addr, &dbc->regs->erstba);
        deq = xhci_trb_virt_to_dma(dbc->ring_evt->deq_seg,
index 8a3ae5049d1cef50245ae4a2798b5606df507cf2..10805196e1971c18fba562a4c0e3f3a71c019b6a 100644 (file)
@@ -1376,8 +1376,6 @@ struct xhci_erst {
        unsigned int            num_entries;
        /* xhci->event_ring keeps track of segment dma addresses */
        dma_addr_t              erst_dma_addr;
-       /* Num entries the ERST can contain */
-       unsigned int            erst_size;
 };
 
 struct xhci_scratchpad {