Re: [PATCH 1/2] remove all uses of printf's %n

From: George Spelvin
Date: Tue Sep 17 2013 - 16:57:50 EST


>> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/