lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <eb4dc7930c66b659718555edcf7fc1bbea6f5298.1657455082.git.christophe.jaillet@wanadoo.fr>
Date:   Sun, 10 Jul 2022 14:12:50 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Boris Brezillon <bbrezillon@...nel.org>,
        Arnaud Ebalard <arno@...isbad.org>,
        Srujana Challa <schalla@...vell.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        linux-crypto@...r.kernel.org
Subject: [PATCH 1/3] crypto: marvell/octeontx: Simplify bitmap declaration

'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@...adoo.fr>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ