From: Or Gerlitz <ogerlitz@mellanox.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
"Matan Barak" <matanb@mellanox.com>,
Amir Vadai <amirv@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>,
Shani Michaeli <shanim@mellanox.com>,
Ido Shamay <idos@mellanox.com>
Subject: Re: [PATCH V1 net-next 5/5] net/mlx4_core: Add retrieval of CONFIG_DEV parameters
Date: Wed, 5 Nov 2014 11:19:46 +0200 [thread overview]
Message-ID: <5459EBB2.1040609@mellanox.com> (raw)
In-Reply-To: <1415119714.1005.3.camel@edumazet-glaptop2.roam.corp.google.com>
On 11/4/2014 6:48 PM, Eric Dumazet wrote:
> This added following warnings :
>
> CC drivers/net/ethernet/mellanox/mlx4/fw.o
> drivers/net/ethernet/mellanox/mlx4/fw.c: In function 'mlx4_config_dev_retrieval':
> drivers/net/ethernet/mellanox/mlx4/fw.c:1944:12: warning: 'config_dev.rx_checksum_val' may be used uninitialized in this function [-Wmaybe-uninitialized]
> In file included from include/linux/swab.h:4:0,
> from include/uapi/linux/byteorder/little_endian.h:12,
> from include/linux/byteorder/little_endian.h:4,
> from ./arch/x86/include/uapi/asm/byteorder.h:4,
> from include/asm-generic/bitops/le.h:5,
> from ./arch/x86/include/asm/bitops.h:504,
> from include/linux/bitops.h:33,
> from include/linux/kernel.h:10,
> from include/linux/skbuff.h:17,
> from include/linux/if_ether.h:23,
> from include/linux/etherdevice.h:25,
> from drivers/net/ethernet/mellanox/mlx4/fw.c:35:
> include/uapi/linux/swab.h:53:93: warning: 'config_dev.vxlan_udp_dport' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/net/ethernet/mellanox/mlx4/fw.c:1922:25: note: 'config_dev.vxlan_udp_dport' was declared here
>
>
Oh, missed that since we build with CONFIG_CC_OPTIMIZE_FOR_SIZE which
for some reason cause the kernel Makefile to mask away that warning?!
> ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
> else
> KBUILD_CFLAGS += -O2
> endif
Anyway, this seems as false positive since just before using the struct
mlx4_config_dev instance we go through mlx4_CONFIG_DEV_get() which
either fills in values for the fields or return error and in that case,
we don't use them... the below patch makes gcc (4.8.2) happy, but it's
not really needed... thoughts?
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c
b/drivers/net/ethernet/mellanox/mlx4/fw.c
index d6dba77..9a4703f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -1929,7 +1929,7 @@ int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_CONFIG_DEV))
return -ENOTSUPP;
-
+ memset(&config_dev, 0, sizeof(config_dev));
err = mlx4_CONFIG_DEV_get(dev, &config_dev);
if (err)
return err;
Or.
next prev parent reply other threads:[~2014-11-05 9:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-02 14:26 [PATCH V1 net-next 0/5] Mellanox ethernet driver update Oct-30-2014 Or Gerlitz
2014-11-02 14:26 ` [PATCH V1 net-next 1/5] net/mlx4_core: Prevent VF from changing port configuration Or Gerlitz
2014-11-02 14:26 ` [PATCH V1 net-next 2/5] net/mlx4_core: Protect port type setting by mutex Or Gerlitz
2014-11-02 14:26 ` [PATCH V1 net-next 3/5] net/mlx4_en: Remove RX buffers alignment to IP_ALIGN Or Gerlitz
2014-11-02 14:26 ` [PATCH V1 net-next 4/5] net/mlx4_en: Add __GFP_COLD gfp flags in alloc_pages Or Gerlitz
2014-11-02 14:26 ` [PATCH V1 net-next 5/5] net/mlx4_core: Add retrieval of CONFIG_DEV parameters Or Gerlitz
2014-11-04 16:48 ` Eric Dumazet
2014-11-05 9:19 ` Or Gerlitz [this message]
2014-11-03 17:28 ` [PATCH V1 net-next 0/5] Mellanox ethernet driver update Oct-30-2014 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=5459EBB2.1040609@mellanox.com \
--to=ogerlitz@mellanox.com \
--cc=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=idos@mellanox.com \
--cc=matanb@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=shanim@mellanox.com \
/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