X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinux%2Feal_interrupts.c;h=2f03a6125450905157fff8d3bddbd1cab38a4223;hb=5b38d8cd4663;hp=26b5dd4ca86b6bac20d3de8b0613bcfc3cb558b2;hpb=bb548625c6154f7dca48e249774233fc691e70cb;p=dpdk.git diff --git a/lib/librte_eal/linux/eal_interrupts.c b/lib/librte_eal/linux/eal_interrupts.c index 26b5dd4ca8..2f03a61254 100644 --- a/lib/librte_eal/linux/eal_interrupts.c +++ b/lib/librte_eal/linux/eal_interrupts.c @@ -667,13 +667,15 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle) { int rc = 0; - if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV) { + if (intr_handle == NULL) + return -1; + + if (intr_handle->type == RTE_INTR_HANDLE_VDEV) { rc = 0; goto out; } - if (!intr_handle || intr_handle->fd < 0 || - intr_handle->uio_cfg_fd < 0) { + if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) { rc = -1; goto out; } @@ -794,13 +796,15 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle) { int rc = 0; - if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV) { + if (intr_handle == NULL) + return -1; + + if (intr_handle->type == RTE_INTR_HANDLE_VDEV) { rc = 0; goto out; } - if (!intr_handle || intr_handle->fd < 0 || - intr_handle->uio_cfg_fd < 0) { + if (intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) { rc = -1; goto out; }