[v21.02,v3,05/10] net/pcap: remove local variable shadowing outer one

Message ID 20201119115900.4095566-6-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series cppcheck |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Ferruh Yigit Nov. 19, 2020, 11:58 a.m. UTC
  'ret' is already defined in the function scope, removing the 'ret' in
the block scope.

Fixes: c9507cd0cada ("net/pcap: support physical interface MAC address")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v3:
* Eliminated block scope 'ret' variable usage completely.
---
 drivers/net/pcap/rte_eth_pcap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

David Marchand Jan. 8, 2021, 10:31 a.m. UTC | #1
On Thu, Nov 19, 2020 at 1:01 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> 'ret' is already defined in the function scope, removing the 'ret' in
> the block scope.
>
> Fixes: c9507cd0cada ("net/pcap: support physical interface MAC address")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>
  

Patch

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 4930d7d382..90929478eb 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1324,9 +1324,8 @@  eth_from_pcaps(struct rte_vdev_device *vdev,
 
 		/* phy_mac arg is applied only only if "iface" devarg is provided */
 		if (rx_queues->phy_mac) {
-			int ret = eth_pcap_update_mac(rx_queues->queue[0].name,
-					eth_dev, vdev->device.numa_node);
-			if (ret == 0)
+			if(eth_pcap_update_mac(rx_queues->queue[0].name,
+					eth_dev, vdev->device.numa_node) == 0)
 				internals->phy_mac = 1;
 		}
 	}