From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bB5y8-0001wr-LD for qemu-devel@nongnu.org; Thu, 09 Jun 2016 15:50:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bB5y6-0000lh-Ej for qemu-devel@nongnu.org; Thu, 09 Jun 2016 15:50:19 -0400 Date: Thu, 9 Jun 2016 16:50:07 -0300 From: Eduardo Habkost Message-ID: <20160609195007.GW18662@thinpad.lan.raisama.net> References: <1465494036-23928-1-git-send-email-ehabkost@redhat.com> <5759C573.1070403@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5759C573.1070403@redhat.com> Subject: Re: [Qemu-devel] [PATCH] error: Remove NULL checks on error_propagate() calls 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 01:37:23PM -0600, Eric Blake wrote: [...] > > Hmm - it seems like in most of the cases where the ONLY thing done in > the if (local_err) block is to propagate the error, we should instead be > directly assigning to errp instead of wasting a local variable. At this > point, my review is repetitive enough that I'll stop looking, and leave > it up to you and Markus whether to attempt a more ambitious Coccinelle > script. If it happens immediately before the function end or a return statement it should be easy, but it would still require some manual work to remove the unused variable declaration. Probably easier to do that in a follow-up patch. It's harder (impossible?) to make Coccinelle avoid matching if local_err is used somewhere else in the function. But it's probably doable with some manual work, in a follow-up patch. -- Eduardo