From patchwork Wed Jan 27 14:04:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101070 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2603639lbb; Wed, 27 Jan 2016 06:08:57 -0800 (PST) X-Received: by 10.98.42.135 with SMTP id q129mr42140357pfq.13.1453903737162; Wed, 27 Jan 2016 06:08:57 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si1795812pfd.42.2016.01.27.06.08.56; Wed, 27 Jan 2016 06:08:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933131AbcA0OIv (ORCPT + 30 others); Wed, 27 Jan 2016 09:08:51 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:49522 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932708AbcA0OIn (ORCPT ); Wed, 27 Jan 2016 09:08:43 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0LjiA5-1ZnA4X0nRx-00boEU; Wed, 27 Jan 2016 15:08:00 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , netdev@vger.kernel.org, Prashant Sreedharan , Michael Chan , linux-kernel@vger.kernel.org Subject: [PATCH 9/9] net: tg3: avoid uninitialized variable warning Date: Wed, 27 Jan 2016 15:04:59 +0100 Message-Id: <1453903507-3427225-10-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453903507-3427225-1-git-send-email-arnd@arndb.de> References: <1453903507-3427225-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:Dw2uUYStqQxxR8NotsSB+UQvTkysL85mD0c7HPXXB3Ct78QH6BE XfVPRnbROVPIXTmTUVhB9m2r2dI9oxhja1STXXNOtNWEoFrHatLyr0BcJPS7Nbn1dvcX6NX aLIfAZkSUyxQVQqS4HFS7ZEreVc/FBKz3XeaiaxybXFYeyOoo5ipqK0MidgIR+9v2UdMM/C G4L7N/kl9qDj1yKw6F5gA== X-UI-Out-Filterresults: notjunk:1; V01:K0:idBzTdFgf7Q=:vQRc6zfLBg6/5LJhQ6dr/p ac/+dtY+wUmfkYJ5ivMOmKJ3F0AcTBP5nKewi9nQXm1g+ezfevbVVfOfOPtaVAEvcU3+zbprv yjRpQPlMcZHI6p5ZsUqB7A89FtldmSePCFeH8bxFVYTjLZnu0LRQw5k3lG6nmZSw2sx0AFpoV oa0S4vFbizLeustMHllkUk4VrEcyK3VRWxCp4g+JOdzxYdWpseqHQ/y0Hm3kuSsmfSFqfBI59 vi8/TE/UEQM0Yyxc5gsaqPRO524LjVGfOTuNrBnoNU8sbmJTyPOCPmZkNW+03rRQelEpaOVBc K+zTHHjlLge9VaG5IPBl9UUcuZaKe5QwlTAk03Myzekk1MG8tRlOguLbzhKagfnO5/12mDMl+ WA5AeuPjxTNETZNUDCxtW99/vUkBi20lbEj0LH+OWLxhRAkvih1IfiWcrxTovnDPJ8XPKcNgq 0JhRlBr7jxtKjotcI/gYxHgUa9jsTFf9wKLP3xRjbMXFgByNFcFksXmCiSVpLxiaE4TJiVvPw xMWsFwyB4hbH13NcIuYI12JG9eZ0132Svm6Oh56WDc9wfKPOXyAEAAADck7dpty5pWyAgSlck nijuVBhAjs2tUpH/7cs4KbxeN4fIpX4cwjJ+ddL/K40jeZiAbtCKed5P17aoQzuhTyhcglARd dQ84rcePld8BVbKi/A5ZWlH/f6nVFHavhybOHNC5RsTjzWRUuP5k+UpsgBqyUKVxCiZc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The tg3_set_eeprom() function correctly initializes the 'start' variable, but gcc generates a false warning: drivers/net/ethernet/broadcom/tg3.c: In function 'tg3_set_eeprom': drivers/net/ethernet/broadcom/tg3.c:12057:4: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized] I have not come up with a way to restructure the code in a way that avoids the warning without making it less readable, so this adds an initialization for the declaration to shut up that warning. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 9293675df7ba..49eea8981332 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -12016,7 +12016,7 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, int ret; u32 offset, len, b_offset, odd_len; u8 *buf; - __be32 start, end; + __be32 start = 0, end; if (tg3_flag(tp, NO_NVRAM) || eeprom->magic != TG3_EEPROM_MAGIC)