From: Rusty Russell <rusty@rustcorp.com.au>
To: Petr Mladek <pmladek@suse.cz>
Cc: Jiri Slaby <jslaby@suse.cz>, Steven Rostedt <rostedt@goodmis.org>,
Jiri Kosina <jkosina@suse.cz>,
linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.cz>
Subject: Re: [PATCH 2/2] module: return bool from within_module*()
Date: Wed, 23 Jul 2014 15:09:13 +0930 [thread overview]
Message-ID: <87bnsgzla6.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1406032090-16151-3-git-send-email-pmladek@suse.cz>
Petr Mladek <pmladek@suse.cz> writes:
> The within_module*() functions return only true or false. Let's use bool as
> the return type.
>
> Note that it should not change kABI because these are inline functions.
>
> Signed-off-by: Petr Mladek <pmladek@suse.cz>
Thanks, applied both.
Cheers,
Rusty.
> ---
> include/linux/module.h | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 61d8fb2d0873..71f282a4e307 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -396,19 +396,21 @@ bool is_module_address(unsigned long addr);
> bool is_module_percpu_address(unsigned long addr);
> bool is_module_text_address(unsigned long addr);
>
> -static inline int within_module_core(unsigned long addr, const struct module *mod)
> +static inline bool within_module_core(unsigned long addr,
> + const struct module *mod)
> {
> return (unsigned long)mod->module_core <= addr &&
> addr < (unsigned long)mod->module_core + mod->core_size;
> }
>
> -static inline int within_module_init(unsigned long addr, const struct module *mod)
> +static inline bool within_module_init(unsigned long addr,
> + const struct module *mod)
> {
> return (unsigned long)mod->module_init <= addr &&
> addr < (unsigned long)mod->module_init + mod->init_size;
> }
>
> -static inline int within_module(unsigned long addr, const struct module *mod)
> +static inline bool within_module(unsigned long addr, const struct module *mod)
> {
> return within_module_init(addr, mod) || within_module_core(addr, mod);
> }
> --
> 1.8.4
prev parent reply other threads:[~2014-07-23 5:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 12:28 [PATCH 0/2] module: add within_module() and change return type Petr Mladek
2014-07-22 12:28 ` [PATCH 1/2] module: add within_module() function Petr Mladek
2014-07-22 12:40 ` Steven Rostedt
2014-07-22 12:28 ` [PATCH 2/2] module: return bool from within_module*() Petr Mladek
2014-07-23 5:39 ` Rusty Russell [this message]
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=87bnsgzla6.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=jkosina@suse.cz \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.cz \
--cc=rostedt@goodmis.org \
/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