From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751573AbdL2R2F convert rfc822-to-8bit (ORCPT ); Fri, 29 Dec 2017 12:28:05 -0500 Received: from blatinox.fr ([51.254.120.209]:47844 "EHLO vps202351.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751152AbdL2R2E (ORCPT ); Fri, 29 Dec 2017 12:28:04 -0500 Date: Fri, 29 Dec 2017 18:28:00 +0100 From: =?UTF-8?B?SsOpcsOpbXk=?= Lefaure To: Julia Lawall Cc: Michal Marek , Gilles Muller , Nicolas Palix , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] Coccinelle: array_size: report even if include is missing Message-ID: <20171229182800.6c44a81e@jeremy-laptop> In-Reply-To: References: <20170914023807.12972-1-jeremy.lefaure@lse.epita.fr> X-Mailer: Claws Mail 3.15.1-3-g4ac168-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 14 Sep 2017 13:21:13 +0200 (CEST) Julia Lawall wrote: > On Wed, 13 Sep 2017, Jérémy Lefaure wrote: > > > Rule r does not depend on rule i (which is the include of > > linux/kernel.h) so the output should not depend on i in > > org and report mode. > > > > Signed-off-by: Jérémy Lefaure > > Acked-by: Julia Lawall > > I guess that if the incude is missing, the person updating the code can > always add it. > I don't see this patch upstream, is it lost somewhere or should I send it to someone else ? > > > --- > > > > I have tested this patch in report mode on the file > > drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_rf.c which does not > > use ARRAY_SIZE and does not include linux/kernel.h. > > > > scripts/coccinelle/misc/array_size.cocci | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/scripts/coccinelle/misc/array_size.cocci b/scripts/coccinelle/misc/array_size.cocci > > index 6ec05710b017..09520f0941f0 100644 > > --- a/scripts/coccinelle/misc/array_size.cocci > > +++ b/scripts/coccinelle/misc/array_size.cocci > > @@ -72,13 +72,13 @@ position p; > > (sizeof(E)@p /sizeof(T)) > > ) > > > > -@script:python depends on i&&org@ > > +@script:python depends on org@ > > p << r.p; > > @@ > > > > coccilib.org.print_todo(p[0], "WARNING should use ARRAY_SIZE") > > > > -@script:python depends on i&&report@ > > +@script:python depends on report@ > > p << r.p; > > @@ > > > > -- > > 2.14.1 > > > >