Skip to content

Commit aec47ca

Browse files
pierreKuo2Gitpmladek
authored andcommitted
printk: Modify operators of printed_len and text_len
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. Link: http://lkml.kernel.org/r/[email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Pierre Kuo <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
1 parent eed1fc8 commit aec47ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/printk/printk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,10 +1698,10 @@ asmlinkage int vprintk_emit(int facility, int level,
16981698
{
16991699
static char textbuf[LOG_LINE_MAX];
17001700
char *text = textbuf;
1701-
size_t text_len = 0;
1701+
size_t text_len;
17021702
enum log_flags lflags = 0;
17031703
unsigned long flags;
1704-
int printed_len = 0;
1704+
int printed_len;
17051705
bool in_sched = false;
17061706

17071707
if (level == LOGLEVEL_SCHED) {
@@ -1754,7 +1754,7 @@ asmlinkage int vprintk_emit(int facility, int level,
17541754
if (dict)
17551755
lflags |= LOG_PREFIX|LOG_NEWLINE;
17561756

1757-
printed_len += log_output(facility, level, lflags, dict, dictlen, text, text_len);
1757+
printed_len = log_output(facility, level, lflags, dict, dictlen, text, text_len);
17581758

17591759
logbuf_unlock_irqrestore(flags);
17601760

0 commit comments

Comments
 (0)