These were placed in the header in ef665c1a06 to get the various SYSFS/MODULE config combintations to compile. That may have been necessary then, but it's not now. These functions are all local to module.c.
Unified · Split
| @@ -672,43 +672,10 @@ static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter) · 671 unmodified lines | ||
| 672 | 672 | |
| 673 | 673 | #endif /* CONFIG_MODULES */ |
| 674 | 674 | |
| 675 | −struct device_driver; | |
| 676 | 675 | #ifdef CONFIG_SYSFS |
| 677 | −struct module; | |
| 678 | − | |
| 679 | 676 | extern struct kset *module_kset; |
| 680 | 677 | extern struct kobj_type module_ktype; |
| 681 | 678 | extern int module_sysfs_initialized; |
| 682 | − | |
| 683 | −int mod_sysfs_init(struct module *mod); | |
| 684 | −int mod_sysfs_setup(struct module *mod, | |
| 685 | − struct kernel_param *kparam, | |
| 686 | − unsigned int num_params); | |
| 687 | −int module_add_modinfo_attrs(struct module *mod); | |
| 688 | −void module_remove_modinfo_attrs(struct module *mod); | |
| 689 | − | |
| 690 | −#else /* !CONFIG_SYSFS */ | |
| 691 | − | |
| 692 | −static inline int mod_sysfs_init(struct module *mod) | |
| 693 | −{ | |
| 694 | − return 0; | |
| 695 | −} | |
| 696 | − | |
| 697 | −static inline int mod_sysfs_setup(struct module *mod, | |
| 698 | − struct kernel_param *kparam, | |
| 699 | − unsigned int num_params) | |
| 700 | −{ | |
| 701 | − return 0; | |
| 702 | −} | |
| 703 | − | |
| 704 | −static inline int module_add_modinfo_attrs(struct module *mod) | |
| 705 | −{ | |
| 706 | − return 0; | |
| 707 | −} | |
| 708 | − | |
| 709 | −static inline void module_remove_modinfo_attrs(struct module *mod) | |
| 710 | −{ } | |
| 711 | − | |
| 712 | 679 | #endif /* CONFIG_SYSFS */ |
| 713 | 680 | |
| 714 | 681 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) |
| @@ -1323,7 +1323,7 @@ static void del_usage_links(struct module *mod) · 1322 unmodified lines | ||
| 1323 | 1323 | #endif |
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | −int module_add_modinfo_attrs(struct module *mod) | |
| 1326 | +static int module_add_modinfo_attrs(struct module *mod) | |
| 1327 | 1327 | { |
| 1328 | 1328 | struct module_attribute *attr; |
| 1329 | 1329 | struct module_attribute *temp_attr; |
| @@ -1349,7 +1349,7 @@ int module_add_modinfo_attrs(struct module *mod) · 19 unmodified lines | ||
| 1349 | 1349 | return error; |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | −void module_remove_modinfo_attrs(struct module *mod) | |
| 1352 | +static void module_remove_modinfo_attrs(struct module *mod) | |
| 1353 | 1353 | { |
| 1354 | 1354 | struct module_attribute *attr; |
| 1355 | 1355 | int i; |
| @@ -1365,7 +1365,7 @@ void module_remove_modinfo_attrs(struct module *mod) · 9 unmodified lines | ||
| 1365 | 1365 | kfree(mod->modinfo_attrs); |
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | −int mod_sysfs_init(struct module *mod) | |
| 1368 | +static int mod_sysfs_init(struct module *mod) | |
| 1369 | 1369 | { |
| 1370 | 1370 | int err; |
| 1371 | 1371 | struct kobject *kobj; |
| @@ -1399,7 +1399,7 @@ out: · 27 unmodified lines | ||
| 1399 | 1399 | return err; |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | −int mod_sysfs_setup(struct module *mod, | |
| 1402 | +static int mod_sysfs_setup(struct module *mod, | |
| 1403 | 1403 | struct kernel_param *kparam, |
| 1404 | 1404 | unsigned int num_params) |
| 1405 | 1405 | { |
| @@ -1445,6 +1445,27 @@ static void mod_sysfs_fini(struct module *mod) · 39 unmodified lines | ||
| 1445 | 1445 | |
| 1446 | 1446 | #else /* CONFIG_SYSFS */ |
| 1447 | 1447 | |
| 1448 | +static inline int mod_sysfs_init(struct module *mod) | |
| 1449 | +{ | |
| 1450 | + return 0; | |
| 1451 | +} | |
| 1452 | + | |
| 1453 | +static inline int mod_sysfs_setup(struct module *mod, | |
| 1454 | + struct kernel_param *kparam, | |
| 1455 | + unsigned int num_params) | |
| 1456 | +{ | |
| 1457 | + return 0; | |
| 1458 | +} | |
| 1459 | + | |
| 1460 | +static inline int module_add_modinfo_attrs(struct module *mod) | |
| 1461 | +{ | |
| 1462 | + return 0; | |
| 1463 | +} | |
| 1464 | + | |
| 1465 | +static inline void module_remove_modinfo_attrs(struct module *mod) | |
| 1466 | +{ | |
| 1467 | +} | |
| 1468 | + | |
| 1448 | 1469 | static void mod_sysfs_fini(struct module *mod) |
| 1449 | 1470 | { |
| 1450 | 1471 | } |