net: thunderx: Cleanup duplicate NODE_ID macros, add nic_get_node_id()

There are duplicate NODE_ID macro definitions. Move all of them to
nic.h for usage in nic and bgx driver and introduce nic_get_node_id()
helper function.

This patch also fixes 64bit mask which should have been ULL by
reworking the node calculation.

Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Robert Richter
2015-06-02 11:00:18 -07:00
committed by David S. Miller
parent dda922c831
commit d768b678a8
4 changed files with 13 additions and 8 deletions

View File

@@ -23,8 +23,6 @@
struct nicpf {
struct pci_dev *pdev;
u8 rev_id;
#define NIC_NODE_ID_MASK 0x300000000000
#define NIC_NODE_ID(x) ((x & NODE_ID_MASK) >> 44)
u8 node;
unsigned int flags;
u8 num_vf_en; /* No of VF enabled */
@@ -851,7 +849,7 @@ static int nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_read_config_byte(pdev, PCI_REVISION_ID, &nic->rev_id);
nic->node = NIC_NODE_ID(pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM));
nic->node = nic_get_node_id(pdev);
nic_set_lmac_vf_mapping(nic);