From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbcAFFBQ (ORCPT ); Wed, 6 Jan 2016 00:01:16 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:33643 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbcAFFBP (ORCPT ); Wed, 6 Jan 2016 00:01:15 -0500 Date: Wed, 06 Jan 2016 00:01:12 -0500 (EST) Message-Id: <20160106.000112.1783241133330740168.davem@davemloft.net> To: arnd@arndb.de Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yisen.zhuang@huawei.com, yankejian@huawei.com, lisheng011@huawei.com, huangdaode@hisilicon.com, salil.mehta@huawei.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] net: hns: avoid uninitialized variable warning: From: David Miller In-Reply-To: <6649249.INrAY8KJG0@wuerfel> References: <6649249.INrAY8KJG0@wuerfel> 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]); Tue, 05 Jan 2016 21:01:14 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Fri, 01 Jan 2016 23:27:57 +0100 > gcc fails to see that the use of the 'last_offset' variable > in hns_nic_reuse_page() is used correctly and issues a bogus > warning: > > drivers/net/ethernet/hisilicon/hns/hns_enet.c: In function 'hns_nic_reuse_page': > drivers/net/ethernet/hisilicon/hns/hns_enet.c:541:6: warning: 'last_offset' may be used uninitialized in this function [-Wmaybe-uninitialized] > > This simplifies the function to make it more obvious what is > going on to both readers and compilers, which makes the warning > go away. > > Signed-off-by: Arnd Bergmann Applied, thanks.