Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8285740ybn; Tue, 1 Oct 2019 06:07:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDgXWmOX5v6hbAKE2rcOnrhQSvNRjFw1mpEpWqX6Fv/fRVW3upEnsOx6fe2WLSMGwef6WO X-Received: by 2002:a17:906:7f03:: with SMTP id d3mr23513680ejr.115.1569935226524; Tue, 01 Oct 2019 06:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569935226; cv=none; d=google.com; s=arc-20160816; b=rrKxT1A/Rvl74bLHg9mhHBp26gHiOanhY7qdNZQRvOIRBBbOIoyOeuLpL2GxKEWReu KT7CTiDa9j4UiaJ4CbZKGHFXVNswcxZtbywtaDInVrF80x9m7U45zh0NrAw9fzjrfLC/ DHdiSHyNYS837elLbR+qEzqry+xpYuX5yhpIHuBV8UaW/eC21zrg9fmkVq4KiYS/kkvx JTtA6prmrkaXcJ2I6PztQSgcLNeD3Ozlbf4hWeNKUwc2JyOwf63dAPdTfoJG0/rfVcUG yLzyoxujImzk4ismfrx8W4HR04eqKGhsdo//Z9ef5GbOwKB0nwShuVTvxo0zrJ+al3IU Owyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=ygRPHkWCIc0XXMAxUKi5GjKdFZB+Lb9pDq8eWbyzgNI=; b=XOFVIsoyKI2jUwxKG13AMFL5wNRiHk/Mk1m9lhKqb1PaTtDrL3rDYtZmAZWf5YMnFF T+EbAL1sIGhP2yRWZk2ujsMXnKHSfSaWT2VboTqrR0oUB5FX8AO5mwnHWUmDmyn2+e1h sE7eotCczNL6bjNf2FDhu3wskhuSiOSh/0H1HA1qnhasTrWI8i/MQm2a1z+df5QhbUC/ +84l2w/yPnNId0T4i/YfmeyjLblp5i+5Mj/spgemWmLstU3HkmsLsL1elXBEDlJQQTRB GUr8Eo6zJkOKLCApNkPcSeuSllmJhwGy98IeK6/PmUJiHxykKdHqk7EFQ8ysLClT+7fV Qhlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c60si9409197edd.327.2019.10.01.06.06.38; Tue, 01 Oct 2019 06:07:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387704AbfJANBJ (ORCPT + 99 others); Tue, 1 Oct 2019 09:01:09 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:35878 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbfJANBJ (ORCPT ); Tue, 1 Oct 2019 09:01:09 -0400 X-IronPort-AV: E=Sophos;i="5.64,571,1559512800"; d="scan'208";a="404191967" Received: from portablejulia.rsr.lip6.fr ([132.227.76.63]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 15:01:06 +0200 Date: Tue, 1 Oct 2019 15:01:06 +0200 (CEST) From: Julia Lawall X-X-Sender: julia@hadrien To: Yuehaibing cc: Julia Lawall , Gilles Muller , nicolas.palix@imag.fr, michal.lkml@markovi.net, maennich@google.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr Subject: Re: [RFC PATCH] scripts: Fix coccicheck failed In-Reply-To: Message-ID: References: <20190928094245.45696-1-yuehaibing@huawei.com> <2c109d6b-45ad-b3ca-1951-bde4dac91d2a@huawei.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Sep 2019, Yuehaibing wrote: > On 2019/9/30 0:32, Julia Lawall wrote: > > > > > > On Sun, 29 Sep 2019, Yuehaibing wrote: > > > >> On 2019/9/28 20:43, Julia Lawall wrote: > >>> > >>> > >>> On Sat, 28 Sep 2019, YueHaibing wrote: > >>> > >>>> Run make coccicheck, I got this: > >>>> > >>>> spatch -D patch --no-show-diff --very-quiet --cocci-file > >>>> ./scripts/coccinelle/misc/add_namespace.cocci --dir . > >>>> -I ./arch/x86/include -I ./arch/x86/include/generated > >>>> -I ./include -I ./arch/x86/include/uapi > >>>> -I ./arch/x86/include/generated/uapi -I ./include/uapi > >>>> -I ./include/generated/uapi --include ./include/linux/kconfig.h > >>>> --jobs 192 --chunksize 1 > >>>> > >>>> virtual rule patch not supported > >>>> coccicheck failed > >>>> > >>>> It seems add_namespace.cocci cannot be called in coccicheck. > >>> > >>> Could you explain the issue better? Does the current state cause make > >>> coccicheck to fail? Or is it just silently not being called? > >> > >> Yes, it cause make coccicheck failed like this: > >> > >> ... > >> ./drivers/xen/xenbus/xenbus_comms.c:290:2-8: preceding lock on line 243 > >> ./fs/fuse/dev.c:1227:2-8: preceding lock on line 1206 > >> ./fs/fuse/dev.c:1232:3-9: preceding lock on line 1206 > >> coccicheck failed > >> make[1]: *** [coccicheck] Error 255 > >> make: *** [sub-make] Error 2 > > > > Could you set the verbose options to see what the problem is? Maybe the > > problem would be solved by putting virtual report at the top of the rule. > > But it might still fail because nothing can happen without a value for the > > virtual metavariable ns. > > diff --git a/scripts/coccinelle/misc/add_namespace.cocci b/scripts/coccinelle/misc/add_namespace.cocci > index c832bb6445a8..99e93a6c2e24 100644 > --- a/scripts/coccinelle/misc/add_namespace.cocci > +++ b/scripts/coccinelle/misc/add_namespace.cocci > @@ -6,6 +6,8 @@ > /// add a missing namespace tag to a module source file. > /// > > +virtual report > + > @has_ns_import@ > declarer name MODULE_IMPORT_NS; > identifier virtual.ns; > > > > Adding virtual report make the coccicheck go ahead smoothly. Acked-by: Julia Lawall Thanks. > > > > > Should the coccinelle directory be only for things that work with make > > coccicheck, or for all Coccinelle scripts? > > > > julia > > > > . > > > >