From 043ef0dd3aad8ae153a36302a4108f0217d2019d Mon Sep 17 00:00:00 2001 From: makejian Date: Mon, 19 Jan 2026 10:26:17 +0800 Subject: [PATCH] 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 --- crypto/cryptosoft.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crypto/cryptosoft.c b/crypto/cryptosoft.c index 6c149cf1b1d..255b0b405ab 100644 --- a/crypto/cryptosoft.c +++ b/crypto/cryptosoft.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -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];