mbox series

[0/3] hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'

Message ID 20230203163021.35754-1-philmd@linaro.org
Headers show
Series hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent' | expand

Message

Philippe Mathieu-Daudé Feb. 3, 2023, 4:30 p.m. UTC
To ease code review, rename ACPI CPU hotplug variables
to more meaningful names.

Since hotplug parent can't be any QOM object, and must be
a QDev, convert AcpiCpuHotplug::device from Object* to
DeviceState*.

Philippe Mathieu-Daudé (3):
  hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe
  hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container'
  hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'

 hw/acpi/acpi-cpu-hotplug-stub.c |  8 +++---
 hw/acpi/cpu_hotplug.c           | 46 ++++++++++++++++-----------------
 hw/acpi/ich9.c                  |  9 ++++---
 hw/acpi/piix4.c                 | 14 +++++-----
 include/hw/acpi/cpu_hotplug.h   | 12 ++++-----
 include/hw/acpi/ich9.h          |  2 +-
 include/hw/acpi/piix4.h         |  2 +-
 7 files changed, 47 insertions(+), 46 deletions(-)

Comments

Philippe Mathieu-Daudé Feb. 22, 2023, 9:34 p.m. UTC | #1
On 3/2/23 17:30, Philippe Mathieu-Daudé wrote:
> To ease code review, rename ACPI CPU hotplug variables
> to more meaningful names.
> 
> Since hotplug parent can't be any QOM object, and must be
> a QDev, convert AcpiCpuHotplug::device from Object* to
> DeviceState*.
> 
> Philippe Mathieu-Daudé (3):
>    hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe
>    hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container'
>    hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'

ping
Philippe Mathieu-Daudé Feb. 28, 2023, 1:36 p.m. UTC | #2
ping^2

On 22/2/23 22:34, Philippe Mathieu-Daudé wrote:
> On 3/2/23 17:30, Philippe Mathieu-Daudé wrote:
>> To ease code review, rename ACPI CPU hotplug variables
>> to more meaningful names.
>>
>> Since hotplug parent can't be any QOM object, and must be
>> a QDev, convert AcpiCpuHotplug::device from Object* to
>> DeviceState*.
>>
>> Philippe Mathieu-Daudé (3):
>>    hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe
>>    hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container'
>>    hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'
> 
> ping
Igor Mammedov Feb. 28, 2023, 3:47 p.m. UTC | #3
On Tue, 28 Feb 2023 14:36:43 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> ping^2

please use checkpatch before pasting series.

Object -> DeviceState is a nice cleanup,
the rest is just unnecessary churn in my opinion and a matter of taste,
but I fine with it if it makes code easier to read
for someone else.


> 
> On 22/2/23 22:34, Philippe Mathieu-Daudé wrote:
> > On 3/2/23 17:30, Philippe Mathieu-Daudé wrote:  
> >> To ease code review, rename ACPI CPU hotplug variables
> >> to more meaningful names.
> >>
> >> Since hotplug parent can't be any QOM object, and must be
> >> a QDev, convert AcpiCpuHotplug::device from Object* to
> >> DeviceState*.
> >>
> >> Philippe Mathieu-Daudé (3):
> >>    hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe
> >>    hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container'
> >>    hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'  
> > 
> > ping  
>
Michael S. Tsirkin Feb. 28, 2023, 9:50 p.m. UTC | #4
On Tue, Feb 28, 2023 at 04:47:31PM +0100, Igor Mammedov wrote:
> On Tue, 28 Feb 2023 14:36:43 +0100
> Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 
> > ping^2
> 
> please use checkpatch before pasting series.
> 
> Object -> DeviceState is a nice cleanup,


I don't like that one either because everyone wants Object so
we just cast it back all the time. Let's carry what we use
if all you call sites cast you know you should keep the type you
cast to.


> the rest is just unnecessary churn in my opinion and a matter of taste,
> but I fine with it if it makes code easier to read
> for someone else.
> 
> 
> > 
> > On 22/2/23 22:34, Philippe Mathieu-Daudé wrote:
> > > On 3/2/23 17:30, Philippe Mathieu-Daudé wrote:  
> > >> To ease code review, rename ACPI CPU hotplug variables
> > >> to more meaningful names.
> > >>
> > >> Since hotplug parent can't be any QOM object, and must be
> > >> a QDev, convert AcpiCpuHotplug::device from Object* to
> > >> DeviceState*.
> > >>
> > >> Philippe Mathieu-Daudé (3):
> > >>    hw/acpi/cpu_hotplug: Rename gpe_cpu -> gpe
> > >>    hw/acpi/cpu_hotplug: Rename 'parent' MemoryRegion as 'container'
> > >>    hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'  
> > > 
> > > ping  
> >