From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B00FCA9EB6 for ; Wed, 23 Oct 2019 08:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB5DB205C9 for ; Wed, 23 Oct 2019 08:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390500AbfJWIzn (ORCPT ); Wed, 23 Oct 2019 04:55:43 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:12734 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387829AbfJWIzn (ORCPT ); Wed, 23 Oct 2019 04:55:43 -0400 X-IronPort-AV: E=Sophos;i="5.68,220,1569276000"; d="scan'208";a="323927878" Received: from unknown (HELO hadrien) ([154.43.32.124]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2019 10:55:40 +0200 Date: Wed, 23 Oct 2019 10:55:39 +0200 (CEST) From: Julia Lawall X-X-Sender: julia@hadrien To: zhongshiqi cc: Julia.Lawall@lip6.fr, Gilles Muller , nicolas.palix@imag.fr, michal.lkml@markovi.net, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn, wang.yi59@zte.com.cn, cheng.shengyu@zte.com.cn, yamada.masahiro@socionext.com Subject: Re: [PATCH] Configuring COCCI parameter as a directory is supportted In-Reply-To: <1571819563-18118-1-git-send-email-zhong.shiqi@zte.com.cn> Message-ID: References: <1571819563-18118-1-git-send-email-zhong.shiqi@zte.com.cn> 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 Wed, 23 Oct 2019, zhongshiqi wrote: > This patch puts a modification in scripts/coccicheck which supports users > in configuring COCCI parameter as a directory to traverse files in > directory. > > Signed-off-by: zhongshiqi > --- > scripts/coccicheck | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index e04d328..a1c4197 100755 > --- a/scripts/coccicheck > +++ b/scripts/coccicheck > @@ -257,6 +257,10 @@ if [ "$COCCI" = "" ] ; then > for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do > coccinelle $f > done > +elif [ -d "$COCCI" ] ; then > + for f in `find $COCCI/ -name '*.cocci' -type f | sort`; do > + coccinelle $f > + done > else > coccinelle $COCCI > fi Thanks for the contribution. I'm not that knowledgeable about these scripts. What is the relation between the last two if branches? If the first one fails, does that mean that $COCCI has no definition? In that case, is the final else useful? thanks, julia