From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wuu6S-0000zU-1r for qemu-devel@nongnu.org; Wed, 11 Jun 2014 21:47:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wuu6J-0001a2-QM for qemu-devel@nongnu.org; Wed, 11 Jun 2014 21:46:55 -0400 Message-ID: <5399067B.20009@redhat.com> Date: Wed, 11 Jun 2014 19:46:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <1402506183-29736-1-git-send-email-aik@ozlabs.ru> <1402506183-29736-2-git-send-email-aik@ozlabs.ru> <53989009.1000300@redhat.com> <5398EFF6.7060603@ozlabs.ru> In-Reply-To: <5398EFF6.7060603@ozlabs.ru> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TtviB5o92FkI8DLMh54bDSrjNkh8xnT4J" Subject: Re: [Qemu-devel] [PATCH v6 1/4] cpus: Define callback for QEMU "nmi" command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: Peter Maydell , Alex Bligh , Markus Armbruster , Luiz Capitulino , Alexander Graf , qemu-ppc@nongnu.org, Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Richard Henderson This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TtviB5o92FkI8DLMh54bDSrjNkh8xnT4J Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/11/2014 06:10 PM, Alexey Kardashevskiy wrote: >>> + * This program is free software; you can redistribute it and/or mo= dify >>> + * it under the terms of the GNU General Public License as publishe= d by >>> + * the Free Software Foundation; either version 2 of the License, >>> + * or (at your option) any later version. >> >> For the GPL license to work, there has to be a Copyright line. >=20 > Hm. Ok. include/hw/fw-path-provider.h (where I copied this from) does n= ot > have one and it was ok. Just because there's existing bad practice in the code base doesn't mean new files should perpetuate it :) >=20 >> >>> +static int do_nmi(Object *o, void *opaque) >>> +{ >>> + struct do_nmi_s *ns =3D opaque; >>> + NMI *n =3D (NMI *) object_dynamic_cast(o, TYPE_NMI); >> >> Is the cast to (NMI *) necessary, or does object_dynamic_cast() alread= y >> return something that can be assigned to an arbitrary pointer type? >=20 >=20 > All the macros from include/qom/object.h do this cast and so do I. >=20 > object_dynamic_cast returns Object*. Okay, then the cast is needed. (I wonder if object_dynamic_cast() should return void* to avoid the need for casting, but that probably invites more errors than what it saves from the eliminated casts). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --TtviB5o92FkI8DLMh54bDSrjNkh8xnT4J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTmQZ7AAoJEKeha0olJ0Nq/AoH/jkgn0zsJw4zfqcHpB1W5cUb Gne0DWH3gZ0iU5RrLzWVTVuEMkWgHHwpbSMg8EchAgkT9eox20YUtG8MwJD+seCl u2QimKlh05SXFL9eqirP9Pke8g69AA/8NBf62Hz2zvyDj+dJuU/9mvD1Qi9+id5K mWuYq/Rxx+2d6m0pNKyth32qQFY77CsrDxa9f5TELnBypbRdTXBwSoujs0p/DEcP 0bs3DW6dzn2ZXO61A8Hany/t0a3xvdb9FdCgG2CmcyEuBnXXpdO1J2mLI7mwBVbt f5/fWeXpz0H1PuRBgSQ4vNN4qWIeQz53MnYNz/S/hDfE6hoRD5tUbJ/Daerq9Uc= =l+Mv -----END PGP SIGNATURE----- --TtviB5o92FkI8DLMh54bDSrjNkh8xnT4J--