mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yalin wang <yalin.wang2010@gmail.com>
To: Minfei Huang <mnfhuang@gmail.com>
Cc: rostedt@goodmis.org, mingo@redhat.com,
	linux-kernel@vger.kernel.org, mhuang@redhat.com
Subject: Re: [PATCH 2/2] ftrace: Make if condition correctly due to the operator order
Date: Mon, 27 Jul 2015 10:20:12 +0800	[thread overview]
Message-ID: <7E65DA64-84A9-4F70-82E4-C4B4113C782D@gmail.com> (raw)
In-Reply-To: <1437926152-12352-2-git-send-email-mnfhuang@gmail.com>


> On Jul 26, 2015, at 23:55, Minfei Huang <mnfhuang@gmail.com> wrote:
> 
> The if condition will be always true, since the operator & has the high
> priority than operator ||.
> 
> Use () to quote them to make the if condition correctly.
> 
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
> kernel/trace/ftrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index c04dff9..d9acc6a 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -254,7 +254,7 @@ static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
> 	 * If this is a dynamic ops or we force list func,
> 	 * then it needs to call the list anyway.
> 	 */
> -	if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
> +	if (ops->flags & (FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC))
> 		return ftrace_ops_list_func;
> 
> 	return ftrace_ops_get_func(ops);
> — 
i think the original code is correct, while your change is wrong from logic.
am i missing something ?
Thanks


  reply	other threads:[~2015-07-27  2:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-26 15:55 [PATCH 1/2] ftrace: Remove the unused variant ftrace_update_time Minfei Huang
2015-07-26 15:55 ` [PATCH 2/2] ftrace: Make if condition correctly due to the operator order Minfei Huang
2015-07-27  2:20   ` yalin wang [this message]
2015-07-27  2:42     ` Minfei Huang

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=7E65DA64-84A9-4F70-82E4-C4B4113C782D@gmail.com \
    --to=yalin.wang2010@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhuang@redhat.com \
    --cc=mingo@redhat.com \
    --cc=mnfhuang@gmail.com \
    --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

all inboxes | Powered by JetHome®