Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6404499ybn; Sun, 29 Sep 2019 19:34:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8iu73XlSBu4pOUGDB0d+mbkADxU1P0qo8FzgPdql7wzqLt6bVMU2nHUq0ok4jjzc/TNQ2 X-Received: by 2002:a50:8933:: with SMTP id e48mr17050234ede.51.1569810899233; Sun, 29 Sep 2019 19:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569810899; cv=none; d=google.com; s=arc-20160816; b=hcMWY4qbORZ+GfH4R0b3ihOdWnO/VssRZuPJ+HfBp71BRCoYR3o1EvAuTQqNrsqb1H mlGFTwe8OH3rjQkK2gOYCVbieEw3aBV/kV4Uccx8ZHfWlZPX1XSOjst6f5/4akAM7qzv Frv9K9rCJRVHAwgdndzYlRLE+0JtKBpAwgthfbBg9iTu/jBiLfBv1hTY9WrSP/Lt5ZKr I99kGiqapHUrMmaQyP2yjmIbFg/de3les3HQpBvO9in4QV8Yir3Nqwm18tgGLsB4OrBo CAuRgYV1uFifgFhW2BLhrhypeo82IQe0JtpBMbkw26dV/f4F6eMINdLfzG7CsPOVcjSD M4yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=+u/Zy4C62h9igbgHHmZx5uWLvwZcHv+uuy2jmkopMqw=; b=ywInh9OyCNPb2mfPtj8U7ng9+RNKcIVI0FA6GQblYE5oPLKtCdKs+n/SnvDG3Lvp6W bTO3f+Ms6KIdRRamgagw8V3Hywdb7EUn99VBIb5eXhKzrBvn9jP916cbVraK+ZtdVrfe MSXKh6wwzR7tG6dNhWZzlBCSsAtDhFZ9Vg0nlgAJGXWGPp8EQS8oMhkb0VD8yCqfjvTx 7pwKLd8Vv72DR5VGZWlG3gU3T4lQhtTTgVqvsZ7GDmhteP+IhTL30rkHX47N8yZfN8aQ VojfSQ+DpO43uB+TdBj/4wRoLAqPgF9zsirkFfaigeDTvOaCsYX4tgMJfKWo1LTC02yK L+lg== 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 j21si6004200edr.376.2019.09.29.19.34.32; Sun, 29 Sep 2019 19:34:59 -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 S1729302AbfI3Cc0 (ORCPT + 99 others); Sun, 29 Sep 2019 22:32:26 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3175 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726360AbfI3Cc0 (ORCPT ); Sun, 29 Sep 2019 22:32:26 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 68D437E31D355E6E3DF1; Mon, 30 Sep 2019 10:32:23 +0800 (CST) Received: from [127.0.0.1] (10.133.213.239) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Mon, 30 Sep 2019 10:32:19 +0800 Subject: Re: [RFC PATCH] scripts: Fix coccicheck failed To: Julia Lawall References: <20190928094245.45696-1-yuehaibing@huawei.com> <2c109d6b-45ad-b3ca-1951-bde4dac91d2a@huawei.com> CC: Gilles Muller , , , , , , From: Yuehaibing Message-ID: Date: Mon, 30 Sep 2019 10:32:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Should the coccinelle directory be only for things that work with make > coccicheck, or for all Coccinelle scripts? > > julia > > . >