From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337AbcJCF4Q (ORCPT ); Mon, 3 Oct 2016 01:56:16 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:38600 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbcJCF4G (ORCPT ); Mon, 3 Oct 2016 01:56:06 -0400 Date: Mon, 03 Oct 2016 01:56:01 -0400 (EDT) Message-Id: <20161003.015601.1695276307529816567.davem@davemloft.net> To: arnd@arndb.de Cc: saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, ogerlitz@mellanox.com, amirva@mellanox.com, maorg@mellanox.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] net/mlx5e: shut up maybe-uninitialized warning From: David Miller In-Reply-To: <20160930161734.70928-1-arnd@arndb.de> References: <20160930161734.70928-1-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 02 Oct 2016 22:56:05 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Fri, 30 Sep 2016 18:17:09 +0200 > 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 Applied.