]> git.baikalelectronics.ru Git - kernel.git/commit
printk: Optimize if statement logic where newline exists
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 29 Jun 2012 15:40:11 +0000 (11:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jun 2012 20:55:35 +0000 (16:55 -0400)
commitd5d7ccb274e3f37d37564558cb33c5a0894dd62b
tree57e8fdef7ebf7b01e0377ba68ae58921fb545cf5
parentfd091a406aa46e5710be0ef103c6a47746f0ce0d
printk: Optimize if statement logic where newline exists

In reviewing Kay's fix up patch: "printk: Have printk() never buffer its
data", I found two if statements that could be combined and optimized.

Put together the two 'cont.len && cont.owner == current' if statements
into a single one, and check if we need to call cont_add(). This also
removes the unneeded double cont_flush() calls.

Link: http://lkml.kernel.org/r/1340869133.876.10.camel@mop
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/printk.c