Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-18 Thread Joe Perches
On Mon, 2013-03-18 at 13:59 -0700, Andrew Morton wrote: > On Sat, 16 Mar 2013 17:54:47 + Al Viro wrote: > > > On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote: > > > Instead of converting the 800 or so uses of seq_printf with > > > a constant format (without a % substitution) to

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-18 Thread Andrew Morton
On Sat, 16 Mar 2013 17:54:47 + Al Viro wrote: > On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote: > > Instead of converting the 800 or so uses of seq_printf with > > a constant format (without a % substitution) to seq_puts, > > maybe there's another way to slightly speed up these

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-18 Thread Andrew Morton
On Sat, 16 Mar 2013 17:54:47 + Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote: Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-18 Thread Joe Perches
On Mon, 2013-03-18 at 13:59 -0700, Andrew Morton wrote: On Sat, 16 Mar 2013 17:54:47 + Al Viro v...@zeniv.linux.org.uk wrote: On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote: Instead of converting the 800 or so uses of seq_printf with a constant format (without a %

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
On Sat, 2013-03-16 at 18:01 +, Al Viro wrote: > On Sat, Mar 16, 2013 at 10:51:18AM -0700, Joe Perches wrote: > > > This is certainly a neat trick. > > > > > > But I don't really like the fact that it complicates things for every > > > future code reader, especially when a trivial change in

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Al Viro
On Sat, Mar 16, 2013 at 10:51:18AM -0700, Joe Perches wrote: > > This is certainly a neat trick. > > > > But I don't really like the fact that it complicates things for every > > future code reader, especially when a trivial change in the caller > > would accomplish the same thing. Do you have

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Al Viro
On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote: > Instead of converting the 800 or so uses of seq_printf with > a constant format (without a % substitution) to seq_puts, > maybe there's another way to slightly speed up these outputs. > > Taking a similar approach to commit abd84d60eb

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
On Sat, 2013-03-16 at 09:43 -0600, Bjorn Helgaas wrote: > On Sat, Mar 16, 2013 at 7:50 AM, Joe Perches wrote: > > Instead of converting the 800 or so uses of seq_printf with > > a constant format (without a % substitution) to seq_puts, > > maybe there's another way to slightly speed up these

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
On Sat, 2013-03-16 at 09:43 -0600, Bjorn Helgaas wrote: > Checkpatch could look for additions of seq_printf() with constant formats. Suggested-by: Bjorn Helgaas Signed-off-by: Joe Perches --- I don't know what perl version introduced $-[0] and $+[0] so this may not work with older perl.

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
On Sat, 2013-03-16 at 09:15 -0700, Joe Perches wrote: > > > +int (seq_printf)(struct seq_file *m, const char *f, ...) > > > > That's rather ugly. Why not just #undef seq_printf before defining it? > > The whole thing is ugly, nasty and hackish. > I kinda like it. > > But I don't like

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
On Sat, 2013-03-16 at 11:57 -0400, Steven Rostedt wrote: > My macro nastiness is contagious ;-) True. > On Sat, 2013-03-16 at 06:50 -0700, Joe Perches wrote: > > +int (seq_printf)(struct seq_file *m, const char *f, ...) > > That's rather ugly. Why not just #undef seq_printf before defining it?

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
On Sat, 2013-03-16 at 09:43 -0600, Bjorn Helgaas wrote: > This is certainly a neat trick. Thank you ;-) > > But I don't really like the fact that it complicates things for every > future code reader, especially when a trivial change in the caller > would accomplish the same thing. Do you have

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
My macro nastiness is contagious ;-) On Sat, 2013-03-16 at 06:50 -0700, Joe Perches wrote: > Instead of converting the 800 or so uses of seq_printf with > a constant format (without a % substitution) to seq_puts, > maybe there's another way to slightly speed up these outputs. > > Taking a

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Bjorn Helgaas
On Sat, Mar 16, 2013 at 7:50 AM, Joe Perches wrote: > Instead of converting the 800 or so uses of seq_printf with > a constant format (without a % substitution) to seq_puts, > maybe there's another way to slightly speed up these outputs. > > Taking a similar approach to commit abd84d60eb >

[RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly speed up these outputs. Taking a similar approach to commit abd84d60eb ("tracing: Optimize trace_printk() with one arg to use trace_puts()")

[RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly speed up these outputs. Taking a similar approach to commit abd84d60eb (tracing: Optimize trace_printk() with one arg to use trace_puts())

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Bjorn Helgaas
On Sat, Mar 16, 2013 at 7:50 AM, Joe Perches j...@perches.com wrote: Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly speed up these outputs. Taking a similar approach to commit

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
My macro nastiness is contagious ;-) On Sat, 2013-03-16 at 06:50 -0700, Joe Perches wrote: Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly speed up these outputs. Taking a similar

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
On Sat, 2013-03-16 at 09:43 -0600, Bjorn Helgaas wrote: This is certainly a neat trick. Thank you ;-) But I don't really like the fact that it complicates things for every future code reader, especially when a trivial change in the caller would accomplish the same thing. Do you have any

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
On Sat, 2013-03-16 at 11:57 -0400, Steven Rostedt wrote: My macro nastiness is contagious ;-) True. On Sat, 2013-03-16 at 06:50 -0700, Joe Perches wrote: +int (seq_printf)(struct seq_file *m, const char *f, ...) That's rather ugly. Why not just #undef seq_printf before defining it? The

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
On Sat, 2013-03-16 at 09:15 -0700, Joe Perches wrote: +int (seq_printf)(struct seq_file *m, const char *f, ...) That's rather ugly. Why not just #undef seq_printf before defining it? The whole thing is ugly, nasty and hackish. I kinda like it. But I don't like unnecessary undefs.

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
On Sat, 2013-03-16 at 09:43 -0600, Bjorn Helgaas wrote: Checkpatch could look for additions of seq_printf() with constant formats. Suggested-by: Bjorn Helgaas bhelg...@google.com Signed-off-by: Joe Perches j...@perches.com --- I don't know what perl version introduced $-[0] and $+[0] so this

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Joe Perches
On Sat, 2013-03-16 at 09:43 -0600, Bjorn Helgaas wrote: On Sat, Mar 16, 2013 at 7:50 AM, Joe Perches j...@perches.com wrote: Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly speed up

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Al Viro
On Sat, Mar 16, 2013 at 06:50:44AM -0700, Joe Perches wrote: Instead of converting the 800 or so uses of seq_printf with a constant format (without a % substitution) to seq_puts, maybe there's another way to slightly speed up these outputs. Taking a similar approach to commit abd84d60eb

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Al Viro
On Sat, Mar 16, 2013 at 10:51:18AM -0700, Joe Perches wrote: This is certainly a neat trick. But I don't really like the fact that it complicates things for every future code reader, especially when a trivial change in the caller would accomplish the same thing. Do you have any idea

Re: [RFC PATCH] seq_file: Use seq_puts when seq_printf has only a format with no args

2013-03-16 Thread Steven Rostedt
On Sat, 2013-03-16 at 18:01 +, Al Viro wrote: On Sat, Mar 16, 2013 at 10:51:18AM -0700, Joe Perches wrote: This is certainly a neat trick. But I don't really like the fact that it complicates things for every future code reader, especially when a trivial change in the caller