From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:42247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJztM-0006bu-SD for qemu-devel@nongnu.org; Fri, 26 Apr 2019 08:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJztL-00061V-Lm for qemu-devel@nongnu.org; Fri, 26 Apr 2019 08:23:48 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJztL-00060L-Fz for qemu-devel@nongnu.org; Fri, 26 Apr 2019 08:23:47 -0400 Received: by mail-wr1-f68.google.com with SMTP id a12so4151873wrq.10 for ; Fri, 26 Apr 2019 05:23:47 -0700 (PDT) References: <20190419075625.24251-1-thuth@redhat.com> <84638796-204e-3f43-3fe1-f5329e9cd466@redhat.com> <201457a3-d297-16ce-e375-f6ede5679492@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <58fd604a-7c72-a0f5-14fe-777146ed3d80@redhat.com> Date: Fri, 26 Apr 2019 14:23:44 +0200 MIME-Version: 1.0 In-Reply-To: <201457a3-d297-16ce-e375-f6ede5679492@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 for-4.1 0/2] Fix ohci_die() and move PCI code to separate file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , qemu-devel@nongnu.org, Gerd Hoffmann Cc: Paolo Bonzini On 4/26/19 2:20 PM, Thomas Huth wrote: > On 26/04/2019 14.14, Philippe Mathieu-Daudé wrote: >> On 4/26/19 7:42 AM, Thomas Huth wrote: >>> On 26/04/2019 00.55, Philippe Mathieu-Daudé wrote: >>>> Hi Thomas, >>>> >>>> On 4/19/19 9:56 AM, Thomas Huth wrote: >>>>> First patch fixes a problem with ohci_die(), second patch moves PCI code into >>>>> a separate file, so that the sysbus OHCI device can also be used without >>>>> the dependency on the PCI code. >>>>> >>>>> v2: Split the patch into two patches, one for the ohci_die() fix and one >>>>> for the PCI code movement. >>>> >>>> Way cleaner. I wonder why you don't use a typedef for the void >>>> (*ohci_die_fn)(struct OHCIState *) prototype. >>> >>> It does not work in that case: >>> >>> typedef struct OHCIState { // <-- struct OHCIState definition >>> [...] >>> uint32_t async_td; >>> bool async_complete; >>> >>> void (*ohci_die)(struct OHCIState *ohci); // <-- ohci_die definition >>> } OHCIState; // <-- typedef OHCIState definition >>> >>> The typedef is defined after the ohci_die entry. >> >> I was thinking of forward declaration: >> >> typedef struct OHCIState OHCIState; >> >> typedef void (ohci_die_fn)(OHCIState *ohci); > > Could work, too, but I don't like typedeferities... so unless Gerd > forces me to use that here, I'd prefer to keep the patch in its current > shape. Fine with me ;)