enic: fix build with gcc < 4.4
authorMarvin Liu <yong.liu@intel.com>
Thu, 19 Mar 2015 03:16:55 +0000 (11:16 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 22 Mar 2015 23:31:19 +0000 (00:31 +0100)
commit3fb20a41a469e89d08ba5e409d3f24682bae326d
treeb32f30e926ae4ceb9e7ab5a5acb2a632992c43b8
parent5c23bef99aeb01648c107f57dc397f2f6099fee6
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 <yong.liu@intel.com>
lib/librte_pmd_enic/enic_main.c