summaryrefslogtreecommitdiff
path: root/kernel/module/internal.h
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-19 14:27:37 -0700
committerLuis Chamberlain <mcgrof@kernel.org>2023-03-24 11:05:15 -0700
commit1e684172358453df1cb783d7c101a09ff08ceee1 (patch)
treef938bd85a32c0b1f4543d768d4b06681b04bdda0 /kernel/module/internal.h
parentfeb5b784a26363b690f618213450faf244c1c58e (diff)
module: add a for_each_modinfo_entry()
Add a for_each_modinfo_entry() to make it easier to read and use. This produces no functional changes but makes this code easiert to read as we are used to with loops in the kernel and trims more lines of code. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/module/internal.h')
-rw-r--r--kernel/module/internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 1fa2328636ec..6ae29bb8836f 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -98,6 +98,9 @@ size_t module_flags_taint(unsigned long taints, char *buf);
char *module_next_tag_pair(char *string, unsigned long *secsize);
+#define for_each_modinfo_entry(entry, info, name) \
+ for (entry = get_modinfo(info, name); entry; entry = get_next_modinfo(info, name, entry))
+
static inline void module_assert_mutex_or_preempt(void)
{
#ifdef CONFIG_LOCKDEP