On Thu, Jun 09, 2016 at 05:21:34PM -0300, Eduardo Habkost wrote:
> This patch simplifies code that uses a local_err variable just to immediately
> use it for an error_propagate() call.

Please ignore this one. I found a better way to tell Coccinelle
to do that. Updated Coccinelle patch is below, but I will send
the actual patch tomorrow.

@@
expression list ARGS;
expression F2;
identifier LOCAL_ERR;
expression ERRP;
idexpression V;
typedef Error;
expression I;
@@
 {
     ...
-    Error *LOCAL_ERR;
     ... when != LOCAL_ERR
(
-    F2(ARGS, &LOCAL_ERR);
-    error_propagate(ERRP, LOCAL_ERR);
+    F2(ARGS, ERRP);
|
-    V = F2(ARGS, &LOCAL_ERR);
-    error_propagate(ERRP, LOCAL_ERR);
+    V = F2(ARGS, ERRP);
)
     ... when != LOCAL_ERR
 }

-- 
Eduardo

Reply via email to