From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932338AbcHCTEA (ORCPT ); Wed, 3 Aug 2016 15:04:00 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:47258 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757964AbcHCTDv (ORCPT ); Wed, 3 Aug 2016 15:03:51 -0400 Date: Wed, 03 Aug 2016 11:52:32 -0700 (PDT) Message-Id: <20160803.115232.837383021887790928.davem@davemloft.net> To: arnd@arndb.de Cc: isubramanian@apm.com, kchudgar@apm.com, tinamdar@apm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: xgene: fix maybe-uninitialized variable From: David Miller In-Reply-To: <20160802102348.81986-1-arnd@arndb.de> References: <20160802102348.81986-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]); Wed, 03 Aug 2016 11:52:33 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Tue, 2 Aug 2016 12:23:29 +0200 > Building with -Wmaybe-uninitialized shows a potential use of > an uninitialized variable: > > drivers/net/ethernet/apm/xgene/xgene_enet_hw.c: In function 'xgene_enet_phy_connect': > drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:802:23: warning: 'phy_dev' may be used uninitialized in this function [-Wmaybe-uninitialized] > > Although the compiler correctly identified this based on the function, > the current code is still safe as long dev->of_node is non-NULL > for the case of CONFIG_ACPI=n, which is currently the case. > > The warning is now disabled by default, but still appears when > building with W=1, and other build test tools should be able to > detect it as well. Adding an #else clause here makes the code > more robust and makes it clear to the compiler that this cannot > happen. > > Signed-off-by: Arnd Bergmann > Fixes: 8089a96f601b ("drivers: net: xgene: Add backward compatibility") Applied.