From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuFqM-0005d1-GK for qemu-devel@nongnu.org; Thu, 05 Nov 2015 03:24:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuFqH-00031B-JY for qemu-devel@nongnu.org; Thu, 05 Nov 2015 03:24:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuFqH-00030m-Dm for qemu-devel@nongnu.org; Thu, 05 Nov 2015 03:24:21 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EDCB4935D1 for ; Thu, 5 Nov 2015 08:24:19 +0000 (UTC) Message-ID: <1446711857.30393.3.camel@redhat.com> From: Gerd Hoffmann Date: Thu, 05 Nov 2015 09:24:17 +0100 In-Reply-To: <1446595225-23608-2-git-send-email-bsd@redhat.com> References: <1446595225-23608-1-git-send-email-bsd@redhat.com> <1446595225-23608-2-git-send-email-bsd@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bandan Das Cc: qemu-devel@nongnu.org > 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