From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753897AbcIAVrY (ORCPT ); Thu, 1 Sep 2016 17:47:24 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:39418 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753350AbcIAVrV (ORCPT ); Thu, 1 Sep 2016 17:47:21 -0400 Date: Thu, 01 Sep 2016 10:01:08 -0700 (PDT) Message-Id: <20160901.100108.1348875318377995073.davem@davemloft.net> To: arnd@arndb.de Cc: isubramanian@apm.com, kchudgar@apm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: xgene: fix backward compatibility fix From: David Miller In-Reply-To: <20160829123740.3336010-1-arnd@arndb.de> References: <20160829123740.3336010-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]); Thu, 01 Sep 2016 10:01:09 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Mon, 29 Aug 2016 14:37:14 +0200 > A bugfix for backward compatibility handling introduced undefined > behavior for the case that of_parse_phandle() does not return > a valid entry, as "gcc -Wmaybe-unused" reports: > > drivers/net/ethernet/apm/xgene/xgene_enet_hw.c: In function 'xgene_enet_phy_connect': > drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:776:6: error: 'phy_dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] > drivers/net/ethernet/apm/xgene/xgene_enet_hw.c: In function 'xgene_enet_mdio_config': > drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:776:6: error: 'phy_dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > We can work around this by removing the check for zero "np", as > of_phy_connect() will correctly handle a NULL argument so we fall > back into the normal error handling case. > > Note that I had previously fixed another bug that resulted in the > exact same warning, but this is a different problem that was > introduced after my original fix. > > Signed-off-by: Arnd Bergmann > Fixes: 03377e381bf4 ("drivers: net: xgene: Fix backward compatibility") Applied.