From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752057AbcF2WLN (ORCPT ); Wed, 29 Jun 2016 18:11:13 -0400 Received: from mail.kernel.org ([198.145.29.136]:39928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751703AbcF2WLJ (ORCPT ); Wed, 29 Jun 2016 18:11:09 -0400 From: "Luis R. Rodriguez" To: Julia.Lawall@lip6.fr, nicolas.palix@imag.fr, Gilles.Muller@lip6.fr, mmarek@suse.com Cc: akpm@linux-foundation.org, gregkh@linuxfoundation.org, markivx@codeaurora.org, stephen.boyd@linaro.org, zohar@linux.vnet.ibm.com, broonie@kernel.org, ming.lei@canonical.com, tiwai@suse.d, johannes@sipsolutions.net, chunkeey@googlemail.com, hauke@hauke-m.de, jwboyer@fedoraproject.org, dmitry.torokhov@gmail.com, dwmw2@infradead.org, jslaby@suse.com, torvalds@linux-foundation.org, deepa.kernel@gmail.com, keescook@chromium.org, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Subject: [RFC v4 2/9] coccicheck: make SPFLAGS more useful Date: Wed, 29 Jun 2016 15:10:19 -0700 Message-Id: <1467238226-10822-3-git-send-email-mcgrof@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1467238226-10822-1-git-send-email-mcgrof@kernel.org> References: <1467238226-10822-1-git-send-email-mcgrof@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SPFLAGS is set early, it means that any heuristics done on coccicheck cannot be overridden currently. Move SPFLAGS after OPTIONS and set this at the end. This lets you override any heuristics as coccinelle treats conflicts by only listening to the last option that makes sense. v3: this patch was added in the v3 series v4: Update Documentation/coccinelle.txt explaining how SPFLAGS works as well. Signed-off-by: Luis R. Rodriguez Acked-by: Nicolas Palix --- Documentation/coccinelle.txt | 3 ++- scripts/coccicheck | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt index 7f773d51fdd9..bb9632c20cfb 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/coccinelle.txt @@ -146,7 +146,8 @@ MODE variable explained above. ~~~~~~~~~~~~~~~~~~ Additional flags can be passed to spatch through the SPFLAGS -variable. +variable. This works as Coccinelle respects the last flags +given to it when options are in conflict. make SPFLAGS=--use-glimpse coccicheck make SPFLAGS=--use-idutils coccicheck diff --git a/scripts/coccicheck b/scripts/coccicheck index f137b04dfdd3..5319fae910b4 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -30,7 +30,7 @@ else NPROC="$J" fi -FLAGS="--very-quiet $SPFLAGS" +FLAGS="--very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" @@ -106,6 +106,9 @@ kill_running() { done } +# You can override heuristics with SPFLAGS, these must always go last +OPTIONS="$OPTIONS $SPFLAGS" + coccinelle () { COCCI="$1" -- 2.8.4