[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of ch
From: |
Bandan Das |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children |
Date: |
Thu, 05 Nov 2015 16:23:16 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Gerd Hoffmann <address@hidden> writes:
>> static void usb_mtp_object_free(MTPState *s, MTPObject *o)
>> {
>> - int i;
>> + MTPObject *iter;
>> +
>> + if (o) {
>> + trace_usb_mtp_object_free(s->dev.addr, o->handle, o->path);
>
> That also makes usb_mtp_object_free callable with o == NULL. Makes
> sense, but also makes this patch hard to review. Please consider either
> splitting this out into a separate patch or code this as "if (!o)
> { return; }" so the intention of the remaining code doesn't change.
Sure, I will split up the call to usb_mtp_object_free() during reset
to a separate patch and change the check here to if (!o).
Bandan
>> +static MTPObject *usb_mtp_add_child(MTPState *s, MTPObject *o,
>> + char *name)
>> +{
>> + MTPObject *child =
>> + usb_mtp_object_alloc(s, s->next_handle++, o, name);
>> +
>> + if (child) {
>> + trace_usb_mtp_add_child(s->dev.addr, child->handle, child->path);
>> + QLIST_INSERT_HEAD(&o->children, child, list);
>> + o->nchildren++;
>> +
>> + if (child->format == FMT_ASSOCIATION) {
>> + QLIST_INIT(&child->children);
>> + }
>> +
>> + }
>> +
>> + return child;
>> +}
>
> Separate patch please.
>
> cheers,
> Gerd
- [Qemu-devel] [PATCH 0/3] usb-mtp events support, Bandan Das, 2015/11/03
- [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children, Bandan Das, 2015/11/03
- [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Bandan Das, 2015/11/03
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Gerd Hoffmann, 2015/11/05
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Gerd Hoffmann, 2015/11/05
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Bandan Das, 2015/11/09
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Bandan Das, 2015/11/09
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Gerd Hoffmann, 2015/11/12
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Bandan Das, 2015/11/12
- Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Gerd Hoffmann, 2015/11/13
Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Gerd Hoffmann, 2015/11/05