[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 14/19] dev-hid: convert init to realize
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH 14/19] dev-hid: convert init to realize |
Date: |
Thu, 18 Sep 2014 10:23:39 +0000 |
> From: Paolo Bonzini [mailto:address@hidden
> Sent: Thursday, September 18, 2014 6:16 PM
> Subject: Re: [PATCH 14/19] dev-hid: convert init to realize
>
> Il 18/09/2014 11:32, address@hidden ha scritto:
> > From: Gonglei <address@hidden>
> >
> > In this way, all the implementations now use
> > error_setg instead of error_report for reporting error.
> >
> > Signed-off-by: Gonglei <address@hidden>
> > ---
> > hw/usb/dev-hid.c | 23 +++++++++++------------
> > 1 file changed, 11 insertions(+), 12 deletions(-)
> >
> > diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c
> > index 67a57f1..7e9d2d6 100644
> > --- a/hw/usb/dev-hid.c
> > +++ b/hw/usb/dev-hid.c
> > @@ -582,7 +582,7 @@ static int usb_hid_initfn(USBDevice *dev, int kind)
> > return 0;
>
> Please change usb_hid_initfn to return void.
>
OK.
> > }
> >
> > -static int usb_tablet_initfn(USBDevice *dev)
> > +static void usb_tablet_realize(USBDevice *dev, Error **errp)
> > {
> > USBHIDState *us = DO_UPCAST(USBHIDState, dev, dev);
> >
> > @@ -594,22 +594,21 @@ static int usb_tablet_initfn(USBDevice *dev)
> > dev->usb_desc = &desc_tablet2;
> > break;
> > default:
> > - error_report("Invalid usb version %d for usb-tabler (must be 1 or
> 2)",
> > - us->usb_version);
> > - return -1;
> > + error_setg(errp, "Invalid usb version %d for usb-tablet "
> > + "(must be 1 or 2)", us->usb_version);
>
> Missing return here.
>
Good catch! Will fix it in v2. Thanks a lot!
Best regards,
-Gonglei
- [Qemu-devel] [PATCH 10/19] dev-uas: using error_report instead of fprintf, (continued)
- [Qemu-devel] [PATCH 10/19] dev-uas: using error_report instead of fprintf, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 18/19] usb-mtp: convert init to realize, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 19/19] usb-bus: remove "init" from USBDeviceClass struct, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 13/19] usb-ccid: convert init to realize, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 14/19] dev-hid: convert init to realize, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 16/19] usb-audio: convert init to realize, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 15/19] dev-wacom: convert init to realize, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 09/19] dev-uas: convert init to realize, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 05/19] libusb: using error_report instead of fprintf, arei.gonglei, 2014/09/18
- [Qemu-devel] [PATCH 11/19] dev-bluetooth: convert init to realize, arei.gonglei, 2014/09/18