lkml.org 
[lkml]   [2015]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ipc: Remove uses of return value of seq_printf/seq_puts
From
Date
On Wed, 2015-02-18 at 00:27 +0000, Al Viro wrote:
> On Tue, Feb 17, 2015 at 04:09:44PM -0800, Joe Perches wrote:
> > On Tue, 2015-02-17 at 23:16 +0000, Al Viro wrote:
> > > Most of the time checking return value of seq_...() is better replaced with
> > > not doing that. And "must check return value and Do Something(tm)" is too
> > > strong habit for enough people to cause recurring trouble.
> >
> > Does SEQ_SKIP still have value?
>
> Yes, it does, but it's not an error - it's an equivalent of "empty the buffer
> before returning". Basically, it's "I've decided that this entry shouldn't
> produce anything". Look at the caller:

Yeah.

I should have looked at the traverse function first.

> error = m->op->show(m, p);
> if (error < 0)
> break;
> if (unlikely(error)) {
> error = 0;
> m->count = 0;
> }

Basically all the show functions that I converted
to use seq_has_overflowed() should just return 0.

There are only 3 current uses of SEQ_SKIP

drivers/infiniband/hw/qib/qib_debugfs.c:119: return SEQ_SKIP;
drivers/infiniband/hw/qib/qib_debugfs.c:177: return SEQ_SKIP;
drivers/infiniband/hw/qib/qib_debugfs.c:183: return SEQ_SKIP;

As far as I can tell, these uses would be fine
not using SEQ_SKIP and just emitting 0 instead
of nothing.




\
 
 \ /
  Last update: 2015-02-18 02:01    [W:0.111 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site