From: Rizwan Ansari
Patch fixes below build error:
/home/mv/work/thunder/santosh/dpdk/santosh/dpdk/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c:
In function ?pci_vfio_set_iommu_type?:
/home/mv/work/thunder/santosh/dpdk/santosh/dpdk/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c:243:2:
error: ?for? loop initial declarations are only allowed in C99 mode
for (unsigned idx = 0; idx < RTE_DIM(iommu_types); idx++) {
^
/home/mv/work/thunder/santosh/dpdk/santosh/dpdk/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c:243:2:
note: use option -std=c99 or -std=gnu99 to compile your code
Signed-off-by: Rizwan Ansari
Signed-off-by: Santosh Shukla
---
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index c69050d..844ef80 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -240,7 +240,8 @@ pci_vfio_set_bus_master(int dev_fd)
/* pick IOMMU type. returns a pointer to vfio_iommu_type or NULL for error */
static const struct vfio_iommu_type *
pci_vfio_set_iommu_type(int vfio_container_fd) {
- for (unsigned idx = 0; idx < RTE_DIM(iommu_types); idx++) {
+ unsigned idx;
+ for (idx = 0; idx < RTE_DIM(iommu_types); idx++) {
const struct vfio_iommu_type *t = &iommu_types[idx];
int ret = ioctl(vfio_container_fd, VFIO_SET_IOMMU,
--
1.7.9.5