DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] ethdev: remove useless null checks
Date: Thu, 21 Jan 2016 12:57:10 +0100	[thread overview]
Message-ID: <1453377431-25850-2-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <1453377431-25850-1-git-send-email-david.marchand@6wind.com>

We are in static functions and those passed arguments can't be NULL.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 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

  reply	other threads:[~2016-01-21 11:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 11:57 [dpdk-dev] [PATCH 0/2] minor cleanup in ethdev hotplug David Marchand
2016-01-21 11:57 ` David Marchand [this message]
2016-01-21 19:02   ` [dpdk-dev] [dpdk-dev,1/2] ethdev: remove useless null checks Jan Viktorin
2016-01-22  9:11     ` Thomas Monjalon
2016-01-21 11:57 ` [dpdk-dev] [PATCH 2/2] ethdev: move code to common place in hotplug David Marchand
2016-01-21 15:38   ` [dpdk-dev] [dpdk-dev, " Jan Viktorin
2016-01-21 18:06     ` David Marchand
2016-01-21 18:42       ` Thomas Monjalon
2016-01-22  7:15         ` David Marchand
2016-01-22 14:06 ` [dpdk-dev] [PATCH v2 0/2] minor cleanup in ethdev hotplug David Marchand
2016-01-22 14:06   ` [dpdk-dev] [PATCH v2 1/2] ethdev: remove useless null checks David Marchand
2016-01-26 15:50     ` Jan Viktorin
2016-01-27  9:40       ` David Marchand
2016-01-22 14:06   ` [dpdk-dev] [PATCH v2 2/2] ethdev: move code to common place in hotplug David Marchand
2016-01-26 15:48     ` Jan Viktorin
2016-01-27 15:10   ` [dpdk-dev] [PATCH v2 0/2] minor cleanup in ethdev hotplug 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=1453377431-25850-2-git-send-email-david.marchand@6wind.com \
    --to=david.marchand@6wind.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).