coccicheck: Allow for overriding spatch flags
PATCH 1/1 coccicheck: Allow for overriding spatch flags
Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.
Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
--- scripts/coccicheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/coccicheck +2 -2
@@ -25,7 +25,7 @@ else NPROC="$J" fi -FLAGS="$SPFLAGS --very-quiet" +FLAGS="--very-quiet $SPFLAGS" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include"
@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then echo 'All available modes will be tried (in that order): patch, report, context, org' fi elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then - FLAGS="$FLAGS --no-show-diff" + FLAGS="--no-show-diff $FLAGS" fi if [ "$ONLINE" = "0" ] ; then
Signature · 1 line
1.9.1
Quoted 10 lines · Deepa Dinamani
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.
thanks,
julia
Quoted 35 lines
Signed-off-by Deepa Dinamani <[email protected]>Cc Julia Lawall <[email protected]>Cc Gilles Muller <[email protected]>Cc Nicolas Palix <[email protected]>Cc Michal Marek <[email protected]>--- scripts/coccicheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)scripts/coccicheck +2
-2@@ -25,7 +25,7 @@ else NPROC="$J" fi -FLAGS="$SPFLAGS --very-quiet" +FLAGS="--very-quiet $SPFLAGS" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include"@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then echo 'All available modes will be tried (in that order): patch, report, context, org' fi elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then - FLAGS="$FLAGS --no-show-diff" + FLAGS="--no-show-diff $FLAGS" fi if [ "$ONLINE" = "0" ] ; thenSignature · 1 line
1.9.1
Quoted 11 lines
Quoted 10 lines
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
Quoted 5 lines
The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.
I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?
-Deepa
Quoted 17 lines · Deepa Dinamani
Quoted 11 lines
Quoted 10 lines
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
Quoted 5 lines
The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.
Quoted 3 lines
I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?
I guess... Another issue is that the org/report mode output comes from python, and the diff output comes from ocaml. They are not synchronized. Ie, the report won't come out next to the relevant diff.
julia
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 10 lines
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.
Quoted 7 lines
Quoted 3 lines
I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?
I guess... Another issue is that the org/report mode output comes from python, and the diff output comes from ocaml. They are not synchronized. Ie, the report won't come out next to the relevant diff.
Ok. I was just thinking of user as the final authority because I was trying to get more
debug output for my script. And, yes I only wanted to override the --very-quiet. I just thought since --no-show-diff was a similar issue, it would be good to do the
same thing here.
Let me know if you want me to leave out the second rearrange and submit a v2.
-Deepa
Quoted 25 lines · Deepa Dinamani
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 10 lines
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.
Quoted 7 lines
Quoted 3 lines
I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?
I guess... Another issue is that the org/report mode output comes from python, and the diff output comes from ocaml. They are not synchronized. Ie, the report won't come out next to the relevant diff.
Quoted 8 lines
Ok. I was just thinking of user as the final authority because I was trying to get more
debug output for my script. And, yes I only wanted to override the --very-quiet. I just thought since --no-show-diff was a similar issue, it would be good to do the
same thing here.Let me know if you want me to leave out the second rearrange and submit a v2.
I think it doesn't hurt anything, if Nicolas is OK with it.
Thanks for noticing the --very-quiet issue.
julia
Quoted 7 lines · Deepa Dinamani
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Quoted 8 lines
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
Signed-off-by Deepa Dinamani <[email protected]>Cc Julia Lawall <[email protected]>Cc Gilles Muller <[email protected]>Cc Nicolas Palix <[email protected]>
Quoted 28 lines
Cc Michal Marek <[email protected]>--- scripts/coccicheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)scripts/coccicheck +2
-2@@ -25,7 +25,7 @@ else NPROC="$J" fi -FLAGS="$SPFLAGS --very-quiet" +FLAGS="--very-quiet $SPFLAGS" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include"@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then echo 'All available modes will be tried (in that order): patch, report, context, org' fi elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then - FLAGS="$FLAGS --no-show-diff" + FLAGS="--no-show-diff $FLAGS" fi if [ "$ONLINE" = "0" ] ; then
Signature · 2 lines
Nicolas Palix http://lig-membres.imag.fr/palix/
Julia Lawall
Acked-byQuoted 12 lines · Nicolas Palix (LIG)
Quoted 11 lines · Deepa Dinamani
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
Quoted 5 lines
Quoted 4 lines
Signed-off-by Deepa Dinamani <[email protected]>Cc Julia Lawall <[email protected]>Cc Gilles Muller <[email protected]>Cc Nicolas Palix <[email protected]>Acked-by Nicolas Palix <[email protected]>
Quoted 36 lines
Quoted 29 lines
Cc Michal Marek <[email protected]>--- scripts/coccicheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)scripts/coccicheck +1
-1@@ -25,7 +25,7 @@ else NPROC="$J" fi -FLAGS="$SPFLAGS --very-quiet" +FLAGS="--very-quiet $SPFLAGS" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include"@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then echo 'All available modes will be tried (in that order): patch,report, context, org'
fi
elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; thenscripts/coccicheck +1
-1- FLAGS="$FLAGS --no-show-diff" + FLAGS="--no-show-diff $FLAGS" fi if [ "$ONLINE" = "0" ] ; thenSignature · 2 lines
Nicolas Palix http://lig-membres.imag.fr/palix/
Quoted 16 lines · Julia Lawall
Quoted 12 lines · Nicolas Palix (LIG)
Quoted 11 lines · Deepa Dinamani
Documentation/coccinelle.txtsuggests using the SPFLAGS make variable to pass additional options to spatch.Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.
Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Signed-off-by Deepa Dinamani <[email protected]>Cc Julia Lawall <[email protected]>Cc Gilles Muller <[email protected]>Cc Nicolas Palix <[email protected]>Acked-by Nicolas Palix <[email protected]>Acked-by Julia Lawall <[email protected]>
Applied to kbuild.git#misc.
Michal