From: Joe Perches Date: Wed, 07 Sep 2016 16:37:00 +0000 Subject: Re: x86-ksysfs: Use kmalloc_array() in create_setup_data_nodes() Message-Id: <1473266220.29864.17.camel@perches.com> List-Id: References: <3b21b2d7-9856-009c-9bd1-3a76a83bc7fc@users.sourceforge.net> <3eea073a-b271-54b7-1eec-e841e0f4bdf9@redhat.com> <07f2cb49-662f-590f-acf6-686f8432015d@users.sourceforge.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Kees Cook , SF Markus Elfring Cc: Paolo Bonzini , Ingo Molnar , "x86@kernel.org" , Dave Young , "H. Peter Anvin" , Matt Fleming , Thomas Gleixner , LKML , kernel-janitors@vger.kernel.org, Julia Lawall On Wed, 2016-09-07 at 09:23 -0700, Kees Cook wrote: > Fixing these kmalloc calls would be a nice thing to clean up > everywhere. Dubious as gcc cannot currently optimize known small fixed size allocations with alloc_array and will always perform the multiplication. Also the style of sizeof(*ptr) is not always as clear, obvious nor as easy to grep as sizeof(type).