When compiling with gcc -O1, this error appears:
        drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’:
        rte_log.h:321:3: error:
        ‘mode’ may be used uninitialized in this function

The function mlx4_rxmode_toggle is never called with a value which
is not in the switch block, but GCC complains about it with -O1.
So the default case is "fixed" by setting string "undefined".

Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")
Cc: sta...@dpdk.org

Signed-off-by: Thomas Monjalon <tho...@monjalon.net>
---
 drivers/net/mlx4/mlx4_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 30deb3ef0..195a1b6df 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -360,6 +360,8 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum 
rxmode_toggle toggle)
                mode = "all multicast";
                dev->data->all_multicast = toggle & 1;
                break;
+       default:
+               mode = "undefined";
        }
        if (!mlx4_flow_sync(priv, &error))
                return;
-- 
2.19.0

Reply via email to