[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH] vmstate: constify VMStateField
From: |
Thomas Huth |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH] vmstate: constify VMStateField |
Date: |
Wed, 14 Nov 2018 17:29:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-11-14 16:32, Philippe Mathieu-Daudé wrote:
> Hi Marc-André,
>
> On 14/11/18 14:29, Marc-André Lureau wrote:
>> Because they are supposed to remain const.
>>
>> Signed-off-by: Marc-André Lureau <address@hidden>
>> ---
>> include/migration/vmstate.h | 6 +-
>> hw/display/virtio-gpu.c | 4 +-
>> hw/intc/s390_flic_kvm.c | 4 +-
>> hw/nvram/eeprom93xx.c | 6 +-
>> hw/nvram/fw_cfg.c | 6 +-
>> hw/pci/msix.c | 4 +-
>> hw/pci/pci.c | 8 +--
>> hw/pci/shpc.c | 7 ++-
>> hw/scsi/scsi-bus.c | 4 +-
>> hw/timer/twl92230.c | 4 +-
>> hw/usb/redirect.c | 12 ++--
>> hw/virtio/virtio.c | 8 +--
>> migration/savevm.c | 7 ++-
>> migration/vmstate-types.c | 119 ++++++++++++++++++++----------------
>> migration/vmstate.c | 31 +++++-----
>> target/alpha/machine.c | 5 +-
>> target/arm/machine.c | 12 ++--
>> target/hppa/machine.c | 10 +--
>> target/mips/machine.c | 14 +++--
>> target/openrisc/machine.c | 5 +-
>> target/ppc/machine.c | 14 +++--
>> target/sparc/machine.c | 7 ++-
>> 22 files changed, 162 insertions(+), 135 deletions(-)
>>
>> diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
>> index 2b501d0466..61bef3ef5c 100644
>> --- a/include/migration/vmstate.h
>> +++ b/include/migration/vmstate.h
>> @@ -40,8 +40,8 @@ typedef struct VMStateField VMStateField;
>
> What about enforcing the constness in the typedef?
>
> -- >8 --
> @@ -32 +32 @@ typedef struct VMStateDescription VMStateDescription;
> -typedef struct VMStateField VMStateField;
> +typedef const struct VMStateField VMStateField;
> ---
Please don't. For rationale, see:
https://www.kernel.org/doc/html/v4.19/process/coding-style.html#typedefs
Thomas
Re: [Qemu-ppc] [PATCH] vmstate: constify VMStateField, David Gibson, 2018/11/15
Re: [Qemu-ppc] [PATCH] vmstate: constify VMStateField, Cornelia Huck, 2018/11/15
Re: [Qemu-ppc] [PATCH] vmstate: constify VMStateField, Paolo Bonzini, 2018/11/21