Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933232AbdDSBru (ORCPT ); Tue, 18 Apr 2017 21:47:50 -0400 Received: from smtpbgau1.qq.com ([54.206.16.166]:55723 "EHLO smtpbgau1.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933200AbdDSBrr (ORCPT ); Tue, 18 Apr 2017 21:47:47 -0400 X-QQ-mid: esmtp11t1492566456t2l7za159 X-QQ-SSF: 01000000000000F0FG600F00000000Q X-QQ-FEAT: 3CtJeSk7NKBuvoThOG+uBOV2qzBmKtJP7U3R83EpzBXN41fZoYWPecd0hylMe Ldkb1eI+RegMpxICstGIkr2j9zMcaSQZgMo6WT7m2AE8PLDQL9ove6p88FGr4YjY6HIGb5m kgwF9I59gvO87rpCNwfvC7l7P377SwuMzEtg4nHB72OaYmqp8OXQoHJseKnMMPzgSyWitSO 3uMaxxIQjbuQ5XObiK65nvNy2skNE7pywcwd7BhJJKirDyWtEmT8E7sGtfEEi9Eqz4znVoL D/1hmqefuJLgRw X-QQ-GoodBg: 0 From: gfree.wind@foxmail.com To: jeyu@redhat.com, rusty@rustcorp.com.au, linux-kernel@vger.kernel.org Cc: Gao Feng Subject: [PATCH] module: Unify the return value type of try_module_get Date: Wed, 19 Apr 2017 09:47:22 +0800 Message-Id: <1492566442-12608-1-git-send-email-gfree.wind@foxmail.com> X-Mailer: git-send-email 1.9.1 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign3 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1131 Lines: 41 From: Gao Feng 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 --- 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