All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipsec-secgw: fix anonymous union initialization
@ 2016-04-08 17:01 Pablo de Lara
  2016-04-08 20:19 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo de Lara @ 2016-04-08 17:01 UTC (permalink / raw)
  To: dev; +Cc: sergio.gonzalez.monroy, Pablo de Lara

In icc 14.0, compilation was broken:

examples/ipsec-secgw/sa.c(212): error: a designator for an anonymous
union member can only appear within braces corresponding to that anonymous union
        .cipher = { RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
         ^

The member in anonymous union initialization should be inside '{}',
otherwise it will report an error.

Fixes: d299106e8e31 (examples/ipsec-secgw: add IPsec sample application)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 examples/ipsec-secgw/sa.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index a5b8a63..b6260ed 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -209,15 +209,17 @@ static uint8_t cipher_key[256] = "sixteenbytes key";
 const struct rte_crypto_sym_xform aescbc_enc_xf = {
 	NULL,
 	RTE_CRYPTO_SYM_XFORM_CIPHER,
-	.cipher = { RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
+	{.cipher = { RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
 		.key = { cipher_key, 16 } }
+	}
 };
 
 const struct rte_crypto_sym_xform aescbc_dec_xf = {
 	NULL,
 	RTE_CRYPTO_SYM_XFORM_CIPHER,
-	.cipher = { RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
+	{.cipher = { RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
 		.key = { cipher_key, 16 } }
+	}
 };
 
 static uint8_t auth_key[256] = "twentybytes hash key";
@@ -226,28 +228,32 @@ static uint8_t auth_key[256] = "twentybytes hash key";
 const struct rte_crypto_sym_xform sha1hmac_gen_xf = {
 	NULL,
 	RTE_CRYPTO_SYM_XFORM_AUTH,
-	.auth = { RTE_CRYPTO_AUTH_OP_GENERATE, RTE_CRYPTO_AUTH_SHA1_HMAC,
+	{.auth = { RTE_CRYPTO_AUTH_OP_GENERATE, RTE_CRYPTO_AUTH_SHA1_HMAC,
 		.key = { auth_key, 20 }, 12, 0 }
+	}
 };
 
 const struct rte_crypto_sym_xform sha1hmac_verify_xf = {
 	NULL,
 	RTE_CRYPTO_SYM_XFORM_AUTH,
-	.auth = { RTE_CRYPTO_AUTH_OP_VERIFY, RTE_CRYPTO_AUTH_SHA1_HMAC,
+	{.auth = { RTE_CRYPTO_AUTH_OP_VERIFY, RTE_CRYPTO_AUTH_SHA1_HMAC,
 		.key = { auth_key, 20 }, 12, 0 }
+	}
 };
 
 /* AES CBC xform */
 const struct rte_crypto_sym_xform null_cipher_xf = {
 	NULL,
 	RTE_CRYPTO_SYM_XFORM_CIPHER,
-	.cipher = { .algo = RTE_CRYPTO_CIPHER_NULL }
+	{.cipher = { .algo = RTE_CRYPTO_CIPHER_NULL }
+	}
 };
 
 const struct rte_crypto_sym_xform null_auth_xf = {
 	NULL,
 	RTE_CRYPTO_SYM_XFORM_AUTH,
-	.auth = { .algo = RTE_CRYPTO_AUTH_NULL }
+	{.auth = { .algo = RTE_CRYPTO_AUTH_NULL }
+	}
 };
 
 struct sa_ctx {
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipsec-secgw: fix anonymous union initialization
  2016-04-08 17:01 [PATCH] ipsec-secgw: fix anonymous union initialization Pablo de Lara
@ 2016-04-08 20:19 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2016-04-08 20:19 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, sergio.gonzalez.monroy

> In icc 14.0, compilation was broken:
> 
> examples/ipsec-secgw/sa.c(212): error: a designator for an anonymous
> union member can only appear within braces corresponding to that anonymous union
>         .cipher = { RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
>          ^
> 
> The member in anonymous union initialization should be inside '{}',
> otherwise it will report an error.
> 
> Fixes: d299106e8e31 (examples/ipsec-secgw: add IPsec sample application)
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-08 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 17:01 [PATCH] ipsec-secgw: fix anonymous union initialization Pablo de Lara
2016-04-08 20:19 ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.