From: Yong Liu <yong.liu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/6] fix build error when initialized structure in enic driver
Date: Thu, 19 Mar 2015 11:16:55 +0800 [thread overview]
Message-ID: <1426735018-19411-6-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1426735018-19411-1-git-send-email-yong.liu@intel.com>
From: Marvin Liu <yong.liu@intel.com>
gcc4.3 will raise warnings in blow code for initialized field overwritten.
enic_main.c: In function ‘enic_set_rsskey’:
enic_main.c:845: error: initialized field overwritten
enic_main.c:845: error: (near initialization for ‘rss_key.key’)
enic_main.c:846: error: initialized field overwritten
enic_main.c:846: error: (near initialization for ‘rss_key.key’)
enic_main.c:847: error: initialized field overwritten
enic_main.c:847: error: (near initialization for ‘rss_key.key’)
static union vnic_rss_key rss_key = {
.key[0] = ...,
.key[1] = ...,
.key[2] = ...,
.key[3] = ...,
};
Change struct initialized code reference to ISO 9899 section 6.7.8.
gcc4.3 will happy for that.
static union vnic_rss_key rss_key = {
.key = {
[0] = ...,
[1] = ...,
[2] = ...,
[3] = ...,
}
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c
index c66f139..0892b3e 100644
--- a/lib/librte_pmd_enic/enic_main.c
+++ b/lib/librte_pmd_enic/enic_main.c
@@ -840,10 +840,12 @@ static int enic_set_rsskey(struct enic *enic)
dma_addr_t rss_key_buf_pa;
union vnic_rss_key *rss_key_buf_va = NULL;
static union vnic_rss_key rss_key = {
- .key[0] = {.b = {85, 67, 83, 97, 119, 101, 115, 111, 109, 101}},
- .key[1] = {.b = {80, 65, 76, 79, 117, 110, 105, 113, 117, 101}},
- .key[2] = {.b = {76, 73, 78, 85, 88, 114, 111, 99, 107, 115}},
- .key[3] = {.b = {69, 78, 73, 67, 105, 115, 99, 111, 111, 108}},
+ .key = {
+ [0] = {.b = {85, 67, 83, 97, 119, 101, 115, 111, 109, 101}},
+ [1] = {.b = {80, 65, 76, 79, 117, 110, 105, 113, 117, 101}},
+ [2] = {.b = {76, 73, 78, 85, 88, 114, 111, 99, 107, 115}},
+ [3] = {.b = {69, 78, 73, 67, 105, 115, 99, 111, 111, 108}},
+ }
};
int err;
u8 name[NAME_MAX];
--
1.9.3
next prev parent reply other threads:[~2015-03-19 3:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu
2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
2015-03-19 8:40 ` Thomas Monjalon
2015-03-19 3:16 ` [dpdk-dev] [PATCH 1/6] fix sse3 functions not found with gcc 4.3.4 Yong Liu
2015-03-19 3:16 ` [dpdk-dev] [PATCH] fix the net device bugs and add some funcs to generate vfs in net_device Yong Liu
2015-03-19 3:21 ` Liu, Yong
2015-03-19 3:16 ` [dpdk-dev] [PATCH 2/6] fix fm10k driver build error when gcc version elder than 4.4 Yong Liu
2015-03-19 3:16 ` Yong Liu [this message]
2015-03-19 3:16 ` [dpdk-dev] [PATCH 4/6] fix build error in app/test with gcc4.3 Yong Liu
2015-03-19 3:16 ` [dpdk-dev] [PATCH 5/6] " Yong Liu
2015-03-19 3:16 ` [dpdk-dev] [PATCH 6/6] fix build error for implicit declaration of function pread Yong Liu
2015-03-22 23:02 ` [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 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=1426735018-19411-6-git-send-email-yong.liu@intel.com \
--to=yong.liu@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).