From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXuJG-0006Dg-ML for qemu-devel@nongnu.org; Mon, 22 Feb 2016 12:30:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXuJB-00054V-HU for qemu-devel@nongnu.org; Mon, 22 Feb 2016 12:30:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:58481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXuJB-000536-7W for qemu-devel@nongnu.org; Mon, 22 Feb 2016 12:30:05 -0500 References: <1456160797-832-1-git-send-email-mjrosato@linux.vnet.ibm.com> <1456160797-832-7-git-send-email-mjrosato@linux.vnet.ibm.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <56CB459B.5050605@suse.de> Date: Mon, 22 Feb 2016 18:30:03 +0100 MIME-Version: 1.0 In-Reply-To: <1456160797-832-7-git-send-email-mjrosato@linux.vnet.ibm.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 6/7] cpu: Add a last_cpu macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matthew Rosato , qemu-devel@nongnu.org Cc: dahi@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com, imammedo@redhat.com, bharata@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, rth@twiddle.net Am 22.02.2016 um 18:06 schrieb Matthew Rosato: > Add last_cpu to grab last CPU in the queue. Rename one existing > use of last_cpu as a variable name. >=20 > Signed-off-by: Matthew Rosato > --- > hw/intc/openpic.c | 12 ++++++------ > include/qom/cpu.h | 1 + > 2 files changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c > index 903888c..0dd908e 100644 > --- a/hw/intc/openpic.c > +++ b/hw/intc/openpic.c > @@ -217,7 +217,7 @@ typedef struct IRQSource { > uint32_t ivpr; /* IRQ vector/priority register */ > uint32_t idr; /* IRQ destination register */ > uint32_t destmask; /* bitmap of CPU destinations */ > - int last_cpu; > + int cpu_last; If we do need to rename this, what about last_cpu_index? cpu_last reads really ugly. > int output; /* IRQ level, e.g. OPENPIC_OUTPUT_INT */ > int pending; /* TRUE if IRQ is pending */ > IRQType type; > @@ -476,9 +476,9 @@ static void openpic_update_irq(OpenPICState *opp, i= nt n_IRQ) > return; > } > =20 > - if (src->destmask =3D=3D (1 << src->last_cpu)) { > + if (src->destmask =3D=3D (1 << src->cpu_last)) { > /* Only one CPU is allowed to receive this IRQ */ > - IRQ_local_pipe(opp, src->last_cpu, n_IRQ, active, was_active); > + IRQ_local_pipe(opp, src->cpu_last, n_IRQ, active, was_active); > } else if (!(src->ivpr & IVPR_MODE_MASK)) { > /* Directed delivery mode */ > for (i =3D 0; i < opp->nb_cpus; i++) { > @@ -488,13 +488,13 @@ static void openpic_update_irq(OpenPICState *opp,= int n_IRQ) > } > } else { > /* Distributed delivery mode */ > - for (i =3D src->last_cpu + 1; i !=3D src->last_cpu; i++) { > + for (i =3D src->cpu_last + 1; i !=3D src->cpu_last; i++) { > if (i =3D=3D opp->nb_cpus) { > i =3D 0; > } > if (src->destmask & (1 << i)) { > IRQ_local_pipe(opp, i, n_IRQ, active, was_active); > - src->last_cpu =3D i; > + src->cpu_last =3D i; > break; > } > } > @@ -1444,7 +1444,7 @@ static const VMStateDescription vmstate_openpic_i= rqsource =3D { > VMSTATE_UINT32(ivpr, IRQSource), > VMSTATE_UINT32(idr, IRQSource), > VMSTATE_UINT32(destmask, IRQSource), > - VMSTATE_INT32(last_cpu, IRQSource), > + VMSTATE_INT32(cpu_last, IRQSource), This name change shows up in the VMState description, e.g. in the JSON. Migration will still work, but we should avoid it for debugging cross-version migration. > VMSTATE_INT32(pending, IRQSource), > VMSTATE_END_OF_LIST() > } [actual change snipped] Regards, Andreas --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Graham Norton; HRB 21284 (AG N=FC= rnberg)