* [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation
@ 2014-12-05 15:57 Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Bruce Richardson @ 2014-12-05 15:57 UTC (permalink / raw)
To: dev, ssujith
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
* [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang
2014-12-05 15:57 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
@ 2014-12-05 15:57 ` Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [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, ssujith
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@intel.com>
---
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 [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/2] enic: fix error with uninitialized variable.
2014-12-05 15:57 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson
@ 2014-12-05 15:57 ` Bruce Richardson
2014-12-05 21:11 ` [dpdk-dev] [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, ssujith
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@intel.com>
---
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 [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation
2014-12-05 15:57 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [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
> 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: [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation
2014-12-05 15:57 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
` (2 preceding siblings ...)
2014-12-05 21:11 ` [dpdk-dev] [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
On 05/12/14 9:27 pm, "Bruce Richardson" <bruce.richardson@intel.com> 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 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang Bruce Richardson
2014-12-05 15:57 ` [dpdk-dev] [PATCH 2/2] enic: fix error with uninitialized variable Bruce Richardson
2014-12-05 21:11 ` [dpdk-dev] [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).