]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: xhci: make 'sbrn' a local variable
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Thu, 5 Sep 2024 14:32:55 +0000 (17:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Sep 2024 14:39:22 +0000 (16:39 +0200)
Variable 'sbrn' is used to store the Serial Bus Release Number, which is
then only used for a debug message. Thus, 'sbrn' can be a local variable
and assigned after the primary HCD check. The SBRN debug message is only
printed when a primary HCD is setup.

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/20240905143300.1959279-8-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.h

index b5705ed01d83dfab4c0ff674cfbad32ef2b2f58d..b405cff2d60052d2ae7d8757a9de1b12300187e9 100644 (file)
@@ -525,10 +525,9 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
        struct xhci_hcd         *xhci;
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
        int                     retval;
+       u8                      sbrn;
 
        xhci = hcd_to_xhci(hcd);
-       if (!xhci->sbrn)
-               pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn);
 
        /* imod_interval is the interrupt moderation value in nanoseconds. */
        xhci->imod_interval = 40000;
@@ -543,7 +542,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
        if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
                xhci_pme_acpi_rtd3_enable(pdev);
 
-       xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn);
+       pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &sbrn);
+       xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int)sbrn);
 
        /* Find any debug ports */
        return xhci_pci_reinit(xhci, pdev);
index 6f8cecc789d6d3b4b480bea9d0042db292a3862a..d41523c9b15c5fedfd9d44d5fe7ab6a710dcbdbc 100644 (file)
@@ -1498,7 +1498,6 @@ struct xhci_hcd {
        spinlock_t      lock;
 
        /* packed release number */
-       u8              sbrn;
        u16             hci_version;
        u16             max_interrupters;
        /* imod_interval in ns (I * 250ns) */