Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755449AbbG0Chk (ORCPT ); Sun, 26 Jul 2015 22:37:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40145 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755306AbbG0Chi (ORCPT ); Sun, 26 Jul 2015 22:37:38 -0400 Date: Mon, 27 Jul 2015 10:42:12 +0800 From: Minfei Huang To: yalin wang Cc: Minfei Huang , rostedt@goodmis.org, mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ftrace: Make if condition correctly due to the operator order Message-ID: <20150727024212.GA5675@dhcp-128-25.nay.redhat.com> References: <1437926152-12352-1-git-send-email-mnfhuang@gmail.com> <1437926152-12352-2-git-send-email-mnfhuang@gmail.com> <7E65DA64-84A9-4F70-82E4-C4B4113C782D@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7E65DA64-84A9-4F70-82E4-C4B4113C782D@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1509 Lines: 47 On 07/27/15 at 10:20am, yalin wang wrote: > > > On Jul 26, 2015, at 23:55, Minfei Huang 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 > > --- > > 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 > Thanks for your correction. Yes. The previous code matches the logic. Nacked. Thanks Minfei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/