From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933242AbcLICbU (ORCPT ); Thu, 8 Dec 2016 21:31:20 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:47912 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932672AbcLICbS (ORCPT ); Thu, 8 Dec 2016 21:31:18 -0500 Date: Thu, 08 Dec 2016 21:31:16 -0500 (EST) Message-Id: <20161208.213116.355037793343857244.davem@davemloft.net> To: arnd@arndb.de Cc: isubramanian@apm.com, kchudgar@apm.com, qnguyen@apm.com, kdinh@apm.com, toanle@apm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 3/3] net: xgene: avoid bogus maybe-uninitialized warning From: David Miller In-Reply-To: <20161208215727.44841-3-arnd@arndb.de> References: <20161208215727.44841-1-arnd@arndb.de> <20161208215727.44841-3-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 25.1 / 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]); Thu, 08 Dec 2016 17:31:57 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Thu, 8 Dec 2016 22:57:05 +0100 > In some configurations, gcc cannot trace the state of variables > across a spin_unlock() barrier, leading to a warning about > correct code: > > xgene_enet_main.c: In function 'xgene_enet_start_xmit': > ../../../phy/mdio-xgene.h:112:14: error: 'mss_index' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > Here we can trivially move the assignment before that spin_unlock, > which reliably avoids the warning. > > Fixes: e3978673f514 ("drivers: net: xgene: Fix MSS programming") > Signed-off-by: Arnd Bergmann Applied.