Blob Blame History Raw
From 3a9f94e6bb330b4cf70bb52f3c6eb13f4736a80f Mon Sep 17 00:00:00 2001
From: Miroslav Benes <mbenes@suse.cz>
Date: Mon, 5 Sep 2016 17:26:07 +0200
Subject: [PATCH 2/3] module: move add_taint_module() to a header file
Patch-mainline: not yet, kgraft
References: fate#313296

Move add_taint_module() to include/linux/module.h header file and thus
make it generally available.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
 include/linux/module.h | 7 +++++++
 kernel/module.c        | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 33eab56c996f..3fb18d18fcdd 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -533,6 +533,13 @@ static inline bool within_module(unsigned long addr, const struct module *mod)
 	return within_module_init(addr, mod) || within_module_core(addr, mod);
 }
 
+static inline void add_taint_module(struct module *mod, unsigned flag,
+				    enum lockdep_ok lockdep_ok)
+{
+	add_taint(flag, lockdep_ok);
+	mod->taints |= (1U << flag);
+}
+
 /* Search for module by name: must hold module_mutex. */
 struct module *find_module(const char *name);
 
diff --git a/kernel/module.c b/kernel/module.c
index b966b2526372..eb054523c12b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -366,13 +366,6 @@ static inline int strong_try_module_get(struct module *mod)
 		return -ENOENT;
 }
 
-static inline void add_taint_module(struct module *mod, unsigned flag,
-				    enum lockdep_ok lockdep_ok)
-{
-	add_taint(flag, lockdep_ok);
-	mod->taints |= (1U << flag);
-}
-
 /*
  * A thread that wants to hold a reference to a module only while it
  * is running can call this to safely exit.  nfsd and lockd use this.
-- 
2.12.0