git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ff41aa
)
net/virtio: replace magic number with PCI constant
author
Zhiyong Yang
<zhiyong.yang@intel.com>
Thu, 3 Aug 2017 01:21:50 +0000
(09:21 +0800)
committer
Yuanhan Liu
<yliu@fridaylinux.org>
Tue, 10 Oct 2017 13:48:53 +0000
(15:48 +0200)
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>
drivers/net/virtio/virtio_pci.c
patch
|
blob
|
history
diff --git
a/drivers/net/virtio/virtio_pci.c
b/drivers/net/virtio/virtio_pci.c
index
e6da680
..
55b717c
100644
(file)
--- 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;
}