From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754090AbcALVox (ORCPT ); Tue, 12 Jan 2016 16:44:53 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:54318 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752489AbcALVov (ORCPT ); Tue, 12 Jan 2016 16:44:51 -0500 Date: Tue, 12 Jan 2016 16:44:48 -0500 (EST) Message-Id: <20160112.164448.2146712741894114084.davem@davemloft.net> To: arnd@arndb.de Cc: netdev@vger.kernel.org, mchan@broadcom.com, huangjw@broadcom.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: bnxt: always return values from _bnxt_get_max_rings From: David Miller In-Reply-To: <4309490.qRrvvx0n1Q@wuerfel> References: <4309490.qRrvvx0n1Q@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, 12 Jan 2016 13:44:51 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Tue, 12 Jan 2016 16:05:08 +0100 > Newly added code in the bnxt driver uses a couple of variables that > are never initialized when CONFIG_BNXT_SRIOV is not set, and gcc > correctly warns about that: > > In file included from include/linux/list.h:8:0, > from include/linux/module.h:9, > from drivers/net/ethernet/broadcom/bnxt/bnxt.c:10: > drivers/net/ethernet/broadcom/bnxt/bnxt.c: In function 'bnxt_get_max_rings': > include/linux/kernel.h:794:26: warning: 'cp' may be used uninitialized in this function [-Wmaybe-uninitialized] > include/linux/kernel.h:794:26: warning: 'tx' may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/net/ethernet/broadcom/bnxt/bnxt.c:5730:11: warning: 'rx' may be used uninitialized in this function [-Wmaybe-uninitialized] > drivers/net/ethernet/broadcom/bnxt/bnxt.c:5736:6: note: 'rx' was declared here > > This changes the condition so that we fall back to using the PF > data if VF is not available, and always initialize the variables > to something useful. > > Signed-off-by: Arnd Bergmann > Fixes: 6e6c5a57fbe1 ("bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.") Applied, thanks Arnd.