From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 029598DB3 for ; Fri, 22 Jan 2016 15:07:06 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id l65so262432329wmf.1 for ; Fri, 22 Jan 2016 06:07:05 -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=X5PuATefhphvCX95O1j2CYGoJGjtgZ5iFHNFRTaDqo4=; b=nKWyFmfYmWVQ7G/vqZs0KxWiyi/SFNx0L9BYR55pvyh3Rjl2pO+2hgx5Y52h6ovzCL oxu/9/4gU4THJHz7o40AEzjDYr93el/h7nP3wKEaE42wqJByC4EpKg0Gv8NgyR0jGeZA 1BSE1QVMSshKut5kPGtCRJYb72ektJJcUbVbqkL8shq4/HIdB0sbDwHqD0grEcrgakYa 8ze8xa2B5QE9VCKHGjO4/IIrGF7RdfJnxoZielYIwaDP5ODK50jB+I9V33uwBkSvn3Rd lOhbVvuf3lqH375YrIAKsYRQmLhOGqzzUUFulROidKyYHIicHNCDc6/x2MN0qnndfGIB lXBg== 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=X5PuATefhphvCX95O1j2CYGoJGjtgZ5iFHNFRTaDqo4=; b=V8oCzsYtMMV+en7pR4YQj3SC51qwKjarKUFySKIIuEKpvwAU2T5x6LVtfdDWUFXgAL 9/S60MWrYsq9bIvQPz0VsZDsrp6HsTUj/YMzli1s3mJNEWTUHNmmcx1xzYu2sSNdoX/f mbM3P6EM8vJ9xYfCIsLHQ/27P4C5yda4ugPVWdEJZhuBEznSn/SOEg0kQNnvdqGohlsY CD9XwSytXEUoULXw31LmOiXU1vIWa8n92SlqtlcXO78wnmyfs1ik5ZwnRr86QZDjLIIS p+aQjAvggcfYF77NQn8LgsVBLshw+q5wxrHPnlkOlbT7uI+SH8Xj+NhZ+BZKO7tNGzSa p1ug== X-Gm-Message-State: AG10YOQZwrg3yy4nH4nNjTuv6DYXw9/JKdISDNBghKhD3kkrlqNm2L+PzsyI8mOpUFBc9ufa X-Received: by 10.28.227.6 with SMTP id a6mr3718523wmh.68.1453471625829; Fri, 22 Jan 2016 06:07:05 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id l194sm3107982wmb.14.2016.01.22.06.07.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 06:07:04 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 22 Jan 2016 15:06:57 +0100 Message-Id: <1453471618-29722-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453471618-29722-1-git-send-email-david.marchand@6wind.com> References: <1453377431-25850-1-git-send-email-david.marchand@6wind.com> <1453471618-29722-1-git-send-email-david.marchand@6wind.com> Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v2 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: Fri, 22 Jan 2016 14:07:06 -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 ed971b4..cab74e0 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; @@ -602,9 +590,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