Commit 595dd3d8 authored by Randy Dunlap's avatar Randy Dunlap Committed by David Woodhouse

kmsg_dump: fix build for CONFIG_PRINTK=n

kmsg_dump() fails to build when CONFIG_PRINTK=n; provide stubs
for the kmsg_dump*() functions when CONFIG_PRINTK=n.

kernel/printk.c: In function 'kmsg_dump':
kernel/printk.c:1501: error: 'log_buf_len' undeclared (first use in this function)
kernel/printk.c:1502: error: 'logged_chars' undeclared (first use in this function)
kernel/printk.c:1506: error: 'log_buf' undeclared (first use in this function)
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Acked-by: default avatarSimon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 75352662
...@@ -35,10 +35,26 @@ struct kmsg_dumper { ...@@ -35,10 +35,26 @@ struct kmsg_dumper {
int registered; int registered;
}; };
#ifdef CONFIG_PRINTK
void kmsg_dump(enum kmsg_dump_reason reason); void kmsg_dump(enum kmsg_dump_reason reason);
int kmsg_dump_register(struct kmsg_dumper *dumper); int kmsg_dump_register(struct kmsg_dumper *dumper);
int kmsg_dump_unregister(struct kmsg_dumper *dumper); int kmsg_dump_unregister(struct kmsg_dumper *dumper);
#else
static inline void kmsg_dump(enum kmsg_dump_reason reason)
{
}
static inline int kmsg_dump_register(struct kmsg_dumper *dumper)
{
return -EINVAL;
}
static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper)
{
return -EINVAL;
}
#endif
#endif /* _LINUX_KMSG_DUMP_H */ #endif /* _LINUX_KMSG_DUMP_H */
...@@ -1405,7 +1405,6 @@ bool printk_timed_ratelimit(unsigned long *caller_jiffies, ...@@ -1405,7 +1405,6 @@ bool printk_timed_ratelimit(unsigned long *caller_jiffies,
return false; return false;
} }
EXPORT_SYMBOL(printk_timed_ratelimit); EXPORT_SYMBOL(printk_timed_ratelimit);
#endif
static DEFINE_SPINLOCK(dump_list_lock); static DEFINE_SPINLOCK(dump_list_lock);
static LIST_HEAD(dump_list); static LIST_HEAD(dump_list);
...@@ -1524,3 +1523,4 @@ void kmsg_dump(enum kmsg_dump_reason reason) ...@@ -1524,3 +1523,4 @@ void kmsg_dump(enum kmsg_dump_reason reason)
dumper->dump(dumper, reason, s1, l1, s2, l2); dumper->dump(dumper, reason, s1, l1, s2, l2);
spin_unlock_irqrestore(&dump_list_lock, flags); spin_unlock_irqrestore(&dump_list_lock, flags);
} }
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment