[PATCH mmotm] lib/bug.c: fix build when MODULES are not enabled

From: Randy Dunlap
Date: Fri Oct 20 2017 - 19:53:58 EST


From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Fix build when CONFIG_MODULES is not enabled.
Fixes multiple build errors.

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
lib/bug.c | 2 ++
1 file changed, 2 insertions(+)

--- mmotm-2017-1019-1700.orig/lib/bug.c
+++ mmotm-2017-1019-1700/lib/bug.c
@@ -206,6 +206,7 @@ static void clear_once_table(struct bug_

void generic_bug_clear_once(void)
{
+#ifdef CONFIG_MODULES
struct module *mod;

rcu_read_lock_sched();
@@ -213,6 +214,7 @@ void generic_bug_clear_once(void)
clear_once_table(mod->bug_table,
mod->bug_table + mod->num_bugs);
rcu_read_unlock_sched();
+#endif

clear_once_table(__start___bug_table, __stop___bug_table);
}