From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by dpdk.org (Postfix) with ESMTP id F2C01C31A for ; Mon, 18 May 2015 19:40:13 +0200 (CEST) Received: by pabts4 with SMTP id ts4so160749950pab.3 for ; Mon, 18 May 2015 10:40:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X1QxQ6AVlznbCOjxEg7bAm+sgPFrbw032oxJOSvjzrs=; b=hzLYXcTAGQhnEGLafiGphSBrE0fxUp8E5YLaFQli+G4XV4XiRnDqDnYRBvluawh7LW MCJC27KRqGnLt5YkVfF14Rq94qEPGSzFtMdQf96UmubrxkLKLfqmXXdz+2JRkLSHav10 6X+q1XaAgkebTvSZd08drn0klUo3+MCYae6jpij0bmZCCaFiCk3gvhU2Gu8kVjTH/sVS HfdWoUtCWKgtTAfMUisIkFe/pPJ22nlLIFhNFgIxx83Ydp8FGcGYytUOznoX1Yz8p2qO 79bmyy5jP0vvTRziaJpzGtwQAZrD9c67Iz9hr740LX3q2txI25vSZSyNlGUZn6oT6c+P Q3Ow== X-Gm-Message-State: ALoCoQkLuRw75CFMaZucDjg+VPppyE+B2gNhhIbkfI7Lzj5AYUm63wRcuKdgwX+hcAujWTQbit9+ X-Received: by 10.66.236.167 with SMTP id uv7mr45257898pac.58.1431970813215; Mon, 18 May 2015 10:40:13 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id he9sm10655046pbc.7.2015.05.18.10.40.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 May 2015 10:40:12 -0700 (PDT) From: Stephen Hemminger To: cumming.lian@intel.com Date: Mon, 18 May 2015 10:40:11 -0700 Message-Id: <1431970814-25951-3-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431970814-25951-1-git-send-email-stephen@networkplumber.org> References: <1431970814-25951-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 2/5] ethdev: remove unnecessary checks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2015 17:40:14 -0000 Since the code has just called rte_eth_dev_is_valid_port the following checks are unnecessary. Signed-off-by: Stephen Hemminger --- 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