Skip to content

Commit

Permalink
s390/debug: remove module_exit function / move EXPORT_SYMBOLs
Browse files Browse the repository at this point in the history
debug.c is not a module, so remove the module_exit function, since it
will never be called.
Also move the EXPORT_SYMBOL statements to the functions they belong to.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jul 26, 2012
1 parent bdc0077 commit d527436
Showing 1 changed file with 23 additions and 47 deletions.
70 changes: 23 additions & 47 deletions arch/s390/kernel/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct debug_view debug_raw_view = {
NULL,
NULL
};
EXPORT_SYMBOL(debug_raw_view);

struct debug_view debug_hex_ascii_view = {
"hex_ascii",
Expand All @@ -119,6 +120,7 @@ struct debug_view debug_hex_ascii_view = {
NULL,
NULL
};
EXPORT_SYMBOL(debug_hex_ascii_view);

static struct debug_view debug_level_view = {
"level",
Expand Down Expand Up @@ -155,6 +157,7 @@ struct debug_view debug_sprintf_view = {
NULL,
NULL
};
EXPORT_SYMBOL(debug_sprintf_view);

/* used by dump analysis tools to determine version of debug feature */
static unsigned int __used debug_feature_version = __DEBUG_FEATURE_VERSION;
Expand Down Expand Up @@ -730,6 +733,7 @@ debug_info_t *debug_register(const char *name, int pages_per_area,
return debug_register_mode(name, pages_per_area, nr_areas, buf_size,
S_IRUSR | S_IWUSR, 0, 0);
}
EXPORT_SYMBOL(debug_register);

/*
* debug_unregister:
Expand All @@ -748,6 +752,7 @@ debug_unregister(debug_info_t * id)
out:
return;
}
EXPORT_SYMBOL(debug_unregister);

/*
* debug_set_size:
Expand Down Expand Up @@ -810,7 +815,7 @@ debug_set_level(debug_info_t* id, int new_level)
}
spin_unlock_irqrestore(&id->lock,flags);
}

EXPORT_SYMBOL(debug_set_level);

/*
* proceed_active_entry:
Expand Down Expand Up @@ -930,7 +935,7 @@ debug_stop_all(void)
if (debug_stoppable)
debug_active = 0;
}

EXPORT_SYMBOL(debug_stop_all);

void debug_set_critical(void)
{
Expand Down Expand Up @@ -963,6 +968,7 @@ debug_event_common(debug_info_t * id, int level, const void *buf, int len)

return active;
}
EXPORT_SYMBOL(debug_event_common);

/*
* debug_exception_common:
Expand Down Expand Up @@ -990,6 +996,7 @@ debug_entry_t

return active;
}
EXPORT_SYMBOL(debug_exception_common);

/*
* counts arguments in format string for sprintf view
Expand Down Expand Up @@ -1043,6 +1050,7 @@ debug_sprintf_event(debug_info_t* id, int level,char *string,...)

return active;
}
EXPORT_SYMBOL(debug_sprintf_event);

/*
* debug_sprintf_exception:
Expand Down Expand Up @@ -1081,25 +1089,7 @@ debug_sprintf_exception(debug_info_t* id, int level,char *string,...)

return active;
}

/*
* debug_init:
* - is called exactly once to initialize the debug feature
*/

static int
__init debug_init(void)
{
int rc = 0;

s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
mutex_lock(&debug_mutex);
debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
initialized = 1;
mutex_unlock(&debug_mutex);

return rc;
}
EXPORT_SYMBOL(debug_sprintf_exception);

/*
* debug_register_view:
Expand Down Expand Up @@ -1147,6 +1137,7 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
out:
return rc;
}
EXPORT_SYMBOL(debug_register_view);

/*
* debug_unregister_view:
Expand Down Expand Up @@ -1176,6 +1167,7 @@ debug_unregister_view(debug_info_t * id, struct debug_view *view)
out:
return rc;
}
EXPORT_SYMBOL(debug_unregister_view);

static inline char *
debug_get_user_string(const char __user *user_buf, size_t user_len)
Expand Down Expand Up @@ -1485,6 +1477,7 @@ debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
except_str, entry->id.fields.cpuid, (void *) caller);
return rc;
}
EXPORT_SYMBOL(debug_dflt_header_fn);

/*
* prints debug data sprintf-formated:
Expand Down Expand Up @@ -1533,33 +1526,16 @@ debug_sprintf_format_fn(debug_info_t * id, struct debug_view *view,
}

/*
* clean up module
* debug_init:
* - is called exactly once to initialize the debug feature
*/
static void __exit debug_exit(void)
static int __init debug_init(void)
{
debugfs_remove(debug_debugfs_root_entry);
unregister_sysctl_table(s390dbf_sysctl_header);
return;
s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
mutex_lock(&debug_mutex);
debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT, NULL);
initialized = 1;
mutex_unlock(&debug_mutex);
return 0;
}

/*
* module definitions
*/
postcore_initcall(debug_init);
module_exit(debug_exit);
MODULE_LICENSE("GPL");

EXPORT_SYMBOL(debug_register);
EXPORT_SYMBOL(debug_unregister);
EXPORT_SYMBOL(debug_set_level);
EXPORT_SYMBOL(debug_stop_all);
EXPORT_SYMBOL(debug_register_view);
EXPORT_SYMBOL(debug_unregister_view);
EXPORT_SYMBOL(debug_event_common);
EXPORT_SYMBOL(debug_exception_common);
EXPORT_SYMBOL(debug_hex_ascii_view);
EXPORT_SYMBOL(debug_raw_view);
EXPORT_SYMBOL(debug_dflt_header_fn);
EXPORT_SYMBOL(debug_sprintf_view);
EXPORT_SYMBOL(debug_sprintf_exception);
EXPORT_SYMBOL(debug_sprintf_event);

0 comments on commit d527436

Please sign in to comment.