Skip to content

Commit 996302c

Browse files
masahir0yJessica Yu
authored andcommitted
module: replace VMLINUX_SYMBOL_STR() with __stringify() or string literal
With the special case handling for Blackfin and Metag was removed by commit 94e58e0 ("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: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
1 parent 62267e0 commit 996302c

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎include/linux/module.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ extern int modules_disabled; /* for sysctl */
266266
/* Get/put a kernel symbol (calls must be symmetric) */
267267
void *__symbol_get(const char *symbol);
268268
void *__symbol_get_gpl(const char *symbol);
269-
#define symbol_get(x) ((typeof(&x))(__symbol_get(VMLINUX_SYMBOL_STR(x))))
269+
#define symbol_get(x) ((typeof(&x))(__symbol_get(__stringify(x))))
270270

271271
/* modules using other modules: kdb wants to see this. */
272272
struct module_use {
@@ -575,7 +575,7 @@ extern void __noreturn __module_put_and_exit(struct module *mod,
575575
#ifdef CONFIG_MODULE_UNLOAD
576576
int module_refcount(struct module *mod);
577577
void __symbol_put(const char *symbol);
578-
#define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x))
578+
#define symbol_put(x) __symbol_put(__stringify(x))
579579
void symbol_put_addr(void *addr);
580580

581581
/* Sometimes we know we already have a refcount, and it's easier not

‎kernel/module.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,14 +1341,12 @@ static inline int check_modstruct_version(const struct load_info *info,
13411341
* locking is necessary -- use preempt_disable() to placate lockdep.
13421342
*/
13431343
preempt_disable();
1344-
if (!find_symbol(VMLINUX_SYMBOL_STR(module_layout), NULL,
1345-
&crc, true, false)) {
1344+
if (!find_symbol("module_layout", NULL, &crc, true, false)) {
13461345
preempt_enable();
13471346
BUG();
13481347
}
13491348
preempt_enable();
1350-
return check_version(info, VMLINUX_SYMBOL_STR(module_layout),
1351-
mod, crc);
1349+
return check_version(info, "module_layout", mod, crc);
13521350
}
13531351

13541352
/* First part is kernel version, which we ignore if module has crcs. */

0 commit comments

Comments
 (0)