qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.4 qom-cpu 6/9] pc: Set fw_cfg data based o


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH for-1.4 qom-cpu 6/9] pc: Set fw_cfg data based on APIC ID calculation
Date: Fri, 25 Jan 2013 15:33:01 -0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jan 25, 2013 at 05:22:33PM +0000, Blue Swirl wrote:
> On Wed, Jan 23, 2013 at 5:09 PM, Eduardo Habkost <address@hidden> wrote:
> > On Wed, Jan 23, 2013 at 05:33:25PM +0100, Andreas Färber wrote:
[...]
> >> > -    numa_fw_cfg = g_new0(uint64_t, 1 + max_cpus + nb_numa_nodes);
> >> > +    numa_fw_cfg = g_new0(uint64_t, 1 + apic_id_limit + nb_numa_nodes);
> >> >      numa_fw_cfg[0] = cpu_to_le64(nb_numa_nodes);
> >> > -    for (i = 0; i < max_cpus; i++) {
> >> > +    unsigned int cpu_idx;
> >>
> >> Beep.
> >
> > After so many rebases, I didn't even remember this variable declaration
> > was here.
> >
> > But, what prevents us from declaring variables only when they are being
> > used, in QEMU code? I didn't find anything on CODING_STYLE or HACKING.
> 
> Here's one explanation:
> http://lists.nongnu.org/archive/html/qemu-devel/2012-05/msg03955.html
> 
> Also IIRC Anthony gave a nice explanation once too but I can't find it now.

I'm not even looking for an explanation why[1]. I just expected to have
this requirement documented on CODING_STYLE or HACKING.

[1] Item 3 on Anthony's explanation is enough to me:
    https://lists.nongnu.org/archive/html/qemu-devel/2012-05/msg04116.html
    "3) It's not how the rest of QEMU is written. Consistency is the
    most important purpose of Coding Style."

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]