From patchwork Fri Sep 30 16:17:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101723 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp378840qgf; Fri, 30 Sep 2016 09:17:51 -0700 (PDT) X-Received: by 10.66.230.228 with SMTP id tb4mr12878763pac.99.1475252271207; Fri, 30 Sep 2016 09:17:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf12si20664448pac.239.2016.09.30.09.17.51; Fri, 30 Sep 2016 09:17:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934055AbcI3QRs (ORCPT + 4 others); Fri, 30 Sep 2016 12:17:48 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:58549 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933082AbcI3QRp (ORCPT ); Fri, 30 Sep 2016 12:17:45 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MhDFZ-1bd8UK0sYz-00MP0r; Fri, 30 Sep 2016 18:17:37 +0200 From: Arnd Bergmann To: Saeed Mahameed , Matan Barak , Leon Romanovsky Cc: Arnd Bergmann , "David S. Miller" , Or Gerlitz , Amir Vadai , Maor Gottlieb , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] net/mlx5e: shut up maybe-uninitialized warning Date: Fri, 30 Sep 2016 18:17:09 +0200 Message-Id: <20160930161734.70928-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:XG37sqmcQr1jXBBzmO3UjQIDNtxovSgWSAi2bjmjYx1vgquXkv1 G/Z1N5TFeGFr24zBwB6rqGZd8HPNxp9pOcuSCkDV94LRZN6lyw+jki1ialGEHA+UEErisUv pZyaR57473diVGKiLeOc6XjJybHN2YMNknFtbZ4ko/IkPO3ACJRw9myICS0SlJBmWq1m7Bb K5k+8avGHDQtue9TFjSkQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:fAz9jXfXee4=:LPBPQqSR+at0H+fQYBnvQa 4bktVz9882+6URwsUo+kbK97QGroxqdNz88bLDzYSxpmUeCbj69CktEc3TtOgJFJ2t6T74aBz 89+nCmqGUjEazUhJJGn+PtcECldeP+6OwjmTNcH3eixfiVUrDRja9LyaWzdxaSu4IbSjbIBna g5U/wOZ9v2joyvaWzi69kJzUYrwaDIIGof3Pa8wI0iRDf6186GLKpg8t+CNtNTqdKtEXO0G2Y 5TCmya1npBWIfV/TXAsTljFraFNf6R8yOPvKf7GOSIttWUTLzZLRAFbql3Uqxl1yzPijXq2Hb Si7ORHchaxion/ioREMs4IJ5V0qma3bnCd5j/NXNoCN45uG5ImWNwrcNl8F2tTfUO5RCOcDcV T1+QLsjehOncnKIP4su0xA+Av6I1S0b4h3Fhoo+oSg2gXkTgd7ri8CSMFDS1pNpOGkSm5nC5M dHNxVbNli8mclNJL9bExv31fUbNmFBHvTfYfiFwJMeEQKsOU6afAVHjVrIFl0yz6TaHRFWt90 Rbal/odjA+bJ0BEDKESose4tS6cMHfQNfpAs3tGzNU7L+DygLWIw6k1FWPTMgTv1U/uy5qkRE Npl6tmzhyfkKwSlls2Dq0sOOcZ6Lazd26DM1VmnLupnBNTmjup6NF1tjHDTGh9xroovusGSsU tmiUt5WbOjE2bY+DNJ9XczjJC406SfZZFG/Y1cJqEBQcaod2Mz84gLJLvWCPZlkTKdks= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Build-testing this driver with -Wmaybe-uninitialized gives a new false-positive warning that I can't really explain: drivers/net/ethernet/mellanox/mlx5/core/en_tc.c: In function 'mlx5e_configure_flower': drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:509:3: error: 'old_attr' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's obvious from the code that 'old_attr' is initialized whenever 'old' is non-NULL here. The warning appears with all versions I tested from gcc-4.7 through gcc-6.1, and I could not come up with a way to rewrite the function in a more readable way that avoids the warning, so I'm adding another initialization to shut it up. Fixes: 8b32580df1cb ("net/mlx5e: Add TC vlan action for SRIOV offloads") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index a350b7171e3d..ce8c54d18906 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -451,7 +451,7 @@ int mlx5e_configure_flower(struct mlx5e_priv *priv, __be16 protocol, struct mlx5e_tc_flow *flow; struct mlx5_flow_spec *spec; struct mlx5_flow_rule *old = NULL; - struct mlx5_esw_flow_attr *old_attr; + struct mlx5_esw_flow_attr *old_attr = NULL; struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; if (esw && esw->mode == SRIOV_OFFLOADS)