crypto/cryptosoft: replace macro howmany with common macro div_round_up

Replace the non-standard howmany macro with the common div_round_up macro
for consistency and better code maintainability.

Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian
2026-01-19 10:26:17 +08:00
committed by GUIDINGLI
parent 38ba0abc49
commit 043ef0dd3a
+2 -5
View File
@@ -31,6 +31,7 @@
#include <endian.h>
#include <strings.h>
#include <nuttx/kmalloc.h>
#include <nuttx/lib/math32.h>
#include <crypto/bn.h>
#include <crypto/cryptodev.h>
#include <crypto/cryptosoft.h>
@@ -42,10 +43,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef howmany
# define howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
/****************************************************************************
* Private Data
****************************************************************************/
@@ -275,7 +272,7 @@ int swcr_hash(FAR struct cryptop *crp,
int swcr_authenc(FAR struct cryptop *crp)
{
uint32_t blkbuf[howmany(EALG_MAX_BLOCK_LEN, sizeof(uint32_t))];
uint32_t blkbuf[div_round_up(EALG_MAX_BLOCK_LEN, sizeof(uint32_t))];
FAR u_char *blk = (u_char *)blkbuf;
u_char aalg[AALG_MAX_RESULT_LEN];
u_char iv[EALG_MAX_BLOCK_LEN];