From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 190FA3005 for ; Thu, 21 Jan 2016 12:57:33 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id l65so216848611wmf.1 for ; Thu, 21 Jan 2016 03:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o7EfMP5OenXOh+P4+I1oFtg39JY/JzClhXZr2UBAMYk=; b=sJT0KNRLJIMuUbHAcRb63R/wyCWidXlIfLFnPvsjrqw7yzDgD6JLeUvRBjVGJO9mda 7y4ZUdzQzCa4ImsJ7orvpbqifJ4JOwyhUJOx0KNfl8QowiuN39HzK/Tb5w17LQIF0PiO EWGgbxBrB6Z0Npig5st9RZyTkisZvsQ1nuUSjDXbG91Jxn9icjqA+5jZbqk0HppPLiyQ 78XBjSOJG487cSF+6rLvq7mYGS2p8y3j7bhY2/bFd8WziRNsckB5KhACCzswWuRs9K4Q uZPRWJRJWsjeu+Z0zVqZ+O3c+ZET/U2Jo5AB1N/1wH++JkIPX9NjpBOA0ni5LrmgASDp mn9g== 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=o7EfMP5OenXOh+P4+I1oFtg39JY/JzClhXZr2UBAMYk=; b=aIHTzcY+bBXHn5nB0qy1fVTgM16ROKYXp2D8eq9qOUl2/AT6hNFE3izlxS2fSw434q JxupFKtuin2pdAzbVS8EZCL4/8y24/YRT9Iug+3sucCTgQI116P35tjzFt5MiRK6ssWi Fw9RwH4/vjuv4sc0VuFSKUD2i4Njpra0gyeUi776+eh+HZN3z5YnMH6AeEUgcNfeFgBT u1GG6uaJ9JxYWQuNQGc2S9wJ8lz6l5j23vt1Tak+T21jRb7t05AF9O5NSvyVW02muSao tw0R2FVGVYRmZWxm6EYw/VPKI/EPn/KI/vK0Flro1Dgmzzw+gMfVH7ycHEpqnTkwxu9R B++w== X-Gm-Message-State: AG10YOS4YoRVbMXE/xcrJRly8QGNQvxRf5TPElIOk/CPKDp2XkBKMLuqYKtYxX+SNRYRz+OJ X-Received: by 10.194.173.65 with SMTP id bi1mr31409298wjc.110.1453377452946; Thu, 21 Jan 2016 03:57:32 -0800 (PST) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id u4sm1178591wjz.4.2016.01.21.03.57.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 03:57:32 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Thu, 21 Jan 2016 12:57:10 +0100 Message-Id: <1453377431-25850-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1453377431-25850-1-git-send-email-david.marchand@6wind.com> References: <1453377431-25850-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 1/2] ethdev: remove useless null 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: Thu, 21 Jan 2016 11:57:33 -0000 We are in static functions and those passed arguments can't be NULL. Signed-off-by: David Marchand --- lib/librte_ether/rte_ethdev.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index af990e2..951fb1c 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -220,9 +220,6 @@ rte_eth_dev_create_unique_device_name(char *name, size_t size, { int ret; - if ((name == NULL) || (pci_dev == NULL)) - return -EINVAL; - ret = snprintf(name, size, "%d:%d.%d", pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); @@ -505,9 +502,6 @@ rte_eth_dev_is_detachable(uint8_t port_id) static int rte_eth_dev_attach_pdev(struct rte_pci_addr *addr, uint8_t *port_id) { - if ((addr == NULL) || (port_id == NULL)) - goto err; - /* re-construct pci_device_list */ if (rte_eal_pci_scan()) goto err; @@ -531,9 +525,6 @@ rte_eth_dev_detach_pdev(uint8_t port_id, struct rte_pci_addr *addr) struct rte_pci_addr freed_addr; struct rte_pci_addr vp; - if (addr == NULL) - goto err; - /* check whether the driver supports detach feature, or not */ if (rte_eth_dev_is_detachable(port_id)) goto err; @@ -566,9 +557,6 @@ rte_eth_dev_attach_vdev(const char *vdevargs, uint8_t *port_id) char *name = NULL, *args = NULL; int ret = -1; - if ((vdevargs == NULL) || (port_id == NULL)) - goto end; - /* parse vdevargs, then retrieve device name and args */ if (rte_eal_parse_devargs_str(vdevargs, &name, &args)) goto end; @@ -600,9 +588,6 @@ rte_eth_dev_detach_vdev(uint8_t port_id, char *vdevname) { char name[RTE_ETH_NAME_MAX_LEN]; - if (vdevname == NULL) - goto err; - /* check whether the driver supports detach feature, or not */ if (rte_eth_dev_is_detachable(port_id)) goto err; -- 1.9.1