[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130917205742.16147.qmail@science.horizon.com>
Date: 17 Sep 2013 16:57:42 -0400
From: "George Spelvin" <linux@...izon.com>
To: keescook@...omium.org, penguin-kernel@...ove.sakura.ne.jp
Cc: akpm@...ux-foundation.org, dan.carpenter@...cle.com,
geert@...ux-m68k.org, JBeulich@...e.com, joe@...ches.com,
kosaki.motohiro@...il.com, linux-kernel@...r.kernel.org,
linux@...izon.com, viro@...iv.linux.org.uk
Subject: Re: [PATCH 1/2] remove all uses of printf's %n
>> seq_setwidth(m, 21);
>> seq_printf(m, "%s%d", con->name, con->index);
>> seq_pad(m, '\n');
> Ooh, I like this a lot! Much cleaner.
That's certainly a good way to do it, too.
My "general principles" filter thinks it should be in a local variable
if it can, but if hiding it in the struct seq_file is fine if people
find that cleaner.
seq_pad could also reset the field to some null value and warn if
it's found in that state. Not a strong preference, though; the error is
fairly harmless and you might not feel it's worth the code size.
--
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