All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: pierre kuo <vichy.kuo@gmail.com>
Cc: pmladek@suse.com,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	rostedt@goodmis.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printk: Modify operators of printed_len
Date: Fri, 07 Jul 2017 16:03:21 -0700	[thread overview]
Message-ID: <1499468601.20988.7.camel@perches.com> (raw)
In-Reply-To: <CAOVJa8H-6wKzOuOYL5ASMiokTXR+kKqgs_Tg-ie-pE0OSzuBHQ@mail.gmail.com>

On Sat, 2017-07-08 at 04:32 +0800, pierre kuo wrote:
> hi Joe:

Hello Pierre.

> 2017-07-08 1:12 GMT+08:00 Joe Perches <joe@perches.com>:
> > On Sat, 2017-07-08 at 00:30 +0800, Pierre Kuo wrote:
> > > 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.
> > 
> > []
> > > diff --git 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);
> > 
> > If this is appropriate, this should also remove the
> > initialization of printed_len and perhaps rename it too.
> 
> I cannot quite understand the reason why need to rename.
> printed_len seems meet the meaning we expect for here.

Verbosity.  To me, len would be adequate.

Anyway, the real point was the declaration of printed_len could
remove the " = 0" as it's now only set once.

cheers, Joe

  reply	other threads:[~2017-07-07 23:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499468601.20988.7.camel@perches.com \
    --to=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=vichy.kuo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.