From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtxLR-0005lg-7b for qemu-devel@nongnu.org; Tue, 02 Jul 2013 05:57:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtxLQ-0006xt-48 for qemu-devel@nongnu.org; Tue, 02 Jul 2013 05:57:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtxLP-0006xg-RD for qemu-devel@nongnu.org; Tue, 02 Jul 2013 05:57:56 -0400 Message-ID: <51D2A3FD.3090702@redhat.com> Date: Tue, 02 Jul 2013 11:57:17 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1372438702-20491-1-git-send-email-pbonzini@redhat.com> <1372438702-20491-7-git-send-email-pbonzini@redhat.com> <51D1CB70.9050308@siemens.com> <51D27638.4030804@redhat.com> <51D27D38.2090309@siemens.com> <51D28CF0.4090806@redhat.com> <51D29104.6020109@siemens.com> <51D29D40.1050601@redhat.com> <51D29E0F.5000208@siemens.com> In-Reply-To: <51D29E0F.5000208@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/11] memory: add ref/unref calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: "peter.maydell@linaro.org" , "qemu-devel@nongnu.org" Il 02/07/2013 11:31, Jan Kiszka ha scritto: > On 2013-07-02 11:28, Paolo Bonzini wrote: >> Il 02/07/2013 10:36, Jan Kiszka ha scritto: >>>>>>> Hmm, two solutions for one problem - can we improve this in the next round? >>>>> >>>>> Sure, I can adapt the hw/acpi/piix4.c to use ifs in the same style as >>>>> hw/isa/lpc_ich9.c (I find the code easier to read). >>> I was more referring to memory_region_present vs. open-coding. >> >> Understood, but once you replace ?: with "if", the memory_region_present >> wrapper loses most of the appeal. So I actually prefer the open-coded one. > > Well, count the memory_region_unref calls. Fair enough... I'll move memory_region_present to memory.h/c. Paolo