linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Joe Perches <joe@perches.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Petr Mladek <pmladek@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jiri Kosina <jkosina@suse.cz>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jeff Layton <jlayton@poochiereds.net>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 5/7] fs: Convert show_fdinfo functions to void
Date: Tue, 28 Oct 2014 10:11:58 -0400	[thread overview]
Message-ID: <20141028101158.3dde9880@gandalf.local.home> (raw)
In-Reply-To: <e37e6e7b76acbdcc3bb4ab2a57c8f8ca1ae11b9a.1412031505.git.joe@perches.com>

On Mon, 29 Sep 2014 16:08:25 -0700
Joe Perches <joe@perches.com> wrote:

> seq_printf functions shouldn't really check the return value.
> Checking seq_is_full occasionally is used instead.
> 
> Update vfs documentation.
> 
> Signed-off-by: Joe Perches <joe@perches.com>


>  
> -#ifdef CONFIG_PROC_FS
> -static int eventfd_show_fdinfo(struct seq_file *m, struct file *f)
> +static void eventfd_show_fdinfo(struct seq_file *m, struct file *f)
>  {
> +#ifdef CONFIG_PROC_FS
>  	struct eventfd_ctx *ctx = f->private_data;
> -	int ret;
>  
>  	spin_lock_irq(&ctx->wqh.lock);
> -	ret = seq_printf(m, "eventfd-count: %16llx\n",
> -			 (unsigned long long)ctx->count);
> +	seq_printf(m, "eventfd-count: %16llx\n",
> +		   (unsigned long long)ctx->count);
>  	spin_unlock_irq(&ctx->wqh.lock);
> -
> -	return ret;
> -}
>  #endif
> +}
>  
>  static const struct file_operations eventfd_fops = {
> -#ifdef CONFIG_PROC_FS
>  	.show_fdinfo	= eventfd_show_fdinfo,
> -#endif

I wouldn't change logic on this. There's no reason to call this
function if it isn't doing anything.

I'll change this to just do the update and not change logic like this.

-- Steve

>  	.release	= eventfd_release,
>  	.poll		= eventfd_poll,
>  	.read		= eventfd_read,



> diff --git a/fs/proc/fd.c b/fs/proc/fd.c
> index e11d7c5..4c3c253 100644
> --- a/fs/proc/fd.c
> +++ b/fs/proc/fd.c
> @@ -53,7 +53,7 @@ static int seq_show(struct seq_file *m, void *v)
>  			   (long long)file->f_pos, f_flags,
>  			   real_mount(file->f_path.mnt)->mnt_id);
>  		if (file->f_op->show_fdinfo)
> -			ret = file->f_op->show_fdinfo(m, file);
> +			file->f_op->show_fdinfo(m, file);
>  		fput(file);
>  	}
>  

  reply	other threads:[~2014-10-28 14:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140929124246.3e39dac8@gandalf.local.home>
2014-09-29 23:08 ` [PATCH 0/7] seq_printf cleanups Joe Perches
2014-09-29 23:08   ` [PATCH 1/7] seq_file: Rename static bool seq_overflow to public bool seq_is_full Joe Perches
2014-09-29 23:44     ` Steven Rostedt
2014-09-29 23:48       ` Joe Perches
2014-09-30 10:06     ` Petr Mladek
2014-09-29 23:08   ` [PATCH 5/7] fs: Convert show_fdinfo functions to void Joe Perches
2014-10-28 14:11     ` Steven Rostedt [this message]
2014-10-28 14:31       ` Joe Perches
2014-10-28 14:43         ` Steven Rostedt
2014-10-28 15:32   ` [PATCH 0/7] seq_printf cleanups Steven Rostedt
2014-10-28 15:51     ` Joe Perches

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=20141028101158.3dde9880@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=jkosina@suse.cz \
    --cc=jlayton@poochiereds.net \
    --cc=joe@perches.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pmladek@suse.cz \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).