Skip to content

Commit 30daacc

Browse files
KaiLong Wangmasahir0y
authored andcommitted
modpost: fix array_size.cocci warning
Fix following coccicheck warning: scripts/mod/sumversion.c:219:48-49: WARNING: Use ARRAY_SIZE scripts/mod/sumversion.c:156:48-49: WARNING: Use ARRAY_SIZE Signed-off-by: KaiLong Wang <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 9f8fe64 commit 30daacc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/mod/sumversion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static void md4_transform(uint32_t *hash, uint32_t const *in)
153153

154154
static inline void md4_transform_helper(struct md4_ctx *ctx)
155155
{
156-
le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(uint32_t));
156+
le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block));
157157
md4_transform(ctx->hash, ctx->block);
158158
}
159159

@@ -216,7 +216,7 @@ static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len)
216216
le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
217217
sizeof(uint64_t)) / sizeof(uint32_t));
218218
md4_transform(mctx->hash, mctx->block);
219-
cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t));
219+
cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash));
220220

221221
snprintf(out, len, "%08X%08X%08X%08X",
222222
mctx->hash[0], mctx->hash[1], mctx->hash[2], mctx->hash[3]);

0 commit comments

Comments
 (0)