* [PATCH 0/2] enic fixes for clang compilation @ 2014-12-05 15:57 Bruce Richardson [not found] ` <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Bruce Richardson @ 2014-12-05 15:57 UTC (permalink / raw) To: dev-VfR2kkLFssw, ssujith-FYB4Gu1CFyUAvxtiuMwx3w Compiling latest DPDK with clang 3.3 on FreeBSD 10 shows up a number of compilation errors in the enic driver. These two small patches fix those errors. Bruce Richardson (2): enic: fix initialization error with clang enic: fix error with uninitialized variable. lib/librte_pmd_enic/enic_clsf.c | 2 +- lib/librte_pmd_enic/vnic/vnic_dev.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.1.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* [PATCH 1/2] enic: fix initialization error with clang [not found] ` <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2014-12-05 15:57 ` Bruce Richardson 2014-12-05 15:57 ` [PATCH 2/2] enic: fix error with uninitialized variable Bruce Richardson ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Bruce Richardson @ 2014-12-05 15:57 UTC (permalink / raw) To: dev-VfR2kkLFssw, ssujith-FYB4Gu1CFyUAvxtiuMwx3w This patch fixes the following compiler error raised by clang 3.3 on FreeBSD 10: CC enic_clsf.o /usr/home/bruce/dpdk.org/lib/librte_pmd_enic/enic_clsf.c:99:25: fatal error: missing field 'u' initializer [-Wmissing-field-initializers] struct filter fltr = {0}; It fixes it by changing the initializer to set a named field to zero, thereby automatically setting the rest of the unnamed fields also to zero. Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- lib/librte_pmd_enic/enic_clsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_pmd_enic/enic_clsf.c b/lib/librte_pmd_enic/enic_clsf.c index 30a4def..577a382 100644 --- a/lib/librte_pmd_enic/enic_clsf.c +++ b/lib/librte_pmd_enic/enic_clsf.c @@ -96,7 +96,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_fdir_filter *params, u16 queue, u8 drop) { struct enic_fdir_node *key; - struct filter fltr = {0}; + struct filter fltr = {.type = 0}; int32_t pos; u8 do_free = 0; u16 old_fltr_id = 0; -- 2.1.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] enic: fix error with uninitialized variable. [not found] ` <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2014-12-05 15:57 ` [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson @ 2014-12-05 15:57 ` Bruce Richardson 2014-12-05 21:11 ` [PATCH 0/2] enic fixes for clang compilation Thomas Monjalon 2014-12-07 15:21 ` Sujith Sankar (ssujith) 3 siblings, 0 replies; 5+ messages in thread From: Bruce Richardson @ 2014-12-05 15:57 UTC (permalink / raw) To: dev-VfR2kkLFssw, ssujith-FYB4Gu1CFyUAvxtiuMwx3w The variable notify_pa is only initialized inside one branch of an if statement, triggering a compiler error with clang 3.3 on FreeBSD. CC vnic/vnic_dev.o /usr/home/bruce/dpdk.org/lib/librte_pmd_enic/vnic/vnic_dev.c:777:6: fatal error: variable 'notify_pa' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!vnic_dev_in_reset(vdev)) { Fix this issue by adding "= 0" to the variable definition. Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- lib/librte_pmd_enic/vnic/vnic_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c b/lib/librte_pmd_enic/vnic/vnic_dev.c index 21d5521..b1cd63f 100644 --- a/lib/librte_pmd_enic/vnic/vnic_dev.c +++ b/lib/librte_pmd_enic/vnic/vnic_dev.c @@ -764,7 +764,7 @@ int vnic_dev_notify_setcmd(struct vnic_dev *vdev, int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) { void *notify_addr = NULL; - dma_addr_t notify_pa; + dma_addr_t notify_pa = 0; char name[NAME_MAX]; static u32 instance; -- 2.1.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] enic fixes for clang compilation [not found] ` <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2014-12-05 15:57 ` [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson 2014-12-05 15:57 ` [PATCH 2/2] enic: fix error with uninitialized variable Bruce Richardson @ 2014-12-05 21:11 ` Thomas Monjalon 2014-12-07 15:21 ` Sujith Sankar (ssujith) 3 siblings, 0 replies; 5+ messages in thread From: Thomas Monjalon @ 2014-12-05 21:11 UTC (permalink / raw) To: Bruce Richardson; +Cc: dev-VfR2kkLFssw > Compiling latest DPDK with clang 3.3 on FreeBSD 10 shows up a number of compilation > errors in the enic driver. These two small patches fix those errors. > > Bruce Richardson (2): > enic: fix initialization error with clang > enic: fix error with uninitialized variable. Acked and applied Thanks -- Thomas ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] enic fixes for clang compilation [not found] ` <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> ` (2 preceding siblings ...) 2014-12-05 21:11 ` [PATCH 0/2] enic fixes for clang compilation Thomas Monjalon @ 2014-12-07 15:21 ` Sujith Sankar (ssujith) 3 siblings, 0 replies; 5+ messages in thread From: Sujith Sankar (ssujith) @ 2014-12-07 15:21 UTC (permalink / raw) To: Bruce Richardson, dev-VfR2kkLFssw@public.gmane.org On 05/12/14 9:27 pm, "Bruce Richardson" <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote: >Compiling latest DPDK with clang 3.3 on FreeBSD 10 shows up a number of >compilation >errors in the enic driver. These two small patches fix those errors. > >Bruce Richardson (2): > enic: fix initialization error with clang > enic: fix error with uninitialized variable. Sorry for the delay. Was away for a couple of days. Looks good. Thanks ! > > lib/librte_pmd_enic/enic_clsf.c | 2 +- > lib/librte_pmd_enic/vnic/vnic_dev.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >-- >2.1.0 > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-12-07 15:21 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-12-05 15:57 [PATCH 0/2] enic fixes for clang compilation Bruce Richardson [not found] ` <1417795032-23524-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2014-12-05 15:57 ` [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson 2014-12-05 15:57 ` [PATCH 2/2] enic: fix error with uninitialized variable Bruce Richardson 2014-12-05 21:11 ` [PATCH 0/2] enic fixes for clang compilation Thomas Monjalon 2014-12-07 15:21 ` Sujith Sankar (ssujith)
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).