[PATCH 02/12] hw/acpi/piix4: change smm_enabled from int to bool

Mark Cave-Ayland posted 12 patches 3 years, 8 months ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Aurelien Jarno <aurelien@aurel32.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Hervé Poussineau" <hpoussin@reactos.org>
There is a newer version of this series
[PATCH 02/12] hw/acpi/piix4: change smm_enabled from int to bool
Posted by Mark Cave-Ayland 3 years, 8 months ago
This is in preparation for conversion to a qdev property.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/acpi/piix4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index bf20fa139b..fcfaafc175 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -74,7 +74,7 @@ struct PIIX4PMState {
 
     qemu_irq irq;
     qemu_irq smi_irq;
-    int smm_enabled;
+    bool smm_enabled;
     bool smm_compat;
     Notifier machine_ready;
     Notifier powerdown_notifier;
-- 
2.20.1
Re: [PATCH 02/12] hw/acpi/piix4: change smm_enabled from int to bool
Posted by Ani Sinha 3 years, 8 months ago
On Sat, May 28, 2022 at 2:49 PM Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> This is in preparation for conversion to a qdev property.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

other than the comment below,
Reviewed-by: Ani Sinha <ani@anisinha.ca>

> ---
>  hw/acpi/piix4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index bf20fa139b..fcfaafc175 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -74,7 +74,7 @@ struct PIIX4PMState {
>
>      qemu_irq irq;
>      qemu_irq smi_irq;
> -    int smm_enabled;
> +    bool smm_enabled;

For the sake of consistency, I would also change the signature of
piix4_pm_init(), that is, change simm_enabled from int to bool.
We are good in pc_init1 since x86_machine_is_smm_enabled() returns
bool. In piix4_create() in isa, we pass integer 0 which we might want
to make boolean.

>      bool smm_compat;
>      Notifier machine_ready;
>      Notifier powerdown_notifier;
> --
> 2.20.1
>
Re: [PATCH 02/12] hw/acpi/piix4: change smm_enabled from int to bool
Posted by Philippe Mathieu-Daudé via 3 years, 8 months ago
On 30/5/22 06:56, Ani Sinha wrote:
> On Sat, May 28, 2022 at 2:49 PM Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>>
>> This is in preparation for conversion to a qdev property.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> other than the comment below,
> Reviewed-by: Ani Sinha <ani@anisinha.ca>
> 
>> ---
>>   hw/acpi/piix4.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
>> index bf20fa139b..fcfaafc175 100644
>> --- a/hw/acpi/piix4.c
>> +++ b/hw/acpi/piix4.c
>> @@ -74,7 +74,7 @@ struct PIIX4PMState {
>>
>>       qemu_irq irq;
>>       qemu_irq smi_irq;
>> -    int smm_enabled;
>> +    bool smm_enabled;
> 
> For the sake of consistency, I would also change the signature of
> piix4_pm_init(), that is, change simm_enabled from int to bool.
> We are good in pc_init1 since x86_machine_is_smm_enabled() returns
> bool. In piix4_create() in isa, we pass integer 0 which we might want
> to make boolean.

This function ends up removed... But OK.