module: Unify the return value type of try_module_get
PATCH 1/1 module: Unify the return value type of try_module_get
From: Gao Feng <[email protected]>
The prototypes of try_module_get are different with different macro. When enable module and module unload, it returns bool, but others not. Now unify their return value type as bool.
Signed-off-by Gao Feng <[email protected]>
--- include/linux/module.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/module.h +3 -3
@@ -582,7 +582,7 @@ extern void __noreturn __module_put_and_exit(struct module *mod,extern void module_put (struct module *module);#else /*!CONFIG_MODULE_UNLOAD*/ -static inline int try_module_get (struct module *module) +static inline bool try_module_get (struct module *module) {return !module ||module_is_live (module); }
@@ -674,9 +674,9 @@ static inline void __module_get(struct module *module) { } -static inline int try_module_get (struct module *module) +static inline bool try_module_get (struct module *module) { -return 1 ; +return true; }static inline void module_put (struct module *module)
Signature · 1 line
1.9.1
Jessica Yu
Applied+++ [email protected] [19/04/17 09:47 +0800]:
Quoted 7 lines
From: Gao Feng <[email protected]>
The prototypes of
try_module_getare different with different macro. When enable module and module unload, it returns bool, but others not. Now unify their return value type as bool.Signed-off-by Gao Feng <[email protected]>
Applied, thanks for the clean-up!
Jessica
Quoted 35 lines
---
include/linux/module.h| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)include/linux/module.h +3
-3@@ -582,7 +582,7 @@ extern void __noreturn __module_put_and_exit(struct module *mod,extern void module_put (struct module *module);#else /*!CONFIG_MODULE_UNLOAD*/ -static inline int try_module_get (struct module *module) +static inline bool try_module_get (struct module *module) {return !module ||module_is_live (module); }@@ -674,9 +674,9 @@ static inline void __module_get(struct module *module) { } -static inline int try_module_get (struct module *module) +static inline bool try_module_get (struct module *module) { -return 1 ; +return true; }static inline void module_put (struct module *module)Signature · 1 line
1.9.1