From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id D86004F91; Fri, 16 Nov 2018 17:59:09 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7FB0121F26; Fri, 16 Nov 2018 11:59:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=WlvX5/g9DuTsnQbZ88LXQK0oigcF130TvHS6R4Phh4c=; b=dqOCq67TZ7x8 z+njzCbU48U0DJIGmY9dT7mq4c5BV82b3q9TqLJ8dvvCILSL351YllCcEZfOh8Lj gjj39AUXs5VZ6XdsN99iOR0x10G5RESlGoWpH8/k96yUWnyiGlwMMRsbH/6C0dmk v5w1T7Qbd6IAQ3HPgveBHGaV8UVNAJU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=WlvX5/g9DuTsnQbZ88LXQK0oigcF130TvHS6R4Phh 4c=; b=ISDwu1rYL9eo0gUGPytSU8RgpxY8XRzRLI+FxIkaUuV0Hyuj6F9EM3ZPJ VlRuPyaVVJgQn1FNHgYzJhhlx8l9kxzma490AsSZ6Vjxf3gqjT2GBO4PlwlpKJk0 RnZDQ6RKa8SapoWIHDfVZYr16vHd/zVt9wsmUZGL8p4aZfKPmAClz1OhPUQ1yMb2 9eeNb05Wj8qH6NG6qowsuuYEs4p+GbpRRuR+LIx06VnGjMyLum4t9/C50PepfdeP TVsul5o09RWKNXU7oUsn1ndQefTvEGT2NbGPAYILma4dT6QxpOsD5K52hM2krsfm N/JAZAyZ/5rY6OPI4+eOUkhAqfrfg== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id CB8D6102DD; Fri, 16 Nov 2018 11:59:08 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org Date: Fri, 16 Nov 2018 17:58:52 +0100 Message-Id: <20181116165854.24017-4-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/5] net/mlx4: fix possible uninitialized variable 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: Fri, 16 Nov 2018 16:59:10 -0000 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: stable@dpdk.org Signed-off-by: Thomas Monjalon --- 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