diff mbox series

[v2,5/7] net/pcap: remove local variable shadown outer one

Message ID 20201118114525.99053-6-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series cppcheck | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit Nov. 18, 2020, 11:45 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>
---
Cc: juhamatti.kuusisaari@coriant.com
---
 drivers/net/pcap/rte_eth_pcap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Marchand Nov. 18, 2020, 2:11 p.m. UTC | #1
On Wed, Nov 18, 2020 at 12:47 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>
> ---
> Cc: juhamatti.kuusisaari@coriant.com
> ---
>  drivers/net/pcap/rte_eth_pcap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
> index 4930d7d382..dd9ef33c85 100644
> --- a/drivers/net/pcap/rte_eth_pcap.c
> +++ b/drivers/net/pcap/rte_eth_pcap.c
> @@ -1324,7 +1324,7 @@ 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,
> +                       ret = eth_pcap_update_mac(rx_queues->queue[0].name,
>                                         eth_dev, vdev->device.numa_node);
>                         if (ret == 0)
>                                 internals->phy_mac = 1;

It is not used after, why not simply check eth_pcap_update_mac() == 0 ?
diff mbox series

Patch

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 4930d7d382..dd9ef33c85 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1324,7 +1324,7 @@  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,
+			ret = eth_pcap_update_mac(rx_queues->queue[0].name,
 					eth_dev, vdev->device.numa_node);
 			if (ret == 0)
 				internals->phy_mac = 1;