Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625782 > unrolled thread

[PATCH] module: Unify the return value type of try_module_get

Started bygfree.wind@foxmail.com
First post2017-04-19 03:50 +0200
Last post2017-04-24 06:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] module: Unify the return value type of try_module_get gfree.wind@foxmail.com - 2017-04-19 03:50 +0200
    Re: [PATCH] module: Unify the return value type of try_module_get Jessica Yu <jeyu@redhat.com> - 2017-04-24 06:50 +0200

#1625782 — [PATCH] module: Unify the return value type of try_module_get

Fromgfree.wind@foxmail.com
Date2017-04-19 03:50 +0200
Subject[PATCH] module: Unify the return value type of try_module_get
Message-ID<txMUN-5oF-5@gated-at.bofh.it>
From: Gao Feng <fgao@ikuai8.com>

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 <fgao@ikuai8.com>
---
 include/linux/module.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 0297c5c..6b79eb7 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -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)
-- 
1.9.1

[toc] | [next] | [standalone]


#1629164

FromJessica Yu <jeyu@redhat.com>
Date2017-04-24 06:50 +0200
Message-ID<tzE6K-2cz-5@gated-at.bofh.it>
In reply to#1625782
+++ gfree.wind@foxmail.com [19/04/17 09:47 +0800]:
>From: Gao Feng <fgao@ikuai8.com>
>
>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 <fgao@ikuai8.com>

Applied, thanks for the clean-up!

Jessica

>---
> include/linux/module.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/include/linux/module.h b/include/linux/module.h
>index 0297c5c..6b79eb7 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -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)
>-- 
>1.9.1
>
>
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web