lkml.org 
[lkml]   [2014]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/7] fs: Convert show_fdinfo functions to void
From
Date
On Tue, 2014-10-28 at 10:11 -0400, Steven Rostedt wrote:
> 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.

Fewer #ifdefs




\
 
 \ /
  Last update: 2014-10-28 16:01    [W:0.111 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site