Skip to content

Commit 4fec76b

Browse files
red031000herbertx
authored andcommitted
crypto: jitter - replace ARRAY_SIZE definition with header include
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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 5eb3243 commit 4fec76b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/jitterentropy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ struct rand_data {
145145
*/
146146
#define JENT_ENTROPY_SAFETY_FACTOR 64
147147

148+
#include <linux/array_size.h>
148149
#include <linux/fips.h>
149150
#include <linux/minmax.h>
150151
#include "jitterentropy.h"
@@ -178,7 +179,6 @@ static const unsigned int jent_apt_cutoff_lookup[15] = {
178179
static const unsigned int jent_apt_cutoff_permanent_lookup[15] = {
179180
355, 447, 479, 494, 502, 507, 510, 512,
180181
512, 512, 512, 512, 512, 512, 512 };
181-
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
182182

183183
static void jent_apt_init(struct rand_data *ec, unsigned int osr)
184184
{

0 commit comments

Comments
 (0)