From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734AbcJAPIL (ORCPT ); Sat, 1 Oct 2016 11:08:11 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:33085 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbcJAPID (ORCPT ); Sat, 1 Oct 2016 11:08:03 -0400 MIME-Version: 1.0 In-Reply-To: <20160930161734.70928-1-arnd@arndb.de> References: <20160930161734.70928-1-arnd@arndb.de> From: Or Gerlitz Date: Sat, 1 Oct 2016 18:08:02 +0300 Message-ID: Subject: Re: [PATCH 1/2] net/mlx5e: shut up maybe-uninitialized warning To: Arnd Bergmann Cc: Saeed Mahameed , Matan Barak , Leon Romanovsky , "David S. Miller" , Or Gerlitz , Amir Vadai , Maor Gottlieb , Linux Netdev List , "linux-rdma@vger.kernel.org" , Linux Kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 30, 2016 at 7:17 PM, Arnd Bergmann wrote: > 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 Yeah, this is clearly false positive and I was sure that newish GCCs don't show that, but you are the master here.. so FWIW Acked-by: Or Gerlitz