diff options
author | Gao Feng <fgao@ikuai8.com> | 2017-04-18 21:47:22 -0400 |
---|---|---|
committer | Jessica Yu <jeyu@redhat.com> | 2017-04-24 00:13:01 -0400 |
commit | 8ba4fcdf0f4068407e98cd9cc0f230c2dd8d56de (patch) | |
tree | ae8fbc64db5f265f29b672b1b78f2a3036426b7e | |
parent | 5bd933fe4481688d595ae1dd0440006c8675a1a8 (diff) |
module: Unify the return value type of try_module_get
The prototypes of try_module_get are different with different macro.
When enable module and module unload, it returns bool, but others not.
Make the return type for try_module_get consistent across all module
config options.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
[jeyu: slightly amended changelog to make it clearer]
Signed-off-by: Jessica Yu <jeyu@redhat.com>
-rw-r--r-- | include/linux/module.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 0297c5cd7cdf..6b79eb76a523 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -582,7 +582,7 @@ extern bool try_module_get(struct module *module); | |||
582 | extern void module_put(struct module *module); | 582 | extern void module_put(struct module *module); |
583 | 583 | ||
584 | #else /*!CONFIG_MODULE_UNLOAD*/ | 584 | #else /*!CONFIG_MODULE_UNLOAD*/ |
585 | static inline int try_module_get(struct module *module) | 585 | static inline bool try_module_get(struct module *module) |
586 | { | 586 | { |
587 | return !module || module_is_live(module); | 587 | return !module || module_is_live(module); |
588 | } | 588 | } |
@@ -674,9 +674,9 @@ static inline void __module_get(struct module *module) | |||
674 | { | 674 | { |
675 | } | 675 | } |
676 | 676 | ||
677 | static inline int try_module_get(struct module *module) | 677 | static inline bool try_module_get(struct module *module) |
678 | { | 678 | { |
679 | return 1; | 679 | return true; |
680 | } | 680 | } |
681 | 681 | ||
682 | static inline void module_put(struct module *module) | 682 | static inline void module_put(struct module *module) |