Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1420309 > unrolled thread

[PATCH] coccicheck: Allow for overriding spatch flags

Started byDeepa Dinamani <deepa.kernel@gmail.com>
First post2016-06-12 21:10 +0200
Last post2016-06-20 22:40 +0200
Articles 9 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] coccicheck: Allow for overriding spatch flags Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-12 21:10 +0200
    Re: [PATCH] coccicheck: Allow for overriding spatch flags Julia Lawall <julia.lawall@lip6.fr> - 2016-06-12 21:20 +0200
      Re: [PATCH] coccicheck: Allow for overriding spatch flags Julia Lawall <julia.lawall@lip6.fr> - 2016-06-12 22:40 +0200
        Re: [PATCH] coccicheck: Allow for overriding spatch flags Julia Lawall <julia.lawall@lip6.fr> - 2016-06-12 23:10 +0200
        Re: [PATCH] coccicheck: Allow for overriding spatch flags Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-12 23:10 +0200
      Re: [PATCH] coccicheck: Allow for overriding spatch flags Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-12 22:40 +0200
    Re: [PATCH] coccicheck: Allow for overriding spatch flags "Nicolas Palix (LIG)" <Nicolas.Palix@imag.fr> - 2016-06-12 23:40 +0200
      Re: [PATCH] coccicheck: Allow for overriding spatch flags Julia Lawall <julia.lawall@lip6.fr> - 2016-06-12 23:50 +0200
        Re: [PATCH] coccicheck: Allow for overriding spatch flags Michal Marek <mmarek@suse.com> - 2016-06-20 22:40 +0200

#1420309 — [PATCH] coccicheck: Allow for overriding spatch flags

FromDeepa Dinamani <deepa.kernel@gmail.com>
Date2016-06-12 21:10 +0200
Subject[PATCH] coccicheck: Allow for overriding spatch flags
Message-ID<rJiVH-46O-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1420310

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-06-12 21:20 +0200
Message-ID<rJj5n-4ae-5@gated-at.bofh.it>
In reply to#1420309

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

[toc] | [prev] | [next] | [standalone]


#1420322

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-06-12 22:40 +0200
Message-ID<rJkkN-4Rf-3@gated-at.bofh.it>
In reply to#1420310
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

[toc] | [prev] | [next] | [standalone]


#1420327

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-06-12 23:10 +0200
Message-ID<rJkNP-5fY-9@gated-at.bofh.it>
In reply to#1420322

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

[toc] | [prev] | [next] | [standalone]


#1420329

FromDeepa Dinamani <deepa.kernel@gmail.com>
Date2016-06-12 23:10 +0200
Message-ID<rJkNP-5fY-11@gated-at.bofh.it>
In reply to#1420322
>> >> 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

[toc] | [prev] | [next] | [standalone]


#1420323

FromDeepa Dinamani <deepa.kernel@gmail.com>
Date2016-06-12 22:40 +0200
Message-ID<rJkkN-4Rf-5@gated-at.bofh.it>
In reply to#1420310
>> 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

[toc] | [prev] | [next] | [standalone]


#1420351

From"Nicolas Palix (LIG)" <Nicolas.Palix@imag.fr>
Date2016-06-12 23:40 +0200
Message-ID<rJlgT-5q8-49@gated-at.bofh.it>
In reply to#1420309

[Multipart message — attachments visible in raw view] — view raw

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/

[toc] | [prev] | [next] | [standalone]


#1420378

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-06-12 23:50 +0200
Message-ID<rJlqz-5ve-57@gated-at.bofh.it>
In reply to#1420351

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [next] | [standalone]


#1427026

FromMichal Marek <mmarek@suse.com>
Date2016-06-20 22:40 +0200
Message-ID<rMe9b-4zi-17@gated-at.bofh.it>
In reply to#1420378
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web