From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLDvw-0002AL-SG for qemu-devel@nongnu.org; Tue, 10 Feb 2015 11:45:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLDvs-0002S2-FP for qemu-devel@nongnu.org; Tue, 10 Feb 2015 11:45:08 -0500 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:60367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLDvs-0002R8-9Z for qemu-devel@nongnu.org; Tue, 10 Feb 2015 11:45:04 -0500 Received: by mail-wi0-f179.google.com with SMTP id hi2so5411016wib.0 for ; Tue, 10 Feb 2015 08:45:03 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54DA358B.9060509@redhat.com> Date: Tue, 10 Feb 2015 17:44:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1423586055-4932-1-git-send-email-armbru@redhat.com> <1423586055-4932-2-git-send-email-armbru@redhat.com> In-Reply-To: <1423586055-4932-2-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Markus Armbruster , qemu-devel@nongnu.org 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. Paolo