[PATCH 02/12] crypto/cnxk: fix build with GCC 12
David Marchand
david.marchand at redhat.com
Wed May 18 12:16:47 CEST 2022
GCC 12 raises the following warning:
In file included from ../drivers/crypto/cnxk/cn10k_cryptodev_ops.c:17:
In function ‘fill_sg_comp_from_iov’,
inlined from ‘cpt_kasumi_enc_prep’ at
../drivers/crypto/cnxk/cnxk_se.h:1413:8,
inlined from ‘cpt_fc_enc_hmac_prep’ at
../drivers/crypto/cnxk/cnxk_se.h:1635:9,
inlined from ‘fill_digest_params’ at
../drivers/crypto/cnxk/cnxk_se.h:2524:8,
inlined from ‘cpt_sym_inst_fill’ at
../drivers/crypto/cnxk/cn10k_cryptodev_ops.c:92:9,
inlined from ‘cn10k_cpt_fill_inst.constprop.isra’ at
../drivers/crypto/cnxk/cn10k_cryptodev_ops.c:146:10:
../drivers/crypto/cnxk/cnxk_se.h:208:52: error: array subscript 0 is
outside array bounds of ‘struct roc_se_buf_ptr[0]’
[-Werror=array-bounds]
208 | e_vaddr = (uint64_t)bufs[j].vaddr;
| ~~~~~~~^~~~~~
../drivers/crypto/cnxk/cnxk_se.h:209:48: error: array subscript 0 is
outside array bounds of ‘struct roc_se_buf_ptr[0]’
[-Werror=array-bounds]
209 | e_len = (size > bufs[j].size) ? bufs[j].size : size;
| ~~~~~~~^~~~~
For now, waive this warning until we have a proper fix.
Cc: stable at dpdk.org
Signed-off-by: David Marchand <david.marchand at redhat.com>
---
drivers/crypto/cnxk/cnxk_se.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index ce7ca2eda9..c9d147601f 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -205,8 +205,16 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
size;
from_offset = 0;
} else {
+/* FIXME */
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
e_vaddr = (uint64_t)bufs[j].vaddr;
e_len = (size > bufs[j].size) ? bufs[j].size : size;
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic pop
+#endif
}
to->u.s.len[i % 4] = rte_cpu_to_be_16(e_len);
--
2.36.1
More information about the stable
mailing list