X-GM-THRID: 6264136808663089152 X-Received: by 10.25.18.101 with SMTP id h98mr2240197lfi.0.1458489117801; Sun, 20 Mar 2016 08:51:57 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.28.174.145 with SMTP id x139ls472977wme.10.gmail; Sun, 20 Mar 2016 08:51:57 -0700 (PDT) X-Received: by 10.28.6.14 with SMTP id 14mr932824wmg.6.1458489117179; Sun, 20 Mar 2016 08:51:57 -0700 (PDT) Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id c7si230880wmf.2.2016.03.20.08.51.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2016 08:51:57 -0700 (PDT) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.24,366,1454972400"; d="scan'208";a="209053472" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Mar 2016 16:51:56 +0100 Date: Sun, 20 Mar 2016 16:51:55 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: sandhya bankar cc: outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH 3/3] Staging: lustre: o2iblnd: Correct the argument of sizeof(). In-Reply-To: Message-ID: References: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1499410242-1458489115=:2597" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1499410242-1458489115=:2597 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 20 Mar 2016, sandhya bankar wrote: > To prepare this patch i have used following cocci file. > Description mentioned below: > > @disable sizeof_type_expr@ > type T; > T **x; > @@ > >   x = >   <+...sizeof( > - T  > + *x >   )...+> > > whose description is as below: >   > badty/badty.cocci -  Correct the size argument to kzalloc > >     obj has type struct snmp_object **, not struct snmp_object *.  But > indeed >     it is not even clear why kmalloc is needed.  The memory is freed by the > end >     of the function, so the local variable of pointer type should be > sufficient. > > that's why i have used "Correct" word in heading. > Please let me know if patch v2 is required with different heading? You need to understand what the semantic patch is doing, and explain what the transformed code does and why it is wrong. I guess that this semantic patch comes from coccinellery. The descriptions there are autogenerated from a patch that uses the given semantic patch. In this case, the coccinellery description is not useful. julia --8323329-1499410242-1458489115=:2597--