drivers: fix build of crypto anonymous union initialization
authorFiona Trahe <fiona.trahe@intel.com>
Wed, 30 Mar 2016 12:49:55 +0000 (13:49 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 31 Mar 2016 19:32:19 +0000 (21:32 +0200)
In SUSE11-SP3 i686 platform, with gcc 4.5.1, there are compile issues, e.g:
  null_crypto_pmd_ops.c:44:3: error:
  unknown field 'sym' specified in initializer
  cc1: warnings being treated as errors

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

Fixes: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
drivers/crypto/null/null_crypto_pmd_ops.c
drivers/crypto/qat/qat_crypto.c
drivers/crypto/snow3g/rte_snow3g_pmd_ops.c

index 387f8d1..4dec8dd 100644 (file)
@@ -41,9 +41,9 @@
 static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
        {       /* AES GCM (AUTH) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_AES_GCM,
                                .block_size = 16,
                                .key_size = {
@@ -61,14 +61,14 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
                                        .max = 12,
                                        .increment = 4
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES GCM (CIPHER) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
+                       {.cipher = {
                                .algo = RTE_CRYPTO_CIPHER_AES_GCM,
                                .block_size = 16,
                                .key_size = {
@@ -81,8 +81,8 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
index 5a439e6..3806a66 100644 (file)
@@ -42,9 +42,9 @@
 static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
        {       /* MD5 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_MD5_HMAC,
                                .block_size = 64,
                                .key_size = {
@@ -58,14 +58,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA1 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
                                .block_size = 64,
                                .key_size = {
@@ -79,14 +79,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA224 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
                                .block_size = 64,
                                .key_size = {
@@ -100,14 +100,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA256 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
                                .block_size = 64,
                                .key_size = {
@@ -121,14 +121,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA384 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
                                .block_size = 128,
                                .key_size = {
@@ -142,14 +142,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA512 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
                                .block_size = 128,
                                .key_size = {
@@ -163,14 +163,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES XCBC HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
                                .block_size = 16,
                                .key_size = {
@@ -184,14 +184,14 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES CBC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
+                       {.cipher = {
                                .algo = RTE_CRYPTO_CIPHER_AES_CBC,
                                .block_size = 16,
                                .key_size = {
@@ -204,8 +204,8 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
index 39f8088..cf1a519 100644 (file)
@@ -41,9 +41,9 @@
 static const struct rte_cryptodev_capabilities null_crypto_pmd_capabilities[] = {
        {       /* NULL (AUTH) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_NULL,
                                .block_size = 1,
                                .key_size = {
@@ -57,14 +57,14 @@ static const struct rte_cryptodev_capabilities null_crypto_pmd_capabilities[] =
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, },
+               }, },
        },
        {       /* NULL (CIPHER) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
+                       {.cipher = {
                                .algo = RTE_CRYPTO_CIPHER_NULL,
                                .block_size = 1,
                                .key_size = {
@@ -77,8 +77,8 @@ static const struct rte_cryptodev_capabilities null_crypto_pmd_capabilities[] =
                                        .max = 0,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, },
+               }, }
        },
        RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
index 29c1fe5..5c41a89 100644 (file)
@@ -71,9 +71,9 @@
 static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
        {       /* SHA1 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
                                .block_size = 64,
                                .key_size = {
@@ -87,14 +87,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA256 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
                                .block_size = 64,
                                .key_size = {
@@ -108,14 +108,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SHA512 HMAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
                                .block_size = 128,
                                .key_size = {
@@ -129,14 +129,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES XCBC MAC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
                                .block_size = 16,
                                .key_size = {
@@ -150,14 +150,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .increment = 0
                                },
                                .aad_size = { 0 }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES GCM (AUTH) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_AES_GCM,
                                .block_size = 16,
                                .key_size = {
@@ -175,14 +175,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .max = 12,
                                        .increment = 4
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SNOW3G (UIA2) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
                                .block_size = 16,
                                .key_size = {
@@ -200,14 +200,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES GCM (CIPHER) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
+                       {.cipher = {
                                .algo = RTE_CRYPTO_CIPHER_AES_GCM,
                                .block_size = 16,
                                .key_size = {
@@ -220,15 +220,15 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* AES CBC */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
-                               RTE_CRYPTO_CIPHER_AES_CBC,
+                       {.cipher = {
+                               .algo = RTE_CRYPTO_CIPHER_AES_CBC,
                                .block_size = 16,
                                .key_size = {
                                        .min = 16,
@@ -240,14 +240,14 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SNOW3G (UEA2) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
+                       {.cipher = {
                                .algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
                                .block_size = 16,
                                .key_size = {
@@ -260,8 +260,8 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
index 74eee23..6f00b06 100644 (file)
@@ -41,9 +41,9 @@
 static const struct rte_cryptodev_capabilities snow3g_pmd_capabilities[] = {
        {       /* SNOW3G (UIA2) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
-                       .auth = {
+                       {.auth = {
                                .algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
                                .block_size = 16,
                                .key_size = {
@@ -61,14 +61,14 @@ static const struct rte_cryptodev_capabilities snow3g_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        {       /* SNOW3G (UEA2) */
                .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-               .sym = {
+               {.sym = {
                        .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
-                       .cipher = {
+                       {.cipher = {
                                .algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
                                .block_size = 16,
                                .key_size = {
@@ -81,8 +81,8 @@ static const struct rte_cryptodev_capabilities snow3g_pmd_capabilities[] = {
                                        .max = 16,
                                        .increment = 0
                                }
-                       }
-               }
+                       }, }
+               }, }
        },
        RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };