Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1307695
| From | Michael Chan <mchan@broadcom.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: bnxt: always return values from _bnxt_get_max_rings |
| Date | 2016-01-12 19:00 +0100 |
| Message-ID | <qQboD-4jE-19@gated-at.bofh.it> (permalink) |
| References | <qQ8K6-2Id-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] net: bnxt: always return values from _bnxt_get_max_rings Arnd Bergmann <arnd@arndb.de> - 2016-01-12 16:10 +0100 Re: [PATCH] net: bnxt: always return values from _bnxt_get_max_rings Michael Chan <mchan@broadcom.com> - 2016-01-12 19:00 +0100 Re: [PATCH] net: bnxt: always return values from _bnxt_get_max_rings David Miller <davem@davemloft.net> - 2016-01-12 22:50 +0100
csiph-web