From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bB6ro-00045C-VY for qemu-devel@nongnu.org; Thu, 09 Jun 2016 16:47:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bB6rn-0006VB-2q for qemu-devel@nongnu.org; Thu, 09 Jun 2016 16:47:51 -0400 Date: Thu, 9 Jun 2016 17:47:40 -0300 From: Eduardo Habkost Message-ID: <20160609204740.GA18662@thinpad.lan.raisama.net> References: <1465494036-23928-1-git-send-email-ehabkost@redhat.com> <5759C573.1070403@redhat.com> <20160609202134.GZ18662@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160609202134.GZ18662@thinpad.lan.raisama.net> Subject: Re: [Qemu-devel] [PATCH] error: Avoid redudant error_propagate() usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Markus Armbruster , kwolf@redhat.com, cornelia.huck@de.ibm.com, mreitz@redhat.com, qemu-block@nongnu.org, borntraeger@de.ibm.com 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