[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects |
Date: |
Tue, 13 Feb 2018 13:07:22 +0100 |
User-agent: |
NeoMutt/20171215 |
> +#ifndef CONFIG_INOTIFY1
> +/* Assumes that children, if any, have been already freed */
> +static void usb_mtp_object_free_one(MTPState *s, MTPObject *o)
> +{
> + assert(o->nchildren == 0);
> + QTAILQ_REMOVE(&s->objects, o, next);
> + g_free(o->name);
> + g_free(o->path);
> + g_free(o);
> +}
> +#endif
I'd suggest to move the #ifdef into the function, so it can be called
unconditinally. Also #else /* not needed with inotify because ... */
would be nice.
> +#ifndef CONFIG_INOTIFY1
> + usb_mtp_object_free_one(s, o);
> +#endif
These ifdefs can be dropped then.
> + /* Mark store as RW */
> + s->flags |= (1 << MTP_FLAG_WRITABLE);
Do we want a property to enable write support?
cheers,
Gerd
- [Qemu-devel] [PATCH v2 0/5] Initial write support for MTP object, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 2/5] usb-mtp: print parent path in IN_IGNORED trace fn, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 5/5] usb-mtp: Advertise SendObjectInfo for write support, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects, Bandan Das, 2018/02/12
- Re: [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH v2 1/5] usb-mtp: Add one more argument when building results, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 4/5] usb-mtp: Introduce write support for MTP objects, Bandan Das, 2018/02/12