> OK, it seems that the structure is defined in the same file so no include
> options should be needed.  But I have now lost track of what the
> semantic patch actually is, so I don't know what is the problem.

1. Unfortunately, I needed a bit longer to become more aware of relevant
   differences in source code variations.
   Another case distinction would be needed. Thus a corresponding
   SmPL disjunction is probably required.
   I have tried out to express the desired change by a SmPL specification
   which can be a bit more precise.

@replacement@
expression base, device, private, resource;
@@
-resource = platform_get_resource(device, IORESOURCE_MEM, 0);
 base =
-       devm_ioremap_resource
+       devm_platform_get_and_ioremap_resource
                             (
(
-                             &
                               device
-                                    ->dev
                              ,
+                             0, &
                              resource
|
                              device,
+                                     0, &
                                      private->res
)
                             );


elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci 
use_devm_platform_get_and_ioremap_resource6.cocci
…
warning: iso ptr_to_array does not match the code below on line 11
device->dev

the following code matched is not uniformly minus or context,
or contains a disjunction:
Exp:
device->dev
…


2. Would it be occasionally nice to intentionally express restrictions on
   pointer data types by using the asterisk in metavariable declarations?


3. If we would require information from header files:
   Is a file inclusion failure treated as an immediate SmPL script
   execution error?


Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to