From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762919AbcALRzq (ORCPT ); Tue, 12 Jan 2016 12:55:46 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:52207 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752913AbcALRzp (ORCPT ); Tue, 12 Jan 2016 12:55:45 -0500 X-IronPort-AV: E=Sophos;i="5.20,558,1444719600"; d="scan'208";a="85155701" Subject: Re: [PATCH] net: bnxt: always return values from _bnxt_get_max_rings From: Michael Chan To: Arnd Bergmann CC: , "David S. Miller" , Jeffrey Huang , In-Reply-To: <4309490.qRrvvx0n1Q@wuerfel> References: <4309490.qRrvvx0n1Q@wuerfel> Content-Type: text/plain; charset="cp1252" Date: Tue, 12 Jan 2016 09:55:43 -0800 Message-ID: <1452621343.13732.1.camel@LTIRV-MCHAN1.corp.ad.broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-01-12 at 16:05 +0100, Arnd Bergmann wrote: > 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.") > --- > This is the fix that made most sense to me, but that doesn't mean it's > the right thing to do for this driver, so please check carefully > whether falling back to PF is actually the correct behavior. > > I'm assuming that BNXT_PF(bp) is meant to always be true if > CONFIG_BNXT_SRIOV > is disabled, but I have not verified if this is guaranteed. The assumption is correct. Patch looks good. Thanks. Acked-by: Michael Chan