From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 6/6] dev-storage: Fix the unusual function name
Date: Fri, 4 Aug 2017 13:26:20 -0300 [thread overview]
Message-ID: <cb43d13f-e86b-2f25-8f69-65534d09aa27@amsat.org> (raw)
In-Reply-To: <11364022c248d196c455ac25bb50b611a01e096c.1501827395.git.maozy.fnst@cn.fujitsu.com>
On 08/04/2017 07:26 AM, Mao Zhongyi wrote:
> The function name of usb_msd_{realize,unrealize}_*,
> usb_msd_class_initfn_* are unusual. Rename it to
> usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn.
>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
>
> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/usb/dev-storage.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
> index 801f552..2a05cd5 100644
> --- a/hw/usb/dev-storage.c
> +++ b/hw/usb/dev-storage.c
> @@ -596,7 +596,7 @@ static void usb_msd_unrealize_storage(USBDevice *dev, Error **errp)
> object_unref(OBJECT(&s->bus));
> }
>
> -static void usb_msd_realize_storage(USBDevice *dev, Error **errp)
> +static void usb_msd_storage_realize(USBDevice *dev, Error **errp)
> {
> MSDState *s = USB_STORAGE_DEV(dev);
> BlockBackend *blk = s->conf.blk;
> @@ -643,14 +643,14 @@ static void usb_msd_realize_storage(USBDevice *dev, Error **errp)
> s->scsi_dev = scsi_dev;
> }
>
> -static void usb_msd_unrealize_bot(USBDevice *dev, Error **errp)
> +static void usb_msd_bot_unrealize(USBDevice *dev, Error **errp)
> {
> MSDState *s = USB_STORAGE_DEV(dev);
>
> object_unref(OBJECT(&s->bus));
> }
>
> -static void usb_msd_realize_bot(USBDevice *dev, Error **errp)
> +static void usb_msd_bot_realize(USBDevice *dev, Error **errp)
> {
> MSDState *s = USB_STORAGE_DEV(dev);
> DeviceState *d = DEVICE(dev);
> @@ -764,12 +764,12 @@ static void usb_msd_class_initfn_common(ObjectClass *klass, void *data)
> dc->vmsd = &vmstate_usb_msd;
> }
>
> -static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data)
> +static void usb_msd_class_storage_initfn(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
>
> - uc->realize = usb_msd_realize_storage;
> + uc->realize = usb_msd_storage_realize;
> uc->unrealize = usb_msd_unrealize_storage;
> dc->props = msd_properties;
> }
> @@ -828,26 +828,26 @@ static void usb_msd_instance_init(Object *obj)
> object_property_set_int(obj, -1, "bootindex", NULL);
> }
>
> -static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data)
> +static void usb_msd_class_bot_initfn(ObjectClass *klass, void *data)
> {
> USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
>
> - uc->realize = usb_msd_realize_bot;
> - uc->unrealize = usb_msd_unrealize_bot;
> + uc->realize = usb_msd_bot_realize;
> + uc->unrealize = usb_msd_bot_unrealize;
> uc->attached_settable = true;
> }
>
> static const TypeInfo msd_info = {
> .name = "usb-storage",
> .parent = TYPE_USB_STORAGE,
> - .class_init = usb_msd_class_initfn_storage,
> + .class_init = usb_msd_class_storage_initfn,
> .instance_init = usb_msd_instance_init,
> };
>
> static const TypeInfo bot_info = {
> .name = "usb-bot",
> .parent = TYPE_USB_STORAGE,
> - .class_init = usb_msd_class_initfn_bot,
> + .class_init = usb_msd_class_bot_initfn,
> };
>
> static void usb_msd_register_types(void)
>
prev parent reply other threads:[~2017-08-04 16:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 10:26 [Qemu-devel] [PATCH v2 0/6] Convert to realize and improve error handling Mao Zhongyi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize Mao Zhongyi
2017-09-15 21:35 ` John Snow
2017-09-15 21:42 ` Eric Blake
2017-09-15 21:46 ` John Snow
2017-09-15 22:03 ` [Qemu-devel] [Qemu-block] " John Snow
2017-09-18 1:37 ` Mao Zhongyi
2017-09-18 1:35 ` [Qemu-devel] " Mao Zhongyi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 2/6] hw/block/fdc: Convert " Mao Zhongyi
2017-09-15 22:12 ` John Snow
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 3/6] hw/block/nvme: " Mao Zhongyi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 4/6] hw/block: Fix the return type Mao Zhongyi
2017-08-04 12:53 ` Stefan Hajnoczi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 5/6] hw/block: Use errp directly rather than local_err Mao Zhongyi
2017-08-04 12:53 ` Stefan Hajnoczi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 6/6] dev-storage: Fix the unusual function name Mao Zhongyi
2017-08-04 16:26 ` Philippe Mathieu-Daudé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb43d13f-e86b-2f25-8f69-65534d09aa27@amsat.org \
--to=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=maozy.fnst@cn.fujitsu.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).