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

2019-11-04 Thread Markus Elfring
> *Allow defining the environment variable “COCCI” as a directory to
> search SmPL scripts.
>
> *Start a corresponding file determination if it contains an acceptable
> path.
>
> *Update coccinelle.rst documents for use coccicheck with a directory
> selection

‣ Do you really insist to use an enumeration without alignment
  in your change description?

‣ Can the following third item be nicer?

  * Adjust software documentation for using coccicheck with
a selected directory.


> +++ b/Documentation/dev-tools/coccinelle.rst
> @@ -100,8 +100,8 @@ Two other modes provide some common combinations of these 
> modes.
…
> +Using Coccinelle with defalut value

Why did you repeat a typo?

How do you think about to use the section title “Using Coccinelle
with the default configuration”?


…
> +semantic patch. In that case, the variable must be initialized with
> +the name of the semantic patch to apply.

I prefer an other wording.

…, it should be set to the file name of the semantic patch to apply.


…
> +directory. In that case, the variable must be initialized with the name of

…, it should be set to the …


Will the presented case distinction need another adjustment
for the document outline?


…
>  Controlling Which Files are Processed by Coccinelle
…

Did you overlook another update candidate (which I tried to point out before)?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/coccinelle.rst?id=a99d8080aaf358d5d23581244e5da23b35e340b9#n189
“…
COCCI variable may additionally be used to only apply a single
semantic patch as shown in the previous section.
…”


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


Re: [Cocci] Coccinelle: zalloc-simple: Checking data processing for a bigger SmPL disjunction

2019-11-04 Thread Markus Elfring
>> But I would like to add the last case distinction also to a similar
>> disjunction in the known (and discussed) SmPL script version.
>
> What is "the known (and discussed) SmPL script version"?

I am preparing further software updates.

Fixes: dfd32cad146e3624970eee9329e99d2c6ef751b3 ("dma-mapping: remove 
dma_zalloc_coherent()")

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/coccinelle/api/alloc/zalloc-simple.cocci?id=a99d8080aaf358d5d23581244e5da23b35e340b9#n47


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


Re: [Cocci] Coccinelle: zalloc-simple: Checking data processing for a bigger SmPL disjunction

2019-11-04 Thread Julia Lawall



On Mon, 4 Nov 2019, Markus Elfring wrote:

> Hello,
>
> I have tried the following small script variant out for
> the semantic patch language.
>
> @adjustment@
> type T, T2;
> expression x,E1,E2,E3,E4;
> statement S;
> @@
> (
> - x = kmalloc(E1,E2);
> + x = kzalloc(E1,E2);
> |
>  x = (T)dma_alloc_coherent(E2,E1,E3,E4);
> )
>   if ((x==NULL) || ...) S
> - memset((T2)x,0,E1);
>
>
> It can generate an usable diff hunk.
>
> elfring@Sonne:~/Projekte/Linux/next-patched> spatch 
> scripts/coccinelle/api/alloc/zalloc-simple-x.cocci drivers/scsi/pmcraid.c
>
>
> But I would like to add the last case distinction also to a similar
> disjunction in the known (and discussed) SmPL script version.

What is "the known (and discussed) SmPL script version"?

> I observe that the expected diff hunk is not provided then.
> How would you like to fix this software situation?
>
> Regards,
> Markus
> ___
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


[Cocci] Coccinelle: zalloc-simple: Checking data processing for a bigger SmPL disjunction

2019-11-04 Thread Markus Elfring
Hello,

I have tried the following small script variant out for
the semantic patch language.

@adjustment@
type T, T2;
expression x,E1,E2,E3,E4;
statement S;
@@
(
- x = kmalloc(E1,E2);
+ x = kzalloc(E1,E2);
|
 x = (T)dma_alloc_coherent(E2,E1,E3,E4);
)
  if ((x==NULL) || ...) S
- memset((T2)x,0,E1);


It can generate an usable diff hunk.

elfring@Sonne:~/Projekte/Linux/next-patched> spatch 
scripts/coccinelle/api/alloc/zalloc-simple-x.cocci drivers/scsi/pmcraid.c


But I would like to add the last case distinction also to a similar
disjunction in the known (and discussed) SmPL script version.
I observe that the expected diff hunk is not provided then.
How would you like to fix this software situation?

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