mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Chan <mchan@broadcom.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: <netdev@vger.kernel.org>, "David S. Miller" <davem@davemloft.net>,
	Jeffrey Huang <huangjw@broadcom.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: bnxt: always return values from _bnxt_get_max_rings
Date: Tue, 12 Jan 2016 09:55:43 -0800	[thread overview]
Message-ID: <1452621343.13732.1.camel@LTIRV-MCHAN1.corp.ad.broadcom.com> (raw)
In-Reply-To: <4309490.qRrvvx0n1Q@wuerfel>

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 <arnd@arndb.de>
> 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 <mchan@broadcom.com>

  reply	other threads:[~2016-01-12 17:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 15:05 Arnd Bergmann
2016-01-12 17:55 ` Michael Chan [this message]
2016-01-12 21:44 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452621343.13732.1.camel@LTIRV-MCHAN1.corp.ad.broadcom.com \
    --to=mchan@broadcom.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=huangjw@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®