From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbcGYRdf (ORCPT ); Mon, 25 Jul 2016 13:33:35 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:42536 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbcGYRdc (ORCPT ); Mon, 25 Jul 2016 13:33:32 -0400 Date: Mon, 25 Jul 2016 10:33:31 -0700 (PDT) Message-Id: <20160725.103331.1354056319823788243.davem@davemloft.net> To: arnd@arndb.de Cc: gwshan@linux.vnet.ibm.com, joel@jms.id.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning From: David Miller In-Reply-To: <20160721192927.3182806-1-arnd@arndb.de> References: <20160721192927.3182806-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]); Mon, 25 Jul 2016 10:33:32 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Thu, 21 Jul 2016 21:28:34 +0200 > gcc-4.9 and higher warn about the newly added NSCI code: > > net/ncsi/ncsi-manage.c: In function 'ncsi_process_next_channel': > net/ncsi/ncsi-manage.c:1003:2: error: 'old_state' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > The warning is a false positive and therefore harmless, but it would be good to > avoid it anyway. I have determined that the barrier in the spin_unlock_irqsave() > is what confuses gcc to the point that it cannot track whether the variable > was unused or not. > > This rearranges the code in a way that makes it obvious to gcc that old_state > is always initialized at the time of use, functionally this should not > change anything. > > Signed-off-by: Arnd Bergmann Applied.