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 EDEAAC46E for ; Fri, 24 Jul 2015 19:06:19 +0200 (CEST) Received: by pachj5 with SMTP id hj5so17136468pac.3 for ; Fri, 24 Jul 2015 10:06:19 -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=YLjNbuZmYkVcZOplw/zah8cwMqssnwq2mtvcaKDfyB8=; b=MFCN/dmfaKCCImFJXBUEAxeRT3Jf8jbkxd2JfOb/vb7yIb+88BR4zUZWM9vYSvvzjk j4RjgdcZ8pqP+ttOcsQzbh8KZHkidlZHwS4Fz/BWbCLyR4E5qFUSHAxQIY8szGn4ntMJ g7tWYo/pkHM4j7aPX2KYN2RG1Hn2AGmZIBatk0+JpECKivMypkHRI/OvfAhVHY65PmEH LAKnvBhOUYfsEP3IQOpM9qkmCp1s91g1oi901EL7YH+0MKHugptA/kXVahlCVncV83xB EKuSpVYvajmwudhO3aAfss3Aw32ufMFWuPAb+jzBPn6xAXhDu+3arV7dms9A9jBjaafE 9+nA== X-Gm-Message-State: ALoCoQkUgquoHCEAbZVNGG8M00bKeMiFhuiPDT6CZ6Wsysvk4Kf1Ut4LVjAIbJJMOe3ymoXAHGUH X-Received: by 10.66.65.162 with SMTP id y2mr33169496pas.101.1437757579345; Fri, 24 Jul 2015 10:06:19 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id ra10sm15635403pab.19.2015.07.24.10.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jul 2015 10:06:18 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Fri, 24 Jul 2015 10:06:15 -0700 Message-Id: <1437757584-15502-3-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437757584-15502-1-git-send-email-stephen@networkplumber.org> References: <1437757584-15502-1-git-send-email-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 02/11] eth: do simple return 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, 24 Jul 2015 17:06:20 -0000 Found by coccinelle simple_return.cocci This function can just use direct return. Signed-off-by: Stephen Hemminger --- lib/librte_ether/rte_ethdev.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index f46426e..a96cd4f 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -269,17 +269,12 @@ static int rte_eth_dev_create_unique_device_name(char *name, size_t size, struct rte_pci_device *pci_dev) { - int ret; - if ((name == NULL) || (pci_dev == NULL)) return -EINVAL; - ret = snprintf(name, size, "%d:%d.%d", + return snprintf(name, size, "%d:%d.%d", pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); - if (ret < 0) - return ret; - return 0; } int -- 2.1.4