qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]