staging: mt7621-pci: rename 'PCIE_P2P_MAX' into 'PCIE_P2P_CNT'

Definition 'PCIE_P2P_MAX' is '3'. The value here is not a MAXimum.
It is a count or a number. It is how many masks there are.
The masks are numbered 0, 1, 2 so the maximum is 2. Hence rename
variable into 'PCIE_P2P_CNT' which is a more accurate name.

Suggested-by: NeilBrown <neil@brown.name>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413155018.31921-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sergio Paracuellos 2020-04-13 17:50:16 +02:00 committed by Greg Kroah-Hartman
parent 4ddf14470b
commit 535bd126d6

View file

@ -55,7 +55,7 @@
#define RALINK_PCI_IOBASE 0x002C
/* PCICFG virtual bridges */
#define PCIE_P2P_MAX 3
#define PCIE_P2P_CNT 3
#define PCIE_P2P_BR_DEVNUM_SHIFT(p) (16 + (p) * 4)
#define PCIE_P2P_BR_DEVNUM0_SHIFT PCIE_P2P_BR_DEVNUM_SHIFT(0)
#define PCIE_P2P_BR_DEVNUM1_SHIFT PCIE_P2P_BR_DEVNUM_SHIFT(1)
@ -138,7 +138,7 @@ struct mt7621_pcie {
} offset;
unsigned long io_map_base;
struct list_head ports;
int irq_map[PCIE_P2P_MAX];
int irq_map[PCIE_P2P_CNT];
bool resets_inverted;
};
@ -607,8 +607,8 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
u32 pcie_link_status = 0;
u32 n;
int i = 0;
u32 p2p_br_devnum[PCIE_P2P_MAX];
int irqs[PCIE_P2P_MAX];
u32 p2p_br_devnum[PCIE_P2P_CNT];
int irqs[PCIE_P2P_CNT];
struct mt7621_pcie_port *port;
list_for_each_entry(port, &pcie->ports, list) {
@ -623,11 +623,11 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
return -1;
n = 0;
for (i = 0; i < PCIE_P2P_MAX; i++)
for (i = 0; i < PCIE_P2P_CNT; i++)
if (pcie_link_status & BIT(i))
p2p_br_devnum[i] = n++;
for (i = 0; i < PCIE_P2P_MAX; i++)
for (i = 0; i < PCIE_P2P_CNT; i++)
if ((pcie_link_status & BIT(i)) == 0)
p2p_br_devnum[i] = n++;
@ -639,11 +639,11 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
/* Assign IRQs */
n = 0;
for (i = 0; i < PCIE_P2P_MAX; i++)
for (i = 0; i < PCIE_P2P_CNT; i++)
if (pcie_link_status & BIT(i))
pcie->irq_map[n++] = irqs[i];
for (i = n; i < PCIE_P2P_MAX; i++)
for (i = n; i < PCIE_P2P_CNT; i++)
pcie->irq_map[i] = -1;
return 0;