DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: cumming.lian@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/5] ethdev: remove unnecessary checks
Date: Mon, 18 May 2015 10:40:11 -0700	[thread overview]
Message-ID: <1431970814-25951-3-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1431970814-25951-1-git-send-email-stephen@networkplumber.org>

Since the code has just called rte_eth_dev_is_valid_port
the following checks are unnecessary.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_ether/rte_ethdev.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ad15837..7789338 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3305,10 +3305,6 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data)
 	}
 
 	dev = &rte_eth_devices[port_id];
-	if (dev == NULL) {
-		PMD_DEBUG_TRACE("Invalid port device\n");
-		return -ENODEV;
-	}
 
 	intr_handle = &dev->pci_dev->intr_handle;
 	if (!intr_handle->intr_vec) {
@@ -3350,10 +3346,6 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id,
 	}
 
 	dev = &rte_eth_devices[port_id];
-	if (dev == NULL) {
-		PMD_DEBUG_TRACE("Invalid port device\n");
-		return -ENODEV;
-	}
 
 	if (queue_id >= dev->data->nb_rx_queues) {
 		PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", rx_queue_id);
@@ -3391,10 +3383,6 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id,
 	}
 
 	dev = &rte_eth_devices[port_id];
-	if (dev == NULL) {
-		PMD_DEBUG_TRACE("Invalid port device\n");
-		return -ENODEV;
-	}
 
 	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_enable, -ENOTSUP);
 	return (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id);
@@ -3412,10 +3400,6 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id,
 	}
 
 	dev = &rte_eth_devices[port_id];
-	if (dev == NULL) {
-		PMD_DEBUG_TRACE("Invalid port device\n");
-		return -ENODEV;
-	}
 
 	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_disable, -ENOTSUP);
 	return (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id);
-- 
2.1.4

  parent reply	other threads:[~2015-05-18 17:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 17:40 [dpdk-dev] [PATCH 0/5] receive IRQ related patches Stephen Hemminger
2015-05-18 17:40 ` [dpdk-dev] [PATCH 1/5] ethdev: check for rxq interrupt support Stephen Hemminger
2015-05-18 17:40 ` Stephen Hemminger [this message]
2015-05-18 17:40 ` [dpdk-dev] [PATCH 3/5] ethdev: fix errors if RTE_ETHDEV_DEBUG enabled Stephen Hemminger
2015-05-18 17:40 ` [dpdk-dev] [PATCH 4/5] uio: new driver with MSI-X support Stephen Hemminger
2015-05-25  6:01   ` Liang, Cunming
2015-05-25 17:41     ` Stephen Hemminger
2015-05-18 17:40 ` [dpdk-dev] [PATCH 5/5] uio: integrate " Stephen Hemminger
2015-05-25  8:55   ` Liang, Cunming
2015-05-25 17:42     ` Stephen Hemminger
2015-07-09  0:28 ` [dpdk-dev] [PATCH 0/5] receive IRQ related patches Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431970814-25951-3-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=cumming.lian@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).