From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCqpl-0000uh-2l for qemu-devel@nongnu.org; Thu, 31 Jul 2014 09:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCqpg-00088r-8h for qemu-devel@nongnu.org; Thu, 31 Jul 2014 09:55:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCqpg-00087q-0k for qemu-devel@nongnu.org; Thu, 31 Jul 2014 09:55:48 -0400 Date: Thu, 31 Jul 2014 14:55:02 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140731135501.GH2405@work-vm> References: <1406809740-10836-1-git-send-email-arei.gonglei@huawei.com> <1406809740-10836-5-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406809740-10836-5-git-send-email-arei.gonglei@huawei.com> Subject: Re: [Qemu-devel] [PATCH 4/7] a trivial code change for more idiomatic writing style List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: peter.maydell@linaro.org, weidong.huang@huawei.com, stefanha@redhat.com, mst@redhat.com, marcel.a@redhat.com, luonengjun@huawei.com, qemu-devel@nongnu.org, armbru@redhat.com, av1474@comtv.ru, kraxel@redhat.com, aliguori@amazon.com, imammedo@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, peter.huangpeng@huawei.com, lcapitulino@redhat.com, afaerber@suse.de * arei.gonglei@huawei.com (arei.gonglei@huawei.com) wrote: > From: Gonglei > > Signed-off-by: Gonglei > --- > qdev-monitor.c | 2 +- > qemu-char.c | 2 +- > util/qemu-sockets.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/qdev-monitor.c b/qdev-monitor.c > index f87f3d8..3e30d38 100644 > --- a/qdev-monitor.c > +++ b/qdev-monitor.c > @@ -694,7 +694,7 @@ void qmp_device_del(const char *id, Error **errp) > DeviceState *dev; > > dev = qdev_find_recursive(sysbus_get_default(), id); > - if (NULL == dev) { > + if (dev == NULL) { I know people who write it as 'NULL == dev' on purpose, because that will cause an error if you accidentally type a single = where as 'dev = NULL' will just cause confusion. Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK