'OTX_CPT_ENGS_BITMASK_LEN' is only used to allocate a bitmap. This macro only works because OTX_CPT_MAX_ENGINES is 64. BITS_TO_LONGS() should be used to compute the correct size. In order to simplify the code, remove OTX_CPT_ENGS_BITMASK_LEN and use DECLARE_BITMAP to declare the 'bits' bitmap. Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> --- drivers/crypto/marvell/octeontx/otx_cptpf_ucode.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.h b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.h index 8620ac87a447..e7e9d1a9a0db 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.h +++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.h @@ -39,8 +39,6 @@ /* Maximum number of supported engines/cores on OcteonTX 83XX platform */ #define OTX_CPT_MAX_ENGINES 64 -#define OTX_CPT_ENGS_BITMASK_LEN (OTX_CPT_MAX_ENGINES/(BITS_PER_BYTE * \ - sizeof(unsigned long))) /* Microcode types */ enum otx_cpt_ucode_type { @@ -54,7 +52,7 @@ enum otx_cpt_ucode_type { }; struct otx_cpt_bitmap { - unsigned long bits[OTX_CPT_ENGS_BITMASK_LEN]; + DECLARE_BITMAP(bits, OTX_CPT_MAX_ENGINES); int size; }; -- 2.34.1