提交 996302c5 编写于 作者: M Masahiro Yamada 提交者: Jessica Yu

module: replace VMLINUX_SYMBOL_STR() with __stringify() or string literal

With the special case handling for Blackfin and Metag was removed by
commit 94e58e0a ("export.h: remove code for prefixing symbols with
underscore"), VMLINUX_SYMBOL_STR() is now equivalent to __stringify().

Replace the remaining usages to prepare for the entire removal of
VMLINUX_SYMBOL_STR().
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NJessica Yu <jeyu@kernel.org>
上级 62267e0e
...@@ -266,7 +266,7 @@ extern int modules_disabled; /* for sysctl */ ...@@ -266,7 +266,7 @@ extern int modules_disabled; /* for sysctl */
/* Get/put a kernel symbol (calls must be symmetric) */ /* Get/put a kernel symbol (calls must be symmetric) */
void *__symbol_get(const char *symbol); void *__symbol_get(const char *symbol);
void *__symbol_get_gpl(const char *symbol); void *__symbol_get_gpl(const char *symbol);
#define symbol_get(x) ((typeof(&x))(__symbol_get(VMLINUX_SYMBOL_STR(x)))) #define symbol_get(x) ((typeof(&x))(__symbol_get(__stringify(x))))
/* modules using other modules: kdb wants to see this. */ /* modules using other modules: kdb wants to see this. */
struct module_use { struct module_use {
...@@ -575,7 +575,7 @@ extern void __noreturn __module_put_and_exit(struct module *mod, ...@@ -575,7 +575,7 @@ extern void __noreturn __module_put_and_exit(struct module *mod,
#ifdef CONFIG_MODULE_UNLOAD #ifdef CONFIG_MODULE_UNLOAD
int module_refcount(struct module *mod); int module_refcount(struct module *mod);
void __symbol_put(const char *symbol); void __symbol_put(const char *symbol);
#define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x)) #define symbol_put(x) __symbol_put(__stringify(x))
void symbol_put_addr(void *addr); void symbol_put_addr(void *addr);
/* Sometimes we know we already have a refcount, and it's easier not /* Sometimes we know we already have a refcount, and it's easier not
......
...@@ -1341,14 +1341,12 @@ static inline int check_modstruct_version(const struct load_info *info, ...@@ -1341,14 +1341,12 @@ static inline int check_modstruct_version(const struct load_info *info,
* locking is necessary -- use preempt_disable() to placate lockdep. * locking is necessary -- use preempt_disable() to placate lockdep.
*/ */
preempt_disable(); preempt_disable();
if (!find_symbol(VMLINUX_SYMBOL_STR(module_layout), NULL, if (!find_symbol("module_layout", NULL, &crc, true, false)) {
&crc, true, false)) {
preempt_enable(); preempt_enable();
BUG(); BUG();
} }
preempt_enable(); preempt_enable();
return check_version(info, VMLINUX_SYMBOL_STR(module_layout), return check_version(info, "module_layout", mod, crc);
mod, crc);
} }
/* First part is kernel version, which we ignore if module has crcs. */ /* First part is kernel version, which we ignore if module has crcs. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册