[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1379354609.1934.26.camel@joe-AO722>
Date: Mon, 16 Sep 2013 11:03:29 -0700
From: Joe Perches <joe@...ches.com>
To: George Spelvin <linux@...izon.com>
Cc: keescook@...omium.org, akpm@...ux-foundation.org,
dan.carpenter@...cle.com, JBeulich@...e.com,
kosaki.motohiro@...il.com, linux-kernel@...r.kernel.org,
penguin-kernel@...ove.sakura.ne.jp, viro@...iv.linux.org.uk
Subject: Re: [PATCH 1/2] remove all uses of printf's %n
On Mon, 2013-09-16 at 13:21 -0400, George Spelvin wrote:
> > My thought was to add a seq_last_len()
>
> In addition to adding per-call overhead to support a rarely-used feature
> (while ->pos comes for free), this has the downside that it matters how
> many separate calls are used to generate the string.
>
> The advantage of the "read ->pos before and after" technique is that
> you can have an arbitrary number of output calls in between.
> Including things like seq_path(), seq_bitmap(), etc.
>
> If you have the printing done in a subroutine (as in the net/ipv4
> directory), it would be annoyingly subtle if seq_puts("foobar")
> were not equivalent to seq_puts("foo"); seq_puts("bar").
It's already true that those aren't equivalent.
seq_puts(seq, "short ");
set_puts(seq, "string");
may fit the first bit into the output buffer but not the last
where
setq_puts(seq, "short string");
would not fit at all.
btw: who are you? Is your name really George Spelvin?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists