diff mbox series

[1/3] crypto: marvell/octeontx: Simplify bitmap declaration

Message ID eb4dc7930c66b659718555edcf7fc1bbea6f5298.1657455082.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show
Series [1/3] crypto: marvell/octeontx: Simplify bitmap declaration | expand

Commit Message

Christophe JAILLET July 10, 2022, 12:12 p.m. UTC
'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@wanadoo.fr>
---
 drivers/crypto/marvell/octeontx/otx_cptpf_ucode.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

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;
 };