From: Jerin Jacob Date: Mon, 6 Feb 2017 05:23:37 +0000 (+0530) Subject: eventdev: fix event driver name to eventdev lookup X-Git-Tag: spdx-start~3869 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7b37f6f7adb7c55b45ae54252d0063658ef267a9;p=dpdk.git eventdev: fix event driver name to eventdev lookup - Removed uninitialized max_devs value - Corrected dev assignment Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs") Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 2e3e5d34a7..82d5e48296 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -149,7 +149,6 @@ struct rte_eventdev_driver { /** Global structure used for maintaining state of allocated event devices */ struct rte_eventdev_global { uint8_t nb_devs; /**< Number of devices found */ - uint8_t max_devs; /**< Max number of devices */ }; extern struct rte_eventdev_global *rte_eventdev_globals; @@ -175,8 +174,8 @@ rte_event_pmd_get_named_dev(const char *name) if (name == NULL) return NULL; - for (i = 0, dev = &rte_eventdevs[i]; - i < rte_eventdev_globals->max_devs; i++) { + for (i = 0; i < RTE_EVENT_MAX_DEVS; i++) { + dev = &rte_eventdevs[i]; if ((dev->attached == RTE_EVENTDEV_ATTACHED) && (strcmp(dev->data->name, name) == 0)) return dev;