From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-serial@vger.kernel.org, linux-parisc@vger.kernel.org,
Jiri Slaby <jslaby@suse.com>,
"James E.J. Bottomley" <jejb@parisc-linux.org>,
Helge Deller <deller@gmx.de>,
linux-kernel@vger.kernel.org,
Joachim Eastwood <manabian@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] serial: 8250: use initializer instead of memset to clear local struct
Date: Fri, 23 Dec 2016 08:20:26 +0100 [thread overview]
Message-ID: <20161223072026.GA23895@kroah.com> (raw)
In-Reply-To: <1482463308-28968-1-git-send-email-yamada.masahiro@socionext.com>
On Fri, Dec 23, 2016 at 12:21:48PM +0900, Masahiro Yamada wrote:
> Leave the way of zero-out to the compiler's decision; the compiler
> may know a more optimized way than calling memset().
But no, it doesn't, it will leave "blank" areas in the structure with
bad data in it, which is why we do memset. See the tree-wide fixups we
made about a year ago for this very issue. Are you sure none of these
structures get copied to userspace?
> It may end up with memset() for big structures like this after all,
> but the code will be cleaner at least.
Please leave it as-is, unless you see a measured speedup.
thanks,
greg k-h
next prev parent reply other threads:[~2016-12-23 7:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-23 3:21 [PATCH] serial: 8250: use initializer instead of memset to clear local struct Masahiro Yamada
2016-12-23 7:20 ` Greg Kroah-Hartman [this message]
2016-12-24 6:47 ` Masahiro Yamada
2017-01-02 13:27 ` Russell King - ARM Linux
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=20161223072026.GA23895@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=deller@gmx.de \
--cc=jejb@parisc-linux.org \
--cc=jslaby@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=manabian@gmail.com \
--cc=yamada.masahiro@socionext.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 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).