From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754863AbcIEHx0 (ORCPT ); Mon, 5 Sep 2016 03:53:26 -0400 Received: from merlin.infradead.org ([205.233.59.134]:57386 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754010AbcIEHxZ (ORCPT ); Mon, 5 Sep 2016 03:53:25 -0400 Date: Mon, 5 Sep 2016 09:53:05 +0200 From: Peter Zijlstra To: SF Markus Elfring Cc: x86@kernel.org, Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , Richard Cochran , Stephane Eranian , Thomas Gleixner , Tony Luck , Vikas Shivappa , LKML , kernel-janitors@vger.kernel.org, Julia Lawall , Paolo Bonzini Subject: Re: [PATCH 2/4] perf/x86/cqm: Replace two kmalloc() calls by kmalloc_array() in intel_mbm_init() Message-ID: <20160905075305.GS10153@twins.programming.kicks-ass.net> References: <566ABCD9.1060404@users.sourceforge.net> <9d893198-dd12-14a8-74bd-02fc42de4bf4@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 04, 2016 at 07:56:30PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 4 Sep 2016 18:25:09 +0200 > > 1. A multiplication for the size determination of memory allocations > indicated that array data structures should be processed. > Thus use the corresponding function "kmalloc_array". > > 2. Replace the specification of a data structure by pointer dereferences > to make the corresponding size determination a bit safer according to > the Linux coding style convention. > > 3. Delete the local variable "array_size" which became unnecessary > with this refactoring. 3 is an admission you made the code worse in absense of other improvements.