mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: gfree.wind@foxmail.com
To: jeyu@redhat.com, rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Cc: Gao Feng <fgao@48lvckh6395k16k5.yundunddos.com>
Subject: [PATCH] module: Unify the return value type of try_module_get
Date: Wed, 19 Apr 2017 09:47:22 +0800	[thread overview]
Message-ID: <1492566442-12608-1-git-send-email-gfree.wind@foxmail.com> (raw)

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

             reply	other threads:[~2017-04-19  1:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19  1:47 gfree.wind [this message]
2017-04-24  4:44 ` Jessica Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492566442-12608-1-git-send-email-gfree.wind@foxmail.com \
    --to=gfree.wind@foxmail.com \
    --cc=fgao@48lvckh6395k16k5.yundunddos.com \
    --cc=jeyu@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®