Commit a4507fed authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Linus Torvalds

dynamic_debug: add static inline stub for ddebug_add_module

For symmetry with ddebug_remove_module, and to avoid a bit of ifdeffery
in module.c, move the declaration of ddebug_add_module inside #if
defined(CONFIG_DYNAMIC_DEBUG) and add a corresponding no-op stub in the
#else branch.

Link: http://lkml.kernel.org/r/20190212214150.4807-10-linux@rasmusvillemoes.dkSigned-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: default avatarJason Baron <jbaron@akamai.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 513770f5
...@@ -47,10 +47,10 @@ struct _ddebug { ...@@ -47,10 +47,10 @@ struct _ddebug {
} __attribute__((aligned(8))); } __attribute__((aligned(8)));
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
const char *modname);
#if defined(CONFIG_DYNAMIC_DEBUG) #if defined(CONFIG_DYNAMIC_DEBUG)
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
const char *modname);
extern int ddebug_remove_module(const char *mod_name); extern int ddebug_remove_module(const char *mod_name);
extern __printf(2, 3) extern __printf(2, 3)
void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
...@@ -152,6 +152,12 @@ do { \ ...@@ -152,6 +152,12 @@ do { \
#include <linux/string.h> #include <linux/string.h>
#include <linux/errno.h> #include <linux/errno.h>
static inline int ddebug_add_module(struct _ddebug *tab, unsigned int n,
const char *modname)
{
return 0;
}
static inline int ddebug_remove_module(const char *mod) static inline int ddebug_remove_module(const char *mod)
{ {
return 0; return 0;
......
...@@ -2719,9 +2719,7 @@ static void dynamic_debug_setup(struct module *mod, struct _ddebug *debug, unsig ...@@ -2719,9 +2719,7 @@ static void dynamic_debug_setup(struct module *mod, struct _ddebug *debug, unsig
{ {
if (!debug) if (!debug)
return; return;
#ifdef CONFIG_DYNAMIC_DEBUG
ddebug_add_module(debug, num, mod->name); ddebug_add_module(debug, num, mod->name);
#endif
} }
static void dynamic_debug_remove(struct module *mod, struct _ddebug *debug) static void dynamic_debug_remove(struct module *mod, struct _ddebug *debug)
......
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