From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id E6D0A201; Tue, 24 Jan 2017 21:28:42 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id r126so37391370wmr.3; Tue, 24 Jan 2017 12:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Q1CmCGNWNVpNT1PAa0+j3RcMVdY+qFz1b6MebQLq3lE=; b=CPFFlWmQshVY5tuDQOBoUXOsIBpSt7NWVmGstaLnWAcDcqKf4DroZv58uyJuLKWM/y srmC+BjVmtrPOZmvHuzo0Mr0EP7b/Mn29La81cik0VpMA0dDD/lK2N04wY/i3IvhfXo0 vS+sJ1nZFBepec82SQ6xKJrGR0HEOOdz2FH+rMlzJXDtrzTQidx/mAp1dgpeL/oDm9Ka GMqcnLL3jMJqW5JNxMvJuuk2hiaYu9mE7Pk9KQyeJOFZ30WRJRiq3wyki0umQrWpHb+g zMbkt/tEG83BZGCA6M63IbeZ6eQMremgXpOyxrglAOp1U2VtR1RPCxjHkyyDSiHNp2JA gBnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Q1CmCGNWNVpNT1PAa0+j3RcMVdY+qFz1b6MebQLq3lE=; b=iGrftGFyST5xMCKQg40snPmwRfmcnB2XbzS0XG29ZZ5tL4wU4RrgtPRVELjrwXmU2i 7eCSNZxr1ljH6HwjrIN8ceZc/1xQrc69UKln9rkRLMoSxOWxpzSv+mp1/2tN6IB9/W/Q y9+Rw96Sk0ZPb2j9q+eZPBkDZYj/M7itd+YxPCtuFFQj83TPz/a9HKMTZoVJA6QvPLdH fWVhBOr4j/4tfcYW8v0EKtHBCGcaHv9V6acFPeyqctb1SDYJD8nwfvjGdKHr1z4pcqPJ bKQdFLk3+OmpgT5Msb0fYJKJIzcOfCoyYEqWm0pt5lRpYTvg0qoIJ7DGvY/cWiyh+DmO wdXw== X-Gm-Message-State: AIkVDXLK0FtbZxvRNQxHBFxRWTbc/PO30SRyr+ravgemNUe90UBNnNywIMkInYXMYH0h4Q== X-Received: by 10.223.165.76 with SMTP id j12mr29542236wrb.17.1485289722670; Tue, 24 Jan 2017 12:28:42 -0800 (PST) Received: from emmanuel-Aspire-E5-571.primacom.net ([185.44.151.141]) by smtp.gmail.com with ESMTPSA id q12sm11113284wmd.8.2017.01.24.12.28.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jan 2017 12:28:42 -0800 (PST) From: Emmanuel Roullit To: thomas.monjalon@6wind.com Cc: dev@dpdk.org, stable@dpdk.org Date: Tue, 24 Jan 2017 21:28:35 +0100 Message-Id: <20170124202835.1271-1-emmanuel.roullit@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] ethdev: remove useless pointer initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2017 20:28:43 -0000 Found with clang static analysis: lib/librte_ether/rte_ethdev.c:2467:22: warning: Value stored to 'dev' during its initialization is never read struct rte_eth_dev *dev = &rte_eth_devices[port_id]; ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 61207d014fc9 ("ethdev: fix data reset when allocating port") Signed-off-by: Emmanuel Roullit --- lib/librte_ether/rte_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 61f44e218..d7f78c23a 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2364,7 +2364,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { - struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (mirror_conf->rule_type == 0) { @@ -2400,7 +2400,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, int rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) { - struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); -- 2.11.0