LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Yury Norov <yury.norov@gmail.com>, Petr Mladek <pmladek@suse.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/vsprintf: add __putchar()
Date: Fri, 3 Sep 2021 10:56:07 -0400	[thread overview]
Message-ID: <20210903105607.35af6674@gandalf.local.home> (raw)
In-Reply-To: <YSuNTVh17CxUNxtC@smile.fi.intel.com>

On Sun, 29 Aug 2021 16:36:13 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Fri, Aug 27, 2021 at 10:11:55AM -0700, Yury Norov wrote:
> > There are 26 occurrences of the code snippet like this in the file :
> > 	if (buf < end)
> > 	        *buf = separator;
> > 	++buf;
> > 
> > This patch adds a helper function __putchar() to replace opencoding.
> > It adds a lot to readability, and also saves 43 bytes of text on x86.  
> 
> Last time I tried similar it failed the compilation.
> 
> Anyway, while you remove a lot of code I'm not sure it makes the code better
> to read and understand. Also, we use the same idiom outside of this file.
> 
> I would ask Rasmus' opinion on this.
> 

I actually like the clean up, although I haven't reviewed the entire patch.

If it is used outside this file, perhaps it should be in a header instead
and those other locations should be updated accordingly.

-- Steve

  reply	other threads:[~2021-09-03 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 17:11 Yury Norov
2021-08-29 13:36 ` Andy Shevchenko
2021-09-03 14:56   ` Steven Rostedt [this message]
2021-09-03 16:01     ` Yury Norov
2021-09-03 16:20       ` Steven Rostedt
2021-09-03 19:48       ` Andy Shevchenko

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=20210903105607.35af6674@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=senozhatsky@chromium.org \
    --cc=yury.norov@gmail.com \
    --subject='Re: [PATCH] lib/vsprintf: add __putchar()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).