Received: from eggs.gnu.org ([2001:4830:134:3::10]:60128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcpYX-0002rD-NO for qemu-devel@nongnu.org; Fri, 18 Sep 2015 02:54:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcpYT-00031X-NA for qemu-devel@nongnu.org; Fri, 18 Sep 2015 02:54:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcpYT-00031T-IG for qemu-devel@nongnu.org; Fri, 18 Sep 2015 02:53:57 -0400 From: Markus Armbruster References: <1441619584-17992-1-git-send-email-pbonzini@redhat.com> <1441619584-17992-4-git-send-email-pbonzini@redhat.com> <55FAE3A9.5090907@redhat.com> <55FAEB33.50809@redhat.com> <55FAEDF8.70604@redhat.com> Date: Fri, 18 Sep 2015 08:53:54 +0200 In-Reply-To: <55FAEDF8.70604@redhat.com> (Eric Blake's message of "Thu, 17 Sep 2015 10:44:40 -0600") Message-ID: <87lhc49q0t.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Eric Blake Cc: QEMU Developers , Paolo Bonzini , Andreas Faerber , Eduardo Habkost , Peter Maydell Eric Blake writes: > On 09/17/2015 10:32 AM, Paolo Bonzini 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; > >> I think it varies depending on the maintainer. PPC, USB, SCSI, ACPI all >> use a separate typedef. I'll prepare a revert. > > And qapi is about to switch from inline to separate: > > https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg04291.html For a technical reason: DRY in the generator source code. For some types, we need the typedef name declared in one place, and the struct defined in another. Instead of having two variants, one for separate typedef / struct and one for combined, plus the logic to decide which one to use, we simply generate separate always.