diff options
author | Lijian Zhang <Lijian.Zhang@arm.com> | 2019-09-27 16:25:35 +0800 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-11-28 09:46:03 +0000 |
commit | 49cf46e0d0847796aecf7b62db961da416a5c9d7 (patch) | |
tree | 433d0c38720e28634c8990e1bab0e06354056df7 /src/vnet/crypto/crypto.c | |
parent | d2bff078647cd6382e25fe737bd93e0d36234240 (diff) |
crypto: not use vec api with opt_data[VNET_CRYPTO_N_OP_IDS]
opt_data is defined as a array, while in some code, e.g., function
vnet_crypto_get_op_type, it's used as vec.
vec api is not applicable to static arraies.
src/vnet/crypto/crypto.h:234:70: error: address of array 'cm->opt_data' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
vnet_crypto_op_data_t *od = ({ do { if ((0 > 0) && ! ((id) < ((cm->opt_data) ? (((vec_header_t *) (cm->opt_data) - 1)->len) : 0)))
Type: fix
Change-Id: I0b6754406e4216ca975bc1da4b5d4ce293a9bb45
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
(cherry picked from commit b15d796dbf1da6a229df4e10a3a2bdd700f0354e)
Diffstat (limited to 'src/vnet/crypto/crypto.c')
-rw-r--r-- | src/vnet/crypto/crypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/crypto/crypto.c b/src/vnet/crypto/crypto.c index 4a72b7cd116..6cd12108f6c 100644 --- a/src/vnet/crypto/crypto.c +++ b/src/vnet/crypto/crypto.c @@ -118,7 +118,7 @@ vnet_crypto_set_handler (char *alg_name, char *engine) vnet_crypto_op_id_t id = ad->op_by_type[i]; if (id == 0) continue; - od = vec_elt_at_index (cm->opt_data, id); + od = cm->opt_data + id; if (ce->ops_handlers[id]) { od->active_engine_index = p[0]; |