qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] error: Avoid redudant error_propagate() usage


From: Eduardo Habkost
Subject: Re: [Qemu-block] [PATCH] error: Avoid redudant error_propagate() usage
Date: Thu, 9 Jun 2016 17:47:40 -0300
User-agent: Mutt/1.6.1 (2016-04-27)

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

[Prev in Thread] Current Thread [Next in Thread]