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>
This commit is contained in:
parent
cddc585ec9
commit
8220be592d
|
@ -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)
|
static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
|
||||||
{
|
{
|
||||||
u32 pcie_link_status = 0;
|
u32 pcie_link_status = 0;
|
||||||
u32 n;
|
u32 n = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
u32 p2p_br_devnum[PCIE_P2P_CNT];
|
u32 p2p_br_devnum[PCIE_P2P_CNT];
|
||||||
int irqs[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
|
* then assigning remaining device numbers to any disabled
|
||||||
* ports.
|
* ports.
|
||||||
*/
|
*/
|
||||||
n = 0;
|
|
||||||
for (i = 0; i < PCIE_P2P_CNT; i++)
|
for (i = 0; i < PCIE_P2P_CNT; i++)
|
||||||
if (pcie_link_status & BIT(i))
|
if (pcie_link_status & BIT(i))
|
||||||
p2p_br_devnum[i] = n++;
|
p2p_br_devnum[i] = n++;
|
||||||
|
|
Loading…
Reference in New Issue