From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815AbdL2Rte (ORCPT ); Fri, 29 Dec 2017 12:49:34 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:17956 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbdL2Rtc (ORCPT ); Fri, 29 Dec 2017 12:49:32 -0500 X-IronPort-AV: E=Sophos;i="5.45,477,1508796000"; d="scan'208";a="249697118" Date: Fri, 29 Dec 2017 18:49:31 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Masahiro Yamada cc: Himanshu Jha , Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr, Linux Kernel Mailing List Subject: Re: [PATCH v2] Coccinelle: kzalloc-simple: Add all zero allocating functions In-Reply-To: Message-ID: References: <1514324410-14561-1-git-send-email-himanshujha199640@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 30 Dec 2017, Masahiro Yamada wrote: > 2017-12-27 6:40 GMT+09:00 Himanshu Jha : > > There are many instances where memory is allocated using regular > > allocator > > functions immediately followed by setting the allocated memory > > to 0 value using memset. > > > > We already have zero memory allocator functions to set the memory to > > 0 value instead of manually setting it using memset. > > > > Therefore, use zero memory allocating functions instead of regular > > memory allocators followed by memset 0 to remove redundant memset and > > make the code more cleaner and also reduce the code size. > > > > Signed-off-by: Himanshu Jha > > --- > > > > v2: > > -fix typo in copyright. > > -move all the (T *) disjunction cases before (T) as (T) matches any cast > > at all including (T *) ones which is not desirable. > > > > ... > > > +@script:python depends on report@ > > +p << r9.p; > > +x << r9.x; > > +@@ > > + > > +msg="WARNING: kvzalloc_node should be used for %s, instead of kvmalloc_node/memset" % (x) > > +coccilib.report.print_report(p[0], msg) > > + > > > I removed the blank line at EOF, > then applied to linux-kbuild/misc. Thanks! Thanks! julia