public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] printk: Modify operators of printed_len
@ 2017-07-07 16:30 Pierre Kuo
  2017-07-07 17:12 ` Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Kuo @ 2017-07-07 16:30 UTC (permalink / raw)
  To: pmladek; +Cc: sergey.senozhatsky, rostedt, linux-kernel, Pierre Kuo

In 8b1742c9c207, we remove printk-recursion detection code in
vprintk_emit(), where it is the first place that printed_len calculated.
After removing above detection, it seems we can directly assign the
result of log_output to printed_len.

Signed-off-by: Pierre Kuo <vichy.kuo@gmail.com>
---
 kernel/printk/printk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc47863..16f3a61 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1754,7 +1754,7 @@ asmlinkage int vprintk_emit(int facility, int level,
 	if (dict)
 		lflags |= LOG_PREFIX|LOG_NEWLINE;
 
-	printed_len += log_output(facility, level, lflags, dict, dictlen, text, text_len);
+	printed_len = log_output(facility, level, lflags, dict, dictlen, text, text_len);
 
 	logbuf_unlock_irqrestore(flags);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] printk: Modify operators of printed_len
@ 2017-07-08  2:51 Pierre Kuo
  2017-07-08  5:12 ` Sergey Senozhatsky
  2017-07-10 13:51 ` Petr Mladek
  0 siblings, 2 replies; 9+ messages in thread
From: Pierre Kuo @ 2017-07-08  2:51 UTC (permalink / raw)
  To: pmladek; +Cc: sergey.senozhatsky, rostedt, linux-kernel, joe, Pierre Kuo

In 8b1742c9c207, we remove printk-recursion detection code in
vprintk_emit(), where it is the first place that printed_len calculated.
After removing above detection, it seems we can directly assign the
result of log_output to printed_len.

Signed-off-by: Pierre Kuo <vichy.kuo@gmail.com>
---
 kernel/printk/printk.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc47863..a2a8cac 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1701,7 +1701,7 @@ asmlinkage int vprintk_emit(int facility, int level,
 	size_t text_len = 0;
 	enum log_flags lflags = 0;
 	unsigned long flags;
-	int printed_len = 0;
+	int printed_len;
 	bool in_sched = false;
 
 	if (level == LOGLEVEL_SCHED) {
@@ -1754,7 +1754,7 @@ asmlinkage int vprintk_emit(int facility, int level,
 	if (dict)
 		lflags |= LOG_PREFIX|LOG_NEWLINE;
 
-	printed_len += log_output(facility, level, lflags, dict, dictlen, text, text_len);
+	printed_len = log_output(facility, level, lflags, dict, dictlen, text, text_len);
 
 	logbuf_unlock_irqrestore(flags);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-11  4:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 16:30 [PATCH] printk: Modify operators of printed_len Pierre Kuo
2017-07-07 17:12 ` Joe Perches
2017-07-07 20:32   ` pierre kuo
2017-07-07 23:03     ` Joe Perches
2017-07-08  2:49       ` pierre kuo
  -- strict thread matches above, loose matches on Subject: below --
2017-07-08  2:51 Pierre Kuo
2017-07-08  5:12 ` Sergey Senozhatsky
2017-07-10 13:51 ` Petr Mladek
2017-07-11  4:00   ` pierre kuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox