Skip to content

Commit 7de4e74

Browse files
JoePerchesKAGA-KOKO
authored andcommitted
timer_list: Reduce SEQ_printf footprint
This macro can be converted to a static function to reduce object size. (x86-64 defconfig) $ size kernel/time/timer_list.o* text data bss dec hex filename 6583 8 0 6591 19bf kernel/time/timer_list.o.old 4647 8 0 4655 122f kernel/time/timer_list.o.new Signed-off-by: Joe Perches <joe@perches.com> Cc: John Stultz <john.stultz@linaro.org> Link: http://lkml.kernel.org/r/1429295958.2850.104.camel@perches.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 646da63 commit 7de4e74

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

‎kernel/time/timer_list.c‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,20 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
3535
* This allows printing both to /proc/timer_list and
3636
* to the console (on SysRq-Q):
3737
*/
38-
#define SEQ_printf(m, x...) \
39-
do { \
40-
if (m) \
41-
seq_printf(m, x); \
42-
else \
43-
printk(x); \
44-
} while (0)
38+
__printf(2, 3)
39+
static void SEQ_printf(struct seq_file *m, const char *fmt, ...)
40+
{
41+
va_list args;
42+
43+
va_start(args, fmt);
44+
45+
if (m)
46+
seq_vprintf(m, fmt, args);
47+
else
48+
vprintk(fmt, args);
49+
50+
va_end(args);
51+
}
4552

4653
static void print_name_offset(struct seq_file *m, void *sym)
4754
{

0 commit comments

Comments
 (0)