aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2017-05-08 19:00:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-08 20:15:16 -0400
commit4d2b5bcab53f1c76a86279339561c9a36109a93b (patch)
tree7e2918540b0feec1f0a8258b8a3f38c413f9850e
parent4e5ce33ceb3250f564656588da4d47f3eca7d2af (diff)
drivers/staging/ccree/ssi_hash.c: fix build with gcc-4.4.4
drivers/staging/ccree/ssi_hash.c:1990: error: unknown field 'template_ahash' specified in initializer drivers/staging/ccree/ssi_hash.c:1991: error: unknown field 'init' specified in initializer drivers/staging/ccree/ssi_hash.c:1991: warning: missing braces around initializer drivers/staging/ccree/ssi_hash.c:1991: warning: (near initialization for 'driver_hash[0].<anonymous>.template_ahash') drivers/staging/ccree/ssi_hash.c:1992: error: unknown field 'update' specified in initializer drivers/staging/ccree/ssi_hash.c:1992: warning: excess elements in union initializer drivers/staging/ccree/ssi_hash.c:1992: warning: (near initialization for 'driver_hash[0].<anonymous>') drivers/staging/ccree/ssi_hash.c:1993: error: unknown field 'final' specified in initializer drivers/staging/ccree/ssi_hash.c:1993: warning: excess elements in union initializer drivers/staging/ccree/ssi_hash.c:1993: warning: (near initialization for 'driver_hash[0].<anonymous>') ... gcc-4.4.4 has issues with anon union initializers. Work around this. Cc: Gilad Ben-Yossef <gilad@benyossef.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/staging/ccree/ssi_hash.c236
1 files changed, 126 insertions, 110 deletions
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index 8ff5d4ec9e5c..f99d4219b01e 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -1987,22 +1987,24 @@ static struct ssi_hash_template driver_hash[] = {
1987 .hmac_driver_name = "hmac-sha1-dx", 1987 .hmac_driver_name = "hmac-sha1-dx",
1988 .blocksize = SHA1_BLOCK_SIZE, 1988 .blocksize = SHA1_BLOCK_SIZE,
1989 .synchronize = false, 1989 .synchronize = false,
1990 .template_ahash = { 1990 {
1991 .init = ssi_ahash_init, 1991 .template_ahash = {
1992 .update = ssi_ahash_update, 1992 .init = ssi_ahash_init,
1993 .final = ssi_ahash_final, 1993 .update = ssi_ahash_update,
1994 .finup = ssi_ahash_finup, 1994 .final = ssi_ahash_final,
1995 .digest = ssi_ahash_digest, 1995 .finup = ssi_ahash_finup,
1996 .digest = ssi_ahash_digest,
1996#ifdef EXPORT_FIXED 1997#ifdef EXPORT_FIXED
1997 .export = ssi_ahash_export, 1998 .export = ssi_ahash_export,
1998 .import = ssi_ahash_import, 1999 .import = ssi_ahash_import,
1999#endif 2000#endif
2000 .setkey = ssi_ahash_setkey, 2001 .setkey = ssi_ahash_setkey,
2001 .halg = { 2002 .halg = {
2002 .digestsize = SHA1_DIGEST_SIZE, 2003 .digestsize = SHA1_DIGEST_SIZE,
2003 .statesize = sizeof(struct sha1_state), 2004 .statesize = sizeof(struct sha1_state),
2005 },
2004 }, 2006 },
2005 }, 2007 },
2006 .hash_mode = DRV_HASH_SHA1, 2008 .hash_mode = DRV_HASH_SHA1,
2007 .hw_mode = DRV_HASH_HW_SHA1, 2009 .hw_mode = DRV_HASH_HW_SHA1,
2008 .inter_digestsize = SHA1_DIGEST_SIZE, 2010 .inter_digestsize = SHA1_DIGEST_SIZE,
@@ -2014,22 +2016,24 @@ static struct ssi_hash_template driver_hash[] = {
2014 .hmac_driver_name = "hmac-sha256-dx", 2016 .hmac_driver_name = "hmac-sha256-dx",
2015 .blocksize = SHA256_BLOCK_SIZE, 2017 .blocksize = SHA256_BLOCK_SIZE,
2016 .synchronize = false, 2018 .synchronize = false,
2017 .template_ahash = { 2019 {
2018 .init = ssi_ahash_init, 2020 .template_ahash = {
2019 .update = ssi_ahash_update, 2021 .init = ssi_ahash_init,
2020 .final = ssi_ahash_final, 2022 .update = ssi_ahash_update,
2021 .finup = ssi_ahash_finup, 2023 .final = ssi_ahash_final,
2022 .digest = ssi_ahash_digest, 2024 .finup = ssi_ahash_finup,
2025 .digest = ssi_ahash_digest,
2023#ifdef EXPORT_FIXED 2026#ifdef EXPORT_FIXED
2024 .export = ssi_ahash_export, 2027 .export = ssi_ahash_export,
2025 .import = ssi_ahash_import, 2028 .import = ssi_ahash_import,
2026#endif 2029#endif
2027 .setkey = ssi_ahash_setkey, 2030 .setkey = ssi_ahash_setkey,
2028 .halg = { 2031 .halg = {
2029 .digestsize = SHA256_DIGEST_SIZE, 2032 .digestsize = SHA256_DIGEST_SIZE,
2030 .statesize = sizeof(struct sha256_state), 2033 .statesize = sizeof(struct sha256_state),
2034 },
2031 }, 2035 },
2032 }, 2036 },
2033 .hash_mode = DRV_HASH_SHA256, 2037 .hash_mode = DRV_HASH_SHA256,
2034 .hw_mode = DRV_HASH_HW_SHA256, 2038 .hw_mode = DRV_HASH_HW_SHA256,
2035 .inter_digestsize = SHA256_DIGEST_SIZE, 2039 .inter_digestsize = SHA256_DIGEST_SIZE,
@@ -2041,22 +2045,24 @@ static struct ssi_hash_template driver_hash[] = {
2041 .hmac_driver_name = "hmac-sha224-dx", 2045 .hmac_driver_name = "hmac-sha224-dx",
2042 .blocksize = SHA224_BLOCK_SIZE, 2046 .blocksize = SHA224_BLOCK_SIZE,
2043 .synchronize = false, 2047 .synchronize = false,
2044 .template_ahash = { 2048 {
2045 .init = ssi_ahash_init, 2049 .template_ahash = {
2046 .update = ssi_ahash_update, 2050 .init = ssi_ahash_init,
2047 .final = ssi_ahash_final, 2051 .update = ssi_ahash_update,
2048 .finup = ssi_ahash_finup, 2052 .final = ssi_ahash_final,
2049 .digest = ssi_ahash_digest, 2053 .finup = ssi_ahash_finup,
2054 .digest = ssi_ahash_digest,
2050#ifdef EXPORT_FIXED 2055#ifdef EXPORT_FIXED
2051 .export = ssi_ahash_export, 2056 .export = ssi_ahash_export,
2052 .import = ssi_ahash_import, 2057 .import = ssi_ahash_import,
2053#endif 2058#endif
2054 .setkey = ssi_ahash_setkey, 2059 .setkey = ssi_ahash_setkey,
2055 .halg = { 2060 .halg = {
2056 .digestsize = SHA224_DIGEST_SIZE, 2061 .digestsize = SHA224_DIGEST_SIZE,
2057 .statesize = sizeof(struct sha256_state), 2062 .statesize = sizeof(struct sha256_state),
2063 },
2058 }, 2064 },
2059 }, 2065 },
2060 .hash_mode = DRV_HASH_SHA224, 2066 .hash_mode = DRV_HASH_SHA224,
2061 .hw_mode = DRV_HASH_HW_SHA256, 2067 .hw_mode = DRV_HASH_HW_SHA256,
2062 .inter_digestsize = SHA256_DIGEST_SIZE, 2068 .inter_digestsize = SHA256_DIGEST_SIZE,
@@ -2069,22 +2075,24 @@ static struct ssi_hash_template driver_hash[] = {
2069 .hmac_driver_name = "hmac-sha384-dx", 2075 .hmac_driver_name = "hmac-sha384-dx",
2070 .blocksize = SHA384_BLOCK_SIZE, 2076 .blocksize = SHA384_BLOCK_SIZE,
2071 .synchronize = false, 2077 .synchronize = false,
2072 .template_ahash = { 2078 {
2073 .init = ssi_ahash_init, 2079 .template_ahash = {
2074 .update = ssi_ahash_update, 2080 .init = ssi_ahash_init,
2075 .final = ssi_ahash_final, 2081 .update = ssi_ahash_update,
2076 .finup = ssi_ahash_finup, 2082 .final = ssi_ahash_final,
2077 .digest = ssi_ahash_digest, 2083 .finup = ssi_ahash_finup,
2084 .digest = ssi_ahash_digest,
2078#ifdef EXPORT_FIXED 2085#ifdef EXPORT_FIXED
2079 .export = ssi_ahash_export, 2086 .export = ssi_ahash_export,
2080 .import = ssi_ahash_import, 2087 .import = ssi_ahash_import,
2081#endif 2088#endif
2082 .setkey = ssi_ahash_setkey, 2089 .setkey = ssi_ahash_setkey,
2083 .halg = { 2090 .halg = {
2084 .digestsize = SHA384_DIGEST_SIZE, 2091 .digestsize = SHA384_DIGEST_SIZE,
2085 .statesize = sizeof(struct sha512_state), 2092 .statesize = sizeof(struct sha512_state),
2093 },
2086 }, 2094 },
2087 }, 2095 },
2088 .hash_mode = DRV_HASH_SHA384, 2096 .hash_mode = DRV_HASH_SHA384,
2089 .hw_mode = DRV_HASH_HW_SHA512, 2097 .hw_mode = DRV_HASH_HW_SHA512,
2090 .inter_digestsize = SHA512_DIGEST_SIZE, 2098 .inter_digestsize = SHA512_DIGEST_SIZE,
@@ -2096,22 +2104,24 @@ static struct ssi_hash_template driver_hash[] = {
2096 .hmac_driver_name = "hmac-sha512-dx", 2104 .hmac_driver_name = "hmac-sha512-dx",
2097 .blocksize = SHA512_BLOCK_SIZE, 2105 .blocksize = SHA512_BLOCK_SIZE,
2098 .synchronize = false, 2106 .synchronize = false,
2099 .template_ahash = { 2107 {
2100 .init = ssi_ahash_init, 2108 .template_ahash = {
2101 .update = ssi_ahash_update, 2109 .init = ssi_ahash_init,
2102 .final = ssi_ahash_final, 2110 .update = ssi_ahash_update,
2103 .finup = ssi_ahash_finup, 2111 .final = ssi_ahash_final,
2104 .digest = ssi_ahash_digest, 2112 .finup = ssi_ahash_finup,
2113 .digest = ssi_ahash_digest,
2105#ifdef EXPORT_FIXED 2114#ifdef EXPORT_FIXED
2106 .export = ssi_ahash_export, 2115 .export = ssi_ahash_export,
2107 .import = ssi_ahash_import, 2116 .import = ssi_ahash_import,
2108#endif 2117#endif
2109 .setkey = ssi_ahash_setkey, 2118 .setkey = ssi_ahash_setkey,
2110 .halg = { 2119 .halg = {
2111 .digestsize = SHA512_DIGEST_SIZE, 2120 .digestsize = SHA512_DIGEST_SIZE,
2112 .statesize = sizeof(struct sha512_state), 2121 .statesize = sizeof(struct sha512_state),
2122 },
2113 }, 2123 },
2114 }, 2124 },
2115 .hash_mode = DRV_HASH_SHA512, 2125 .hash_mode = DRV_HASH_SHA512,
2116 .hw_mode = DRV_HASH_HW_SHA512, 2126 .hw_mode = DRV_HASH_HW_SHA512,
2117 .inter_digestsize = SHA512_DIGEST_SIZE, 2127 .inter_digestsize = SHA512_DIGEST_SIZE,
@@ -2124,22 +2134,24 @@ static struct ssi_hash_template driver_hash[] = {
2124 .hmac_driver_name = "hmac-md5-dx", 2134 .hmac_driver_name = "hmac-md5-dx",
2125 .blocksize = MD5_HMAC_BLOCK_SIZE, 2135 .blocksize = MD5_HMAC_BLOCK_SIZE,
2126 .synchronize = false, 2136 .synchronize = false,
2127 .template_ahash = { 2137 {
2128 .init = ssi_ahash_init, 2138 .template_ahash = {
2129 .update = ssi_ahash_update, 2139 .init = ssi_ahash_init,
2130 .final = ssi_ahash_final, 2140 .update = ssi_ahash_update,
2131 .finup = ssi_ahash_finup, 2141 .final = ssi_ahash_final,
2132 .digest = ssi_ahash_digest, 2142 .finup = ssi_ahash_finup,
2143 .digest = ssi_ahash_digest,
2133#ifdef EXPORT_FIXED 2144#ifdef EXPORT_FIXED
2134 .export = ssi_ahash_export, 2145 .export = ssi_ahash_export,
2135 .import = ssi_ahash_import, 2146 .import = ssi_ahash_import,
2136#endif 2147#endif
2137 .setkey = ssi_ahash_setkey, 2148 .setkey = ssi_ahash_setkey,
2138 .halg = { 2149 .halg = {
2139 .digestsize = MD5_DIGEST_SIZE, 2150 .digestsize = MD5_DIGEST_SIZE,
2140 .statesize = sizeof(struct md5_state), 2151 .statesize = sizeof(struct md5_state),
2152 },
2141 }, 2153 },
2142 }, 2154 },
2143 .hash_mode = DRV_HASH_MD5, 2155 .hash_mode = DRV_HASH_MD5,
2144 .hw_mode = DRV_HASH_HW_MD5, 2156 .hw_mode = DRV_HASH_HW_MD5,
2145 .inter_digestsize = MD5_DIGEST_SIZE, 2157 .inter_digestsize = MD5_DIGEST_SIZE,
@@ -2149,52 +2161,56 @@ static struct ssi_hash_template driver_hash[] = {
2149 .driver_name = "xcbc-aes-dx", 2161 .driver_name = "xcbc-aes-dx",
2150 .blocksize = AES_BLOCK_SIZE, 2162 .blocksize = AES_BLOCK_SIZE,
2151 .synchronize = false, 2163 .synchronize = false,
2152 .template_ahash = { 2164 {
2153 .init = ssi_ahash_init, 2165 .template_ahash = {
2154 .update = ssi_mac_update, 2166 .init = ssi_ahash_init,
2155 .final = ssi_mac_final, 2167 .update = ssi_mac_update,
2156 .finup = ssi_mac_finup, 2168 .final = ssi_mac_final,
2157 .digest = ssi_mac_digest, 2169 .finup = ssi_mac_finup,
2158 .setkey = ssi_xcbc_setkey, 2170 .digest = ssi_mac_digest,
2171 .setkey = ssi_xcbc_setkey,
2159#ifdef EXPORT_FIXED 2172#ifdef EXPORT_FIXED
2160 .export = ssi_ahash_export, 2173 .export = ssi_ahash_export,
2161 .import = ssi_ahash_import, 2174 .import = ssi_ahash_import,
2162#endif 2175#endif
2163 .halg = { 2176 .halg = {
2164 .digestsize = AES_BLOCK_SIZE, 2177 .digestsize = AES_BLOCK_SIZE,
2165 .statesize = sizeof(struct aeshash_state), 2178 .statesize = sizeof(struct aeshash_state),
2179 },
2166 }, 2180 },
2167 },
2168 .hash_mode = DRV_HASH_NULL,
2169 .hw_mode = DRV_CIPHER_XCBC_MAC,
2170 .inter_digestsize = AES_BLOCK_SIZE,
2171 }, 2181 },
2182 .hash_mode = DRV_HASH_NULL,
2183 .hw_mode = DRV_CIPHER_XCBC_MAC,
2184 .inter_digestsize = AES_BLOCK_SIZE,
2185 },
2172#if SSI_CC_HAS_CMAC 2186#if SSI_CC_HAS_CMAC
2173 { 2187 {
2174 .name = "cmac(aes)", 2188 .name = "cmac(aes)",
2175 .driver_name = "cmac-aes-dx", 2189 .driver_name = "cmac-aes-dx",
2176 .blocksize = AES_BLOCK_SIZE, 2190 .blocksize = AES_BLOCK_SIZE,
2177 .synchronize = false, 2191 .synchronize = false,
2178 .template_ahash = { 2192 {
2179 .init = ssi_ahash_init, 2193 .template_ahash = {
2180 .update = ssi_mac_update, 2194 .init = ssi_ahash_init,
2181 .final = ssi_mac_final, 2195 .update = ssi_mac_update,
2182 .finup = ssi_mac_finup, 2196 .final = ssi_mac_final,
2183 .digest = ssi_mac_digest, 2197 .finup = ssi_mac_finup,
2184 .setkey = ssi_cmac_setkey, 2198 .digest = ssi_mac_digest,
2199 .setkey = ssi_cmac_setkey,
2185#ifdef EXPORT_FIXED 2200#ifdef EXPORT_FIXED
2186 .export = ssi_ahash_export, 2201 .export = ssi_ahash_export,
2187 .import = ssi_ahash_import, 2202 .import = ssi_ahash_import,
2188#endif 2203#endif
2189 .halg = { 2204 .halg = {
2190 .digestsize = AES_BLOCK_SIZE, 2205 .digestsize = AES_BLOCK_SIZE,
2191 .statesize = sizeof(struct aeshash_state), 2206 .statesize = sizeof(struct aeshash_state),
2207 },
2192 }, 2208 },
2193 },
2194 .hash_mode = DRV_HASH_NULL,
2195 .hw_mode = DRV_CIPHER_CMAC,
2196 .inter_digestsize = AES_BLOCK_SIZE,
2197 }, 2209 },
2210 .hash_mode = DRV_HASH_NULL,
2211 .hw_mode = DRV_CIPHER_CMAC,
2212 .inter_digestsize = AES_BLOCK_SIZE,
2213 },
2198#endif 2214#endif
2199 2215
2200}; 2216};