diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2010-06-05 13:17:35 -0400 |
|---|---|---|
| committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-06-04 21:47:36 -0400 |
| commit | c8e21ced08b39ef8dfe7236fb2a923a95f645262 (patch) | |
| tree | da34400daf3049814b459b9c8ba507d90abfe2bc | |
| parent | 2c02dfe7fe3fba97a5665d329d039d2415ea5607 (diff) | |
module: fix kdb's illicit use of struct module_use.
Linus changed the structure, and luckily this didn't compile any more.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Martin Hicks <mort@sgi.com>
| -rw-r--r-- | include/linux/module.h | 7 | ||||
| -rw-r--r-- | kernel/debug/kdb/kdb_main.c | 12 | ||||
| -rw-r--r-- | kernel/module.c | 11 |
3 files changed, 11 insertions, 19 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 680db9e2ac36..5d8fca5dcff5 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -181,6 +181,13 @@ void *__symbol_get(const char *symbol); | |||
| 181 | void *__symbol_get_gpl(const char *symbol); | 181 | void *__symbol_get_gpl(const char *symbol); |
| 182 | #define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) | 182 | #define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) |
| 183 | 183 | ||
| 184 | /* modules using other modules: kdb wants to see this. */ | ||
| 185 | struct module_use { | ||
| 186 | struct list_head source_list; | ||
| 187 | struct list_head target_list; | ||
| 188 | struct module *source, *target; | ||
| 189 | }; | ||
| 190 | |||
| 184 | #ifndef __GENKSYMS__ | 191 | #ifndef __GENKSYMS__ |
| 185 | #ifdef CONFIG_MODVERSIONS | 192 | #ifdef CONFIG_MODVERSIONS |
| 186 | /* Mark the CRC weak since genksyms apparently decides not to | 193 | /* Mark the CRC weak since genksyms apparently decides not to |
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index b724c791b6d4..184cd8209c36 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c | |||
| @@ -1857,12 +1857,6 @@ static int kdb_ef(int argc, const char **argv) | |||
| 1857 | } | 1857 | } |
| 1858 | 1858 | ||
| 1859 | #if defined(CONFIG_MODULES) | 1859 | #if defined(CONFIG_MODULES) |
| 1860 | /* modules using other modules */ | ||
| 1861 | struct module_use { | ||
| 1862 | struct list_head list; | ||
| 1863 | struct module *module_which_uses; | ||
| 1864 | }; | ||
| 1865 | |||
| 1866 | /* | 1860 | /* |
| 1867 | * kdb_lsmod - This function implements the 'lsmod' command. Lists | 1861 | * kdb_lsmod - This function implements the 'lsmod' command. Lists |
| 1868 | * currently loaded kernel modules. | 1862 | * currently loaded kernel modules. |
| @@ -1894,9 +1888,9 @@ static int kdb_lsmod(int argc, const char **argv) | |||
| 1894 | { | 1888 | { |
| 1895 | struct module_use *use; | 1889 | struct module_use *use; |
| 1896 | kdb_printf(" [ "); | 1890 | kdb_printf(" [ "); |
| 1897 | list_for_each_entry(use, &mod->modules_which_use_me, | 1891 | list_for_each_entry(use, &mod->source_list, |
| 1898 | list) | 1892 | source_list) |
| 1899 | kdb_printf("%s ", use->module_which_uses->name); | 1893 | kdb_printf("%s ", use->target->name); |
| 1900 | kdb_printf("]\n"); | 1894 | kdb_printf("]\n"); |
| 1901 | } | 1895 | } |
| 1902 | #endif | 1896 | #endif |
diff --git a/kernel/module.c b/kernel/module.c index be18c3e34684..bbb1d812c79c 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -536,14 +536,6 @@ static void module_unload_init(struct module *mod) | |||
| 536 | mod->waiter = current; | 536 | mod->waiter = current; |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | /* modules using other modules */ | ||
| 540 | struct module_use | ||
| 541 | { | ||
| 542 | struct list_head source_list; | ||
| 543 | struct list_head target_list; | ||
| 544 | struct module *source, *target; | ||
| 545 | }; | ||
| 546 | |||
| 547 | /* Does a already use b? */ | 539 | /* Does a already use b? */ |
| 548 | static int already_uses(struct module *a, struct module *b) | 540 | static int already_uses(struct module *a, struct module *b) |
| 549 | { | 541 | { |
| @@ -589,8 +581,7 @@ static int add_module_usage(struct module *a, struct module *b) | |||
| 589 | /* Module a uses b */ | 581 | /* Module a uses b */ |
| 590 | int use_module(struct module *a, struct module *b) | 582 | int use_module(struct module *a, struct module *b) |
| 591 | { | 583 | { |
| 592 | struct module_use *use; | 584 | int err; |
| 593 | int no_warn, err; | ||
| 594 | 585 | ||
| 595 | if (b == NULL || already_uses(a, b)) return 1; | 586 | if (b == NULL || already_uses(a, b)) return 1; |
| 596 | 587 | ||
