From: Marvin Liu Date: Thu, 19 Mar 2015 03:16:55 +0000 (+0800) Subject: enic: fix build with gcc < 4.4 X-Git-Tag: spdx-start~9395 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3fb20a41a469e89d08ba5e409d3f24682bae326d;p=dpdk.git enic: fix build with gcc < 4.4 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 --- diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index c66f1392e8..0892b3e2b2 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];