summaryrefslogtreecommitdiff
path: root/drivers/net/virtio/virtio_pci.c
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2017-08-03 09:21:50 +0800
committerYuanhan Liu <yliu@fridaylinux.org>2017-10-10 15:48:53 +0200
commit0373ab9bfca60cbc62b2f5dc9a914b5ece63ba31 (patch)
treea7a5e6d66c41705d18d9e62b6377603eb4d34ebe /drivers/net/virtio/virtio_pci.c
parent9ff41aa7a0640eb80a37ed38fe4f1d78fb31d796 (diff)
downloaddpdk-next-eventdev-0373ab9bfca60cbc62b2f5dc9a914b5ece63ba31.zip
dpdk-next-eventdev-0373ab9bfca60cbc62b2f5dc9a914b5ece63ba31.tar.gz
dpdk-next-eventdev-0373ab9bfca60cbc62b2f5dc9a914b5ece63ba31.tar.xz
net/virtio: replace magic number with PCI constant
To use macro instead of magic number in order to enhance code readability. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
Diffstat (limited to 'drivers/net/virtio/virtio_pci.c')
-rw-r--r--drivers/net/virtio/virtio_pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index e6da680..55b717c 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -553,7 +553,7 @@ get_cfg_addr(struct rte_pci_device *dev, struct virtio_pci_cap *cap)
uint32_t offset = cap->offset;
uint8_t *base;
- if (bar > 5) {
+ if (bar >= PCI_MAX_RESOURCE) {
PMD_INIT_LOG(ERR, "invalid bar: %u", bar);
return NULL;
}