From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757354AbcIGLU0 (ORCPT ); Wed, 7 Sep 2016 07:20:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52940 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbcIGLUZ (ORCPT ); Wed, 7 Sep 2016 07:20:25 -0400 Subject: Re: x86-ksysfs: Use kmalloc_array() in create_setup_data_nodes() To: SF Markus Elfring References: <3b21b2d7-9856-009c-9bd1-3a76a83bc7fc@users.sourceforge.net> Cc: Kees Cook , Ingo Molnar , "x86@kernel.org" , Dave Young , "H. Peter Anvin" , Matt Fleming , Thomas Gleixner , LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: Paolo Bonzini Message-ID: <3eea073a-b271-54b7-1eec-e841e0f4bdf9@redhat.com> Date: Wed, 7 Sep 2016 13:20:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 07 Sep 2016 11:20:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/09/2016 13:17, SF Markus Elfring wrote: >>> Are you looking for further possibilities to improve the involved >>> source code search patterns? >> >> Why are you not answering the simple question that was asked? > > I find that I answered it to some degree. > > It can be that you do not really like the kind of answer that I chose > a moment ago. > But I guess that a more pleasing (and complete) answer can become > another software development challenge as you might know already. > > Would the following script (for the semantic patch language) > be useful enough for further development considerations? > > usage_of_kmalloc_array1-excerpt2.cocci: > @replacement2@ > expression count, pointer, target; > @@ > target = > - kmalloc(sizeof(*pointer) * (count) > + kmalloc_array(count, sizeof(*pointer) > , ...); Why don't you include the _exact_ script that you run? That's the only possible correct answer. Paolo