Re: [Cocci] [PATCH v2] coccicheck: support $COCCI being defined as a directory

2019-10-24 Thread Markus Elfring
I find that the commit message should still be considerably improved.
How do you think about to use the subject “[PATCH] coccicheck:
Support search for SmPL scripts within selected directory hierarchy”?


> Put a modification in scripts/coccicheck which supports users in
> configuring COCCI parameter as a directory to traverse files in
> directory whose next level directory contains rule files with Suffix of cocci.

* Please avoid a typo in this change description.

* Would you like to integrate a wording approach like the following?

  A search can be performed for SmPL scripts within a directory hierarchy.
  Start a corresponding file determination if the environment variable “COCCI”
  contains an acceptable path.


Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH v2] coccicheck: support $COCCI being defined as a directory

2019-10-24 Thread Markus Elfring
> Second the commit log could be more concise as:

I like your desire for choosing a more appropriate commit message.


> Allow defining COCCI as a directory that contains .cocci files.

I would prefer to concentrate the patch subject on other information.


> In general, at least in simple cases, it is not necessary to mention the
> name of the file you are modifying in the comit log, because one can see
> that just below from looking at the diffstat and the patch.

This view can be reasonable. - How does it fit to the usual requirement
for the specification of a “subsystem” (or “prefix”) according to the
canonical patch format?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=13b86bc4cd648eae69fdcf3d04b2750c76350053#n656

Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH v2] coccicheck: support $COCCI being defined as a directory

2019-10-24 Thread Julia Lawall


On Thu, 24 Oct 2019, Markus Elfring wrote:

> > Second the commit log could be more concise as:
>
> I like your desire for choosing a more appropriate commit message.
>
>
> > Allow defining COCCI as a directory that contains .cocci files.
>
> I would prefer to concentrate the patch subject on other information.
>
>
> > In general, at least in simple cases, it is not necessary to mention the
> > name of the file you are modifying in the comit log, because one can see
> > that just below from looking at the diffstat and the patch.
>
> This view can be reasonable. - How does it fit to the usual requirement
> for the specification of a “subsystem” (or “prefix”) according to the
> canonical patch format?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=13b86bc4cd648eae69fdcf3d04b2750c76350053#n656

Huh?  I was talking about the log message, not the subject line.  Likewise
"Allow defining..." was not proposed as a subject line, but as the log
message.  With that degree of orientation, I think one can look at the
code and figure out what the intent is.  At least if one knows the meaning
of -d.

julia___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH v2] coccicheck:support $COCCI being defined as adirectory

2019-10-24 Thread zhong.shiqi
> On Thu, 24 Oct 2019, zhongshiqi wrote:
>
> > Put a modification in scripts/coccicheck which supports users in
> > configuring COCCI parameter as a directory to traverse files in
> > directory whose next level directory contains rule files with Suffix of
> > cocci.
>
> While I thought the original was fine, if we are going to strive for
> perfection, there are some things that could be changed.  First there
> should be a space in the subject line after the :
>
> Second the commit log could be more concise as:
>
> Allow defining COCCI as a directory that contains .cocci files.
>
> In general, at least in simple cases, it is not necessary to mention the
> name of the file you are modifying in the comit log, because one can see
> that just below from looking at the diffstat and the patch.
>
> thanks,
> julia
>

Thank you,it is very good for me

Best Regards,
zhong.shiqi

> >
> > Signed-off-by: zhongshiqi 
> > ---
> > Changes in v2:
> > 1.fix patch subject according to the reply by Markus
> > 
> > 2.change description in “imperative mood”
> >
> >  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
> > --
> > 2.9.5
> >
> >___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH v2] coccicheck: support $COCCI being defined as adirectory

2019-10-24 Thread zhong.shiqi
> I find that the commit message should still be considerably improved.
> How do you think about to use the subject “[PATCH] coccicheck:
> Support search for SmPL scripts within selected directory hierarchy”?

I would like to use subject as you said.
But it seems a little bit long, does it matter?

> > Put a modification in scripts/coccicheck which supports users in
> > configuring COCCI parameter as a directory to traverse files in
> > directory whose next level directory contains rule files with Suffix of 
> > cocci.

> * Please avoid a typo in this change description.

I am pleasure to rewrite this change description.

> * Would you like to integrate a wording approach like the following?

I'd like to. Thanks.

> A search can be performed for SmPL scripts within a directory hierarchy.
> Start a corresponding file determination if the environment variable “COCCI”
> contains an acceptable path.

Best Regards,
zhong.shiqi___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [v2] coccicheck: support $COCCI being defined as a directory

2019-10-24 Thread Markus Elfring
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=13b86bc4cd648eae69fdcf3d04b2750c76350053#n656
>
> Huh?  I was talking about the log message, not the subject line.

Thanks for this clarification.


> With that degree of orientation, I think one can look at the code
> and figure out what the intent is.

The intention should become clear by reading the commit message
(combination of a subject and change description) alone already,
shouldn't it?

Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [v2] coccicheck: support $COCCI being defined as adirectory

2019-10-24 Thread Markus Elfring
>> How do you think about to use the subject “[PATCH] coccicheck:
>> Support search for SmPL scripts within selected directory hierarchy”?
>
> I would like to use subject as you said.

Thanks for your positive feedback.


> But it seems a little bit long,

I hope that this suggestion is still appropriate.


> does it matter?

Do you know an approach which can express almost the same information
with a shorter wording (besides using an other language) at this place?

Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [v2] coccicheck: support $COCCI being defined as adirectory

2019-10-24 Thread zhong.shiqi
> >> How do you think about to use the subject “[PATCH] coccicheck:
> >> Support search for SmPL scripts within selected directory hierarchy”?
> >
> > I would like to use subject as you said.
>
> Thanks for your positive feedback.
>
>
> > But it seems a little bit long,
>
> I hope that this suggestion is still appropriate.
>
>
> > does it matter?
>
> Do you know an approach which can express almost the same information
> with a shorter wording (besides using an other language) at this place?

How do you think about to use the subject "[PATCH] coccicheck:
Support search in a selected directory"?

> Regards,
> Markus___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [v2] coccicheck: support $COCCI being defined as a directory

2019-10-24 Thread Markus Elfring
> How do you think about to use the subject "[PATCH] coccicheck: Support search 
> in a selected directory"?

I am unsure about such a reduced variant.
Its acceptance will depend also on other Linux contributors as usual.

Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] coccinelle: api/devm_platform_ioremap_resource: remove useless script

2019-10-24 Thread Markus Elfring
> I always appreciate the code refactoring
> that reduces the object size.

Would you like to compare effects around conversions for
the mentioned wrapper function any more?

Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] coccinelle: api/devm_platform_ioremap_resource: remove useless script

2019-10-24 Thread Masahiro Yamada
On Sun, Oct 20, 2019 at 7:13 AM Joe Perches  wrote:
>
> On Sat, 2019-10-19 at 21:43 +0100, Marc Zyngier wrote:
> > Providing Coccinelle scripts that scream about perfectly valid code is
> > pointless, and the result is actively harmful.
>
> Doubtful.
>
> If the new code is smaller object code and correct
> than the conversion is worthwhile.

I agree.

We use multi-platform defconfig.
I always appreciate the code refactoring
that reduces the object size.



> fyi:
>
> There are already ~450 uses of this function and maybe
> ~800 possible additional conversions.
>
> > If said script was providing a correct semantic patch instead of being
> > an incentive for people to churn untested patches that span the whole
> > tree, that'd be a different story.
>
> Right.
>
>


Alexandre Belloni used
https://lore.kernel.org/lkml/9bbcce19c777583815c92ce3c2ff2...@www.loen.fr/
as a reference, but this is not the output from coccicheck.
The patch author just created a wrong patch by hand.

The deleted semantic patch supports MODE=patch,
which creates a correct patch, and is useful.


-- 
Best Regards
Masahiro Yamada
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


[Cocci] [PATCH v3] coccicheck: Support search for SmPL scripts within selected directory hierarchy

2019-10-24 Thread zhongshiqi
Allow defining COCCI as a directory to search SmPL scripts. Start a
corresponding file determination if the environment variable “COCCI”
contains an acceptable path.

Signed-off-by: zhongshiqi 
---
Changes in v3:
1:rewrite change description
2:fix patch subject
3:modify commit log

Changes in v2:
1.fix patch subject according to the reply by Markus

2.change description in “imperative mood”
 
 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
-- 
2.9.5

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci