[PATCH] timer_list: Reduce SEQ_printf footprint
From: Joe Perches
Date: Fri Apr 17 2015 - 14:39:29 EST
This macro can be converted to a static inline to reduce
object size.
(x86-64 defconfig)
$ size kernel/time/timer_list.o*
text data bss dec hex filename
4647 8 0 4655 122f kernel/time/timer_list.o.new
6583 8 0 6591 19bf kernel/time/timer_list.o.old
Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
kernel/time/timer_list.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index e878c2e..5960af21 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -35,13 +35,20 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);
* This allows printing both to /proc/timer_list and
* to the console (on SysRq-Q):
*/
-#define SEQ_printf(m, x...) \
- do { \
- if (m) \
- seq_printf(m, x); \
- else \
- printk(x); \
- } while (0)
+__printf(2, 3)
+static void SEQ_printf(struct seq_file *m, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+
+ if (m)
+ seq_vprintf(m, fmt, args);
+ else
+ vprintk(fmt, args);
+
+ va_end(args);
+}
static void print_name_offset(struct seq_file *m, void *sym)
{
--
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/