>   Unfortunately, I stumble on the error message “replacement: already tagged 
> token:
>   C code context” then.

It might be that the transformation approach was too generic for
the implementation of the function “megasas_mgmt_ioctl_fw”.
https://elixir.bootlin.com/linux/v5.4-rc5/source/drivers/scsi/megaraid/megaraid_sas_base.c#L8258
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/megaraid/megaraid_sas_base.c?id=e472c64aa4fa6150c6076fd36d101d667d71c30a#n8258

The following SmPL script variant can generate an usable test result.

@replacement@
expression result;
identifier work;
type t != void;
@@
 t work(...)
 {
 <+...
 if (...)
(
-{
-result = -ENODEV;
 goto
-     out_kfree_ioc
+     e_nodev
 ;
-}
|
 {
 ...
-result = -ENODEV;
 goto
-     out_kfree_ioc
+     e_nodev
 ;
 }
)
 ...+>
 out_kfree_ioc:
 ... when exists
 return result;
+e_nodev:
+result = -ENODEV;
+goto out_kfree_ioc;
 }


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

Reply via email to