aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2014-04-03 17:48:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:21:07 -0400
commitfce6e0338abe910ba6d4db0657ae8adc6aa1a72b (patch)
tree4b3857ee351732d6c6da99c246cd6b8ee1fb1a7f /kernel/printk
parent39b25109b400ea397e64c417d8b965a53e2ee0f0 (diff)
printk: do not compute the size of the message twice
This is just a tiny optimization. It removes duplicate computation of the message size. Signed-off-by: Petr Mladek <pmladek@suse.cz> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jan Kara <jack@suse.cz> Cc: Michal Hocko <mhocko@suse.cz> Cc: Kay Sievers <kay@vrfy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b3a1790f9e05..ff9faf4e3cd5 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -351,7 +351,7 @@ static void log_store(int facility, int level,
351 else 351 else
352 msg->ts_nsec = local_clock(); 352 msg->ts_nsec = local_clock();
353 memset(log_dict(msg) + dict_len, 0, pad_len); 353 memset(log_dict(msg) + dict_len, 0, pad_len);
354 msg->len = sizeof(struct printk_log) + text_len + dict_len + pad_len; 354 msg->len = size;
355 355
356 /* insert message */ 356 /* insert message */
357 log_next_idx += msg->len; 357 log_next_idx += msg->len;