* [PATCH] enic: fix of compile error
@ 2014-12-09 8:56 Helin Zhang
[not found] ` <1418115370-31965-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Helin Zhang @ 2014-12-09 8:56 UTC (permalink / raw)
To: dev-VfR2kkLFssw
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] enic: fix of compile error
[not found] ` <1418115370-31965-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2014-12-11 1:03 ` Thomas Monjalon
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2014-12-11 1:03 UTC (permalink / raw)
To: Helin Zhang; +Cc: dev-VfR2kkLFssw
> 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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Applied
Thanks
--
Thomas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-11 1:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 8:56 [PATCH] enic: fix of compile error Helin Zhang
[not found] ` <1418115370-31965-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-11 1:03 ` Thomas Monjalon
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).