usb-ohci: return USBBus in usb_ohci_init_pci
PATCH 1/1 usb-ohci: return USBBus in usb_ohci_init_pci
Untested, but seemingly obvious and hard to screw up..
--- hw/usb-ohci.c | 7 +++++-- hw/usb-ohci.h | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-)
hw/usb-ohci.c +5 -2
@@ -1810,9 +1810,12 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev)return 0 ; } -void usb_ohci_init_pci (struct PCIBus *bus,int devfn) +USBBus *usb_ohci_init_pci (struct PCIBus *bus,int devfn) { -pci_create_simple (bus, devfn,"pci-ohci" ); +PCIDevice *dev =pci_create_simple (bus, devfn,"pci-ohci" ); +OHCIPCIState *ohci =DO_UPCAST (OHCIPCIState, pci_dev, dev); + + return &ohci->state.bus } typedef struct {
hw/usb-ohci.h +2 -1
@@ -2,8 +2,9 @@#define QEMU_USB_OHCI_H #include "qemu-common.h" +#include "usb.h" -void usb_ohci_init_pci (struct PCIBus *bus,int devfn); +USBBus *usb_ohci_init_pci (struct PCIBus *bus,int devfn);#endif
Signature · 1 line
1.7.4.1
Quoted 1 line · Anthony Liguori
Untested, but seemingly obvious and hard to screw up..
Sounds like a challenge so let's take a look...
hw/usb-ohci.c static int usb_ohci_initfn_pci(struct PCIDevice *dev) · line 1818
Quoted 8 lines
hw/usb-ohci.c +5
-2-void usb_ohci_init_pci (struct PCIBus *bus,int devfn) +USBBus *usb_ohci_init_pci (struct PCIBus *bus,int devfn) { -pci_create_simple (bus, devfn,"pci-ohci" ); +PCIDevice *dev =pci_create_simple (bus, devfn,"pci-ohci" ); +OHCIPCIState *ohci =DO_UPCAST (OHCIPCIState, pci_dev, dev); + +return &ohci->state.bus
Missing semicolon.
Stefan
Quoted 5 lines · Stefan Hajnoczi
Quoted 1 line · Anthony Liguori
Untested, but seemingly obvious and hard to screw up..
Sounds like a challenge so let's take a look...
Quoted 10 lines
hw/usb-ohci.c static int usb_ohci_initfn_pci(struct PCIDevice *dev)
Quoted 8 lines
hw/usb-ohci.c +5
-2-void usb_ohci_init_pci (struct PCIBus *bus,int devfn) +USBBus *usb_ohci_init_pci (struct PCIBus *bus,int devfn) { -pci_create_simple (bus, devfn,"pci-ohci" ); +PCIDevice *dev =pci_create_simple (bus, devfn,"pci-ohci" ); +OHCIPCIState *ohci =DO_UPCAST (OHCIPCIState, pci_dev, dev); + +return &ohci->state.busMissing semicolon.
Heh, awesome :-) Okay, I'll actually test it next time.
Regards,
Anthony Liguori
Quoted 4 lines
Stefan
Hi,
Quoted 1 line
Heh, awesome :-) Okay, I'll actually test it next time.
Could you also add some justification for the change to the commit message please? Just for itself the change looks somewhat odd as there is no obvious reason for it ...
thanks,
Gerd
Quoted 7 lines · Gerd Hoffmann
Hi,Quoted 1 line
Heh, awesome :-) Okay, I'll actually test it next time.
Could you also add some justification for the change to the commit message please? Just for itself the change looks somewhat odd as there is no obvious reason for it ...
Yup.
Regards,
Anthony Liguori
Quoted 4 lines
thanks,
Gerd