Received: from eggs.gnu.org ([2001:4830:134:3::10]:35270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLWhO-0000UT-OB for qemu-devel@nongnu.org; Wed, 11 Feb 2015 07:47:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLWhL-000834-I8 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 07:47:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLWhL-00082w-B5 for qemu-devel@nongnu.org; Wed, 11 Feb 2015 07:47:19 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1BClIQx030171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 11 Feb 2015 07:47:18 -0500 From: Markus Armbruster References: <1423586055-4932-1-git-send-email-armbru@redhat.com> <1423586055-4932-2-git-send-email-armbru@redhat.com> <54DA358B.9060509@redhat.com> Date: Wed, 11 Feb 2015 13:47:16 +0100 In-Reply-To: <54DA358B.9060509@redhat.com> (Paolo Bonzini's message of "Tue, 10 Feb 2015 17:44:59 +0100") Message-ID: <87bnl08vjf.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/9] error: New convenience function error_report_err() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini writes: > On 10/02/2015 17:34, Markus Armbruster wrote: >> I've typed error_report("%s", error_get_pretty(ERR)) too many times >> already, and I've fixed too many instances of qerror_report_err(ERR) >> to error_report("%s", error_get_pretty(ERR)) as well. Capture the >> pattern in a convenience function. >> >> Since it's almost invariably followed by error_free(), stuff that into >> the convenience function as well. >> >> Put it to use with this Coccinelle semantic patch: > > For your "no good deed goes unpunished" record, can you prepare a Wiki > page on how to use Coccinelle? My attempts always saw it confused by > qemu/queue.h macros. Same here, just "sometimes" instead of "always". I once tried to use Coccinelle's macro hints to unconfuse it. Frustrating failure. It's clearly a poweful tool, but working with it makes me feel like an ogre trying to use pliers. Sometimes I manage to pull a whole raft of splinters with it in one go, and then I'm one proud ogre. At other times, it completely resists my attempts to tell it what I want done. I'm at least as confused about it as Eduardo.