From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938622AbcLWHUP (ORCPT ); Fri, 23 Dec 2016 02:20:15 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35690 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932162AbcLWHUO (ORCPT ); Fri, 23 Dec 2016 02:20:14 -0500 Date: Fri, 23 Dec 2016 08:20:26 +0100 From: Greg Kroah-Hartman To: Masahiro Yamada Cc: linux-serial@vger.kernel.org, linux-parisc@vger.kernel.org, Jiri Slaby , "James E.J. Bottomley" , Helge Deller , linux-kernel@vger.kernel.org, Joachim Eastwood , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] serial: 8250: use initializer instead of memset to clear local struct Message-ID: <20161223072026.GA23895@kroah.com> References: <1482463308-28968-1-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1482463308-28968-1-git-send-email-yamada.masahiro@socionext.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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