From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zcc7I-0003Q2-73 for qemu-devel@nongnu.org; Thu, 17 Sep 2015 12:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zcc7E-0004Ji-6w for qemu-devel@nongnu.org; Thu, 17 Sep 2015 12:33:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zcc7E-0004Je-1b for qemu-devel@nongnu.org; Thu, 17 Sep 2015 12:32:56 -0400 References: <1441619584-17992-1-git-send-email-pbonzini@redhat.com> <1441619584-17992-4-git-send-email-pbonzini@redhat.com> <55FAE3A9.5090907@redhat.com> From: Paolo Bonzini Message-ID: <55FAEB33.50809@redhat.com> Date: Thu, 17 Sep 2015 18:32:51 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/4] checkpatch: adapt some tests to QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Markus Armbruster , QEMU Developers , Eduardo Habkost , Andreas Faerber On 17/09/2015 18:16, Peter Maydell wrote: > On 17 September 2015 at 17:00, Paolo Bonzini wrote: >> >> >> On 17/09/2015 16:24, Peter Maydell wrote: >>> Can we revert this one, please? Checkpatch now warns about constructs >>> like >>> typedef struct MyDevice { >>> DeviceState parent; >>> >>> int reg0, reg1, reg2; >>> } MyDevice; >> >> It's interesting that qom/object.h documents this and start like: >> >> typedef struct ObjectClass ObjectClass; >> typedef struct Object Object; >> >> typedef struct TypeInfo TypeInfo; >> >> typedef struct InterfaceClass InterfaceClass; >> typedef struct InterfaceInfo InterfaceInfo; >> >> I have a patch to flag widely-disrespected rules that we still want to >> encourage in patches. Would you agree with filing these typedefs under >> this category? > > No, I think that having a separate typedef is worse. The > only exceptions are (a) when you need it to be separate because > you need to use the type within the struct itself (or some > similar dependency loop) (b) when you want to put the typedef > in include/qemu/typedefs.h. > > I really don't see any need to suddenly outlaw something > that's been accepted as standard good QEMU style for a > long time. I think it varies depending on the maintainer. PPC, USB, SCSI, ACPI all use a separate typedef. I'll prepare a revert. Paolo