diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2020-04-13 17:50:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-16 12:33:02 +0200 |
commit | 8220be592d82637e3f7ac269eb9d33a247e942b6 (patch) | |
tree | 767f68afc25aa0111b5f2fccf3d53367e4a9fc6c /drivers | |
parent | cddc585ec92c074025d2d76bc0f6ec120e44fe8a (diff) | |
download | linux-8220be592d82637e3f7ac269eb9d33a247e942b6.tar.bz2 |
staging: mt7621-pci: initialize 'n' variable when it is declared
Variable 'n' in 'mt7621_pcie_init_virtual_bridges' function
can be directly initialized when it is declared instead of
doing it before using it first.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413155018.31921-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/mt7621-pci/pci-mt7621.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index eede8d9268ac..f961b353c22e 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -605,7 +605,7 @@ static void mt7621_pcie_enable_ports(struct mt7621_pcie *pcie) static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie) { u32 pcie_link_status = 0; - u32 n; + u32 n = 0; int i = 0; u32 p2p_br_devnum[PCIE_P2P_CNT]; int irqs[PCIE_P2P_CNT]; @@ -627,7 +627,6 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie) * then assigning remaining device numbers to any disabled * ports. */ - n = 0; for (i = 0; i < PCIE_P2P_CNT; i++) if (pcie_link_status & BIT(i)) p2p_br_devnum[i] = n++; |