LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ftrace: avoid unused-variable warning
Date: Tue, 11 Jul 2017 18:58:43 -0400
Message-ID: <20170711185843.63a96b1e@gandalf.local.home> (raw)
In-Reply-To: <20170710110521.600806-1-arnd@arndb.de>

On Mon, 10 Jul 2017 13:04:56 +0200
Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de>
> ---
>  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);
>  }
>  

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 11:04 Arnd Bergmann
2017-07-11 22:58 ` Steven Rostedt [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=20170711185843.63a96b1e@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git