linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] coccicheck: Allow for overriding spatch flags
@ 2016-06-12 19:04 Deepa Dinamani
  2016-06-12 19:16 ` Julia Lawall
  2016-06-12 21:38 ` Nicolas Palix (LIG)
  0 siblings, 2 replies; 9+ messages in thread
From: Deepa Dinamani @ 2016-06-12 19:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: Arnd Bergmann, Julia Lawall, Gilles Muller, Nicolas Palix, Michal Marek

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.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>
Cc: Nicolas Palix <nicolas.palix@imag.fr>
Cc: Michal Marek <mmarek@suse.com>
---
 scripts/coccicheck | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index dd85a45..f662786 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -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
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 19:04 [PATCH] coccicheck: Allow for overriding spatch flags Deepa Dinamani
@ 2016-06-12 19:16 ` Julia Lawall
  2016-06-12 20:32   ` Deepa Dinamani
  2016-06-12 21:38 ` Nicolas Palix (LIG)
  1 sibling, 1 reply; 9+ messages in thread
From: Julia Lawall @ 2016-06-12 19:16 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: linux-kernel, Arnd Bergmann, Gilles Muller, Nicolas Palix, Michal Marek



On Sun, 12 Jun 2016, Deepa Dinamani wrote:

> 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.

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


> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> Cc: Gilles Muller <Gilles.Muller@lip6.fr>
> Cc: Nicolas Palix <nicolas.palix@imag.fr>
> Cc: Michal Marek <mmarek@suse.com>
> ---
>  scripts/coccicheck | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index dd85a45..f662786 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -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
> -- 
> 1.9.1
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 19:16 ` Julia Lawall
@ 2016-06-12 20:32   ` Deepa Dinamani
  2016-06-12 20:39     ` Julia Lawall
  0 siblings, 1 reply; 9+ messages in thread
From: Deepa Dinamani @ 2016-06-12 20:32 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Linux Kernel Mailing List, Arnd Bergmann, Gilles Muller,
	Nicolas Palix, Michal Marek

>> 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.
>
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 20:32   ` Deepa Dinamani
@ 2016-06-12 20:39     ` Julia Lawall
  2016-06-12 21:08       ` Deepa Dinamani
  0 siblings, 1 reply; 9+ messages in thread
From: Julia Lawall @ 2016-06-12 20:39 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Julia Lawall, Linux Kernel Mailing List, Arnd Bergmann,
	Gilles Muller, Nicolas Palix, Michal Marek

On Sun, 12 Jun 2016, Deepa Dinamani wrote:

> >> 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.
> >
> > 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?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 20:39     ` Julia Lawall
@ 2016-06-12 21:08       ` Deepa Dinamani
  2016-06-12 21:09         ` Julia Lawall
  0 siblings, 1 reply; 9+ messages in thread
From: Deepa Dinamani @ 2016-06-12 21:08 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Linux Kernel Mailing List, Arnd Bergmann, Gilles Muller,
	Nicolas Palix, Michal Marek

>> >> 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.
>> >
>> > 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?
>
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 21:08       ` Deepa Dinamani
@ 2016-06-12 21:09         ` Julia Lawall
  0 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2016-06-12 21:09 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Linux Kernel Mailing List, Arnd Bergmann, Gilles Muller,
	Nicolas Palix, Michal Marek



On Sun, 12 Jun 2016, Deepa Dinamani wrote:

> >> >> 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.
> >> >
> >> > 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?
> >
> > 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.

I think it doesn't hurt anything, if Nicolas is OK with it.

Thanks for noticing the --very-quiet issue.

julia

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 19:04 [PATCH] coccicheck: Allow for overriding spatch flags Deepa Dinamani
  2016-06-12 19:16 ` Julia Lawall
@ 2016-06-12 21:38 ` Nicolas Palix (LIG)
  2016-06-12 21:45   ` Julia Lawall
  1 sibling, 1 reply; 9+ messages in thread
From: Nicolas Palix (LIG) @ 2016-06-12 21:38 UTC (permalink / raw)
  To: Deepa Dinamani, linux-kernel
  Cc: Arnd Bergmann, Julia Lawall, Gilles Muller, Michal Marek

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

Le 12/06/16 à 21:04, Deepa Dinamani a écrit :
> 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.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> Cc: Gilles Muller <Gilles.Muller@lip6.fr>
> Cc: Nicolas Palix <nicolas.palix@imag.fr>
Acked-By: Nicolas Palix <nicolas.palix@imag.fr>
> Cc: Michal Marek <mmarek@suse.com>
> ---
>  scripts/coccicheck | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index dd85a45..f662786 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -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
>


-- 
Nicolas Palix
http://lig-membres.imag.fr/palix/


[-- Attachment #2: Signature cryptographique S/MIME --]
[-- Type: application/pkcs7-signature, Size: 2959 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 21:38 ` Nicolas Palix (LIG)
@ 2016-06-12 21:45   ` Julia Lawall
  2016-06-20 20:21     ` Michal Marek
  0 siblings, 1 reply; 9+ messages in thread
From: Julia Lawall @ 2016-06-12 21:45 UTC (permalink / raw)
  To: Nicolas Palix (LIG)
  Cc: Deepa Dinamani, linux-kernel, Arnd Bergmann, Julia Lawall,
	Gilles Muller, Michal Marek

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1787 bytes --]



On Sun, 12 Jun 2016, Nicolas Palix (LIG) wrote:

> Le 12/06/16 à 21:04, Deepa Dinamani a écrit :
> > 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.
> > 
> > Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> > Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> > Cc: Gilles Muller <Gilles.Muller@lip6.fr>
> > Cc: Nicolas Palix <nicolas.palix@imag.fr>
> Acked-By: Nicolas Palix <nicolas.palix@imag.fr>

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

> > Cc: Michal Marek <mmarek@suse.com>
> > ---
> >  scripts/coccicheck | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/coccicheck b/scripts/coccicheck
> > index dd85a45..f662786 100755
> > --- a/scripts/coccicheck
> > +++ b/scripts/coccicheck
> > @@ -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
> > 
> 
> 
> -- 
> Nicolas Palix
> http://lig-membres.imag.fr/palix/
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] coccicheck: Allow for overriding spatch flags
  2016-06-12 21:45   ` Julia Lawall
@ 2016-06-20 20:21     ` Michal Marek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Marek @ 2016-06-20 20:21 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Nicolas Palix (LIG),
	Deepa Dinamani, linux-kernel, Arnd Bergmann, Gilles Muller

On Sun, Jun 12, 2016 at 11:45:57PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 12 Jun 2016, Nicolas Palix (LIG) wrote:
> 
> > Le 12/06/16 à 21:04, Deepa Dinamani a écrit :
> > > 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.
> > > 
> > > Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> > > Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> > > Cc: Gilles Muller <Gilles.Muller@lip6.fr>
> > > Cc: Nicolas Palix <nicolas.palix@imag.fr>
> > Acked-By: Nicolas Palix <nicolas.palix@imag.fr>
> 
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>

Applied to kbuild.git#misc.

Michal

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-06-20 20:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12 19:04 [PATCH] coccicheck: Allow for overriding spatch flags Deepa Dinamani
2016-06-12 19:16 ` Julia Lawall
2016-06-12 20:32   ` Deepa Dinamani
2016-06-12 20:39     ` Julia Lawall
2016-06-12 21:08       ` Deepa Dinamani
2016-06-12 21:09         ` Julia Lawall
2016-06-12 21:38 ` Nicolas Palix (LIG)
2016-06-12 21:45   ` Julia Lawall
2016-06-20 20:21     ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).