Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <wangkailong@jari.cn>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

KaiLong Wang and committed by
Masahiro Yamada
30daacc5 9f8fe647

+2 -2
+2 -2
scripts/mod/sumversion.c
··· 153 153 154 154 static inline void md4_transform_helper(struct md4_ctx *ctx) 155 155 { 156 - le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(uint32_t)); 156 + le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block)); 157 157 md4_transform(ctx->hash, ctx->block); 158 158 } 159 159 ··· 216 216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - 217 217 sizeof(uint64_t)) / sizeof(uint32_t)); 218 218 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)); 220 220 221 221 snprintf(out, len, "%08X%08X%08X%08X", 222 222 mctx->hash[0], mctx->hash[1], mctx->hash[2], mctx->hash[3]);