DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] enic: fix of compile error
Date: Tue,  9 Dec 2014 16:56:10 +0800	[thread overview]
Message-ID: <1418115370-31965-1-git-send-email-helin.zhang@intel.com> (raw)

Compile warnings/errors was found on gcc 4.7.2 as follows. Variables
was reported of being used but uninitialized. Assigning an initial
value to it is needed.

lib/librte_pmd_enic/vnic/vnic_dev.c: In function vnic_dev_get_mac_addr:
lib/librte_pmd_enic/vnic/vnic_dev.c:393:16: error: a1 may be used uninitialized in this function [-Werror=uninitialized]
lib/librte_pmd_enic/vnic/vnic_dev.c:629:10: note: a1 was declared here
lib/librte_pmd_enic/vnic/vnic_dev.c: In function vnic_dev_set_mac_addr:
lib/librte_pmd_enic/vnic/vnic_dev.c:393:16: error: a1 may be used uninitialized in this function [-Werror=uninitialized]
lib/librte_pmd_enic/vnic/vnic_dev.c:980:10: note: a1 was declared here

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_enic/vnic/vnic_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c b/lib/librte_pmd_enic/vnic/vnic_dev.c
index b1cd63f..6407994 100644
--- a/lib/librte_pmd_enic/vnic/vnic_dev.c
+++ b/lib/librte_pmd_enic/vnic/vnic_dev.c
@@ -626,7 +626,7 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done)
 
 int vnic_dev_get_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
 {
-	u64 a0, a1;
+	u64 a0, a1 = 0;
 	int wait = 1000;
 	int err, i;
 
@@ -977,7 +977,7 @@ struct rte_pci_device *vnic_dev_get_pdev(struct vnic_dev *vdev)
 
 int vnic_dev_set_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
 {
-	u64 a0, a1;
+	u64 a0, a1 = 0;
 	int wait = 1000;
 	int i;
 
-- 
1.8.1.4

             reply	other threads:[~2014-12-09  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09  8:56 Helin Zhang [this message]
2014-12-11  1:03 ` Thomas Monjalon

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=1418115370-31965-1-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).