summaryrefslogtreecommitdiff
path: root/scripts/mod/modpost.h
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-05-23 19:46:25 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2022-05-27 10:15:40 +0300
commitc5c468dcc25efc0095361bb63b6255622e22f695 (patch)
treeefdd5e9901d8fe8901d4c293fc4a61d0fc02bae1 /scripts/mod/modpost.h
parent76954527fe05354add150737aa1b9a6baa4a6ee5 (diff)
downloadlinux-c5c468dcc25efc0095361bb63b6255622e22f695.tar.xz
modpost: reuse ARRAY_SIZE() macro for section_mismatch()
Move ARRAY_SIZE() from file2alias.c to modpost.h to reuse it in section_mismatch(). Also, move the variable 'check' inside the for-loop. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'scripts/mod/modpost.h')
-rw-r--r--scripts/mod/modpost.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index d9daeff07b83..044bdfb894b7 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -97,6 +97,9 @@ static inline void __endian(const void *src, void *dest, unsigned int size)
#endif
#define NOFAIL(ptr) do_nofail((ptr), #ptr)
+
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
void *do_nofail(void *ptr, const char *expr);
struct buffer {