* [PATCH v2] printk: Modify operators of printed_len and text_len
@ 2017-07-11 6:40 Pierre Kuo
2017-07-11 8:30 ` Petr Mladek
0 siblings, 1 reply; 2+ messages in thread
From: Pierre Kuo @ 2017-07-11 6:40 UTC (permalink / raw)
To: pmladek; +Cc: sergey.senozhatsky, rostedt, linux-kernel, joe, Pierre Kuo
With commit <ddb9baa82226> ("printk: report lost messages in printk
safe/nmi contexts") and commit <8b1742c9c207> ("printk: remove zap_locks()
function"), it seems we can remove initialization, "=0", of text_len and
directly assign result of log_output to printed_len.
Signed-off-by: Pierre Kuo <vichy.kuo@gmail.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
Changes since v2:
* Per Petr's friendly reminder, add description of <ddb9baa82226> ("printk: report lost messages in printk
safe/nmi contexts") and remove "=0", the initialization, of text_len.
kernel/printk/printk.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc47863..229fbdcb 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1698,10 +1698,10 @@ asmlinkage int vprintk_emit(int facility, int level,
{
static char textbuf[LOG_LINE_MAX];
char *text = textbuf;
- size_t text_len = 0;
+ size_t text_len;
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] 2+ messages in thread
* Re: [PATCH v2] printk: Modify operators of printed_len and text_len
2017-07-11 6:40 [PATCH v2] printk: Modify operators of printed_len and text_len Pierre Kuo
@ 2017-07-11 8:30 ` Petr Mladek
0 siblings, 0 replies; 2+ messages in thread
From: Petr Mladek @ 2017-07-11 8:30 UTC (permalink / raw)
To: Pierre Kuo; +Cc: sergey.senozhatsky, rostedt, linux-kernel, joe
On Tue 2017-07-11 14:40:55, Pierre Kuo wrote:
> With commit <ddb9baa82226> ("printk: report lost messages in printk
> safe/nmi contexts") and commit <8b1742c9c207> ("printk: remove zap_locks()
> function"), it seems we can remove initialization, "=0", of text_len and
> directly assign result of log_output to printed_len.
Just one small thing. The <> brackets should not be there around
the sha1 commit id. Otherwise, the patch looks fine to me.
Acked-by: Petr Mladek <pmladek@suse.com>
You do not need to resend the patch. I'll remove the brackets
when applying the patch. I'll wait few more days just in case
anyone has more comments on this patch.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-11 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11 6:40 [PATCH v2] printk: Modify operators of printed_len and text_len Pierre Kuo
2017-07-11 8:30 ` Petr Mladek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.