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: 9358611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68AF0600C8 for ; Fri, 30 Sep 2016 16:17:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 508EA2A0D4 for ; Fri, 30 Sep 2016 16:17:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 425CF2A0DB; Fri, 30 Sep 2016 16:17:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9EE52A0D4 for ; Fri, 30 Sep 2016 16:17:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933817AbcI3QRq (ORCPT ); Fri, 30 Sep 2016 12:17:46 -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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Or Gerlitz --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)