From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMy3D-0000JE-J9 for qemu-devel@nongnu.org; Wed, 14 Nov 2018 11:30:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMy3C-00070l-No for qemu-devel@nongnu.org; Wed, 14 Nov 2018 11:29:59 -0500 References: <20181114132931.22624-1-marcandre.lureau@redhat.com> <16b78816-f2cc-a1e5-0d21-906fc2dbaa3d@redhat.com> From: Thomas Huth Message-ID: Date: Wed, 14 Nov 2018 17:29:42 +0100 MIME-Version: 1.0 In-Reply-To: <16b78816-f2cc-a1e5-0d21-906fc2dbaa3d@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] vmstate: constify VMStateField List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: Peter Maydell , Fam Zheng , "Michael S. Tsirkin" , Aurelien Jarno , Cornelia Huck , Mark Cave-Ayland , dgilbert@redhat.com, quintela@redhat.com, "open list:S390" , "open list:ARM" , "open list:PowerPC" , Gerd Hoffmann , Aleksandar Markovic , Paolo Bonzini , Stafford Horne , Richard Henderson , Christian Borntraeger , Artyom Tarasenko , David Gibson On 2018-11-14 16:32, Philippe Mathieu-Daud=C3=A9 wrote: > Hi Marc-Andr=C3=A9, >=20 > On 14/11/18 14:29, Marc-Andr=C3=A9 Lureau wrote: >> Because they are supposed to remain const. >> >> Signed-off-by: Marc-Andr=C3=A9 Lureau >> --- >> =C2=A0 include/migration/vmstate.h |=C2=A0=C2=A0 6 +- >> =C2=A0 hw/display/virtio-gpu.c=C2=A0=C2=A0=C2=A0=C2=A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0 8 +-- >> =C2=A0 migration/savevm.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=C2=A0=C2=A0 7 ++- >> =C2=A0 migration/vmstate-types.c=C2=A0=C2=A0 | 119 +++++++++++++++++++= +---------------- >> =C2=A0 migration/vmstate.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 31 +++++----- >> =C2=A0 target/alpha/machine.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2= =A0 5 +- >> =C2=A0 target/arm/machine.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = |=C2=A0 12 ++-- >> =C2=A0 target/hppa/machine.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0= 10 +-- >> =C2=A0 target/mips/machine.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0= 14 +++-- >> =C2=A0 target/openrisc/machine.c=C2=A0=C2=A0 |=C2=A0=C2=A0 5 +- >> =C2=A0 target/ppc/machine.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = |=C2=A0 14 +++-- >> =C2=A0 target/sparc/machine.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2= =A0 7 ++- >> =C2=A0 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; >=20 > What about enforcing the constness in the typedef? >=20 > -- >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