qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Bandan Das <bsd@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children
Date: Thu, 05 Nov 2015 09:24:17 +0100	[thread overview]
Message-ID: <1446711857.30393.3.camel@redhat.com> (raw)
In-Reply-To: <1446595225-23608-2-git-send-email-bsd@redhat.com>

>  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.

> +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

  reply	other threads:[~2015-11-05  8:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04  0:00 [Qemu-devel] [PATCH 0/3] usb-mtp events support Bandan Das
2015-11-04  0:00 ` [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children Bandan Das
2015-11-05  8:24   ` Gerd Hoffmann [this message]
2015-11-05 21:23     ` Bandan Das
2015-11-04  0:00 ` [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring Bandan Das
2015-11-05  8:37   ` Gerd Hoffmann
2015-11-05 21:28     ` Bandan Das
2015-11-05  8:49   ` Gerd Hoffmann
2015-11-09 23:12     ` Bandan Das
2015-11-09 23:28       ` Bandan Das
2015-11-12  8:16       ` Gerd Hoffmann
2015-11-12 22:40         ` Bandan Das
2015-11-13  8:08           ` Gerd Hoffmann
2015-11-05  8:49   ` Gerd Hoffmann
2015-11-09 23:13     ` Bandan Das
2015-11-04  0:00 ` [Qemu-devel] [PATCH 3/3] usb-mtp: add support for basic mtp events Bandan Das
2015-11-05  8:41   ` Gerd Hoffmann
2015-11-05 21:30     ` Bandan Das

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=1446711857.30393.3.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=bsd@redhat.com \
    --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).