From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755326AbdGKW6r (ORCPT ); Tue, 11 Jul 2017 18:58:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:34652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753647AbdGKW6q (ORCPT ); Tue, 11 Jul 2017 18:58:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 318C722CA1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 11 Jul 2017 18:58:43 -0400 From: Steven Rostedt To: Arnd Bergmann Cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] ftrace: avoid unused-variable warning Message-ID: <20170711185843.63a96b1e@gandalf.local.home> In-Reply-To: <20170710110521.600806-1-arnd@arndb.de> References: <20170710110521.600806-1-arnd@arndb.de> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jul 2017 13:04:56 +0200 Arnd Bergmann wrote: > When CONFIG_DYNAMIC_FTRACE is disabled, we get a harmless > compile-time warning: > > kernel/trace/trace_stack.c: In function 'stack_trace_filter_open': > kernel/trace/trace_stack.c:412:21: error: unused variable 'ops' [-Werror=unused-variable] > > We could replace the macros in linux/ftrace.h with inline functions, > which would solve this problem for all callers. However, as these > are only called internally in the ftrace code, it seems simpler > to change the caller instead. Actually we can't replace them, as they are called when ftrace is not defined, and the ops isn't defined either (which the comment above the macros state). > > Fixes: 0f17976568b3 ("ftrace: Fix regression with module command in stack_trace_filter") > Signed-off-by: Arnd Bergmann > --- > kernel/trace/trace_stack.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c > index b4a751e8f9d6..0ff29008383b 100644 > --- a/kernel/trace/trace_stack.c > +++ b/kernel/trace/trace_stack.c > @@ -409,9 +409,7 @@ static const struct file_operations stack_trace_fops = { > static int > stack_trace_filter_open(struct inode *inode, struct file *file) > { > - struct ftrace_ops *ops = inode->i_private; > - > - return ftrace_regex_open(ops, FTRACE_ITER_FILTER, > + return ftrace_regex_open(inode->i_private, FTRACE_ITER_FILTER, Actually, I'm glad you mentioned this warning. Because this file should not be exposed if DYNAMIC_FTRACE is not set. I'll fix. Thanks! -- Steve > inode, file); > } >