* [PATCH] crypto: jitter - replace ARRAY_SIZE definition with header include
[not found] <20250713131608.38859-1-rubenru09.ref@aol.com>
@ 2025-07-13 13:13 ` Ruben Wauters
2025-07-18 11:15 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Ruben Wauters @ 2025-07-13 13:13 UTC (permalink / raw)
To: Herbet Xu, David S. Miller
Cc: Ruben Wauters, linux-crypto, linux-kernel, kernel-janitors
The ARRAY_SIZE macro is already defined in linux/array_size.h
This patch replaces the ARRAY_SIZE definition in jitterentropy.c with
an include, to make the code cleaner, and help reduce the number of
duplicate ARRAY_SIZE definitions in the codebase.
Signed-off-by: Ruben Wauters <rubenru09@aol.com>
---
crypto/jitterentropy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index 3b390bd6c119..2920ecbf3f13 100644
--- a/crypto/jitterentropy.c
+++ b/crypto/jitterentropy.c
@@ -147,6 +147,7 @@ struct rand_data {
#include <linux/fips.h>
#include <linux/minmax.h>
+#include <linux/array_size.h>
#include "jitterentropy.h"
/***************************************************************************
@@ -178,7 +179,6 @@ static const unsigned int jent_apt_cutoff_lookup[15] = {
static const unsigned int jent_apt_cutoff_permanent_lookup[15] = {
355, 447, 479, 494, 502, 507, 510, 512,
512, 512, 512, 512, 512, 512, 512 };
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
static void jent_apt_init(struct rand_data *ec, unsigned int osr)
{
--
2.49.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: jitter - replace ARRAY_SIZE definition with header include
2025-07-13 13:13 ` [PATCH] crypto: jitter - replace ARRAY_SIZE definition with header include Ruben Wauters
@ 2025-07-18 11:15 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2025-07-18 11:15 UTC (permalink / raw)
To: Ruben Wauters
Cc: davem, rubenru09, linux-crypto, linux-kernel, kernel-janitors
Ruben Wauters <rubenru09@aol.com> wrote:
> The ARRAY_SIZE macro is already defined in linux/array_size.h
>
> This patch replaces the ARRAY_SIZE definition in jitterentropy.c with
> an include, to make the code cleaner, and help reduce the number of
> duplicate ARRAY_SIZE definitions in the codebase.
>
> Signed-off-by: Ruben Wauters <rubenru09@aol.com>
> ---
> crypto/jitterentropy.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-18 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250713131608.38859-1-rubenru09.ref@aol.com>
2025-07-13 13:13 ` [PATCH] crypto: jitter - replace ARRAY_SIZE definition with header include Ruben Wauters
2025-07-18 11:15 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).