lkml.org 
[lkml]   [2015]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] ftrace: Make if condition correctly due to the operator order
From
Date

> 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



\
 
 \ /
  Last update: 2015-07-27 04:41    [W:0.050 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site