build: remove redundant config include
[dpdk.git] / drivers / net / vdev_netvsc / vdev_netvsc.c
index ef02fdc..9ed74a1 100644 (file)
@@ -27,7 +27,6 @@
 #include <rte_bus.h>
 #include <rte_bus_vdev.h>
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_ethdev.h>
@@ -330,7 +329,7 @@ vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
        char in[RTE_MAX(sizeof(ctx->yield), 256u)];
        int ret;
 
-       ret = snprintf(in, sizeof(in) - 1, "/sys/class/net/%s/%s",
+       ret = snprintf(in, sizeof(in), "/sys/class/net/%s/%s",
                       if_name, relpath);
        if (ret == -1 || (size_t)ret >= sizeof(in))
                return -ENOBUFS;
@@ -387,7 +386,7 @@ vdev_netvsc_device_probe(const struct if_nameindex *iface,
                strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name));
                return 0;
        }
-       if (!is_same_ether_addr(eth_addr, &ctx->if_addr))
+       if (!rte_is_same_ether_addr(eth_addr, &ctx->if_addr))
                return 0;
        /* Look for associated PCI device. */
        ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
@@ -529,22 +528,14 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
                        } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) {
                                struct rte_ether_addr tmp;
 
-                               if (sscanf(pair->value,
-                                          "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":"
-                                          "%" SCNx8 ":%" SCNx8 ":%" SCNx8,
-                                          &tmp.addr_bytes[0],
-                                          &tmp.addr_bytes[1],
-                                          &tmp.addr_bytes[2],
-                                          &tmp.addr_bytes[3],
-                                          &tmp.addr_bytes[4],
-                                          &tmp.addr_bytes[5]) != 6) {
+                               if (rte_ether_unformat_addr(pair->value, &tmp) != 0) {
                                        DRV_LOG(ERR,
                                                "invalid MAC address format"
                                                " \"%s\"",
                                                pair->value);
                                        return -EINVAL;
                                }
-                               if (is_same_ether_addr(eth_addr, &tmp))
+                               if (rte_is_same_ether_addr(eth_addr, &tmp))
                                        break;
                        }
                }
@@ -633,7 +624,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
                ctx->devname, ctx->devargs);
        vdev_netvsc_foreach_iface(vdev_netvsc_device_probe, 0, ctx);
        ret = rte_eal_hotplug_add("vdev", ctx->devname, ctx->devargs);
-       if (ret)
+       if (ret < 0)
                goto error;
        LIST_INSERT_HEAD(&vdev_netvsc_ctx_list, ctx, entry);
        ++vdev_netvsc_ctx_count;