From patchwork Fri Aug 1 02:32:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gonglei (Arei)" X-Patchwork-Id: 375508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2E58014003E for ; Fri, 1 Aug 2014 12:36:49 +1000 (EST) Received: from localhost ([::1]:59395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XD2i7-0002B6-BY for incoming@patchwork.ozlabs.org; Thu, 31 Jul 2014 22:36:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XD2f6-0005gz-Tb for qemu-devel@nongnu.org; Thu, 31 Jul 2014 22:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XD2f1-0005K4-VE for qemu-devel@nongnu.org; Thu, 31 Jul 2014 22:33:40 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:4143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XD2f1-0005HC-5y for qemu-devel@nongnu.org; Thu, 31 Jul 2014 22:33:35 -0400 Received: from 172.24.2.119 (EHLO szxeml410-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BXK67444; Fri, 01 Aug 2014 10:33:03 +0800 (CST) Received: from localhost (10.177.19.102) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Fri, 1 Aug 2014 10:32:55 +0800 From: To: Date: Fri, 1 Aug 2014 10:32:39 +0800 Message-ID: <1406860365-5516-3-git-send-email-arei.gonglei@huawei.com> X-Mailer: git-send-email 1.7.3.1.msysgit.0 In-Reply-To: <1406860365-5516-1-git-send-email-arei.gonglei@huawei.com> References: <1406860365-5516-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.19.102] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, weidong.huang@huawei.com, stefanha@redhat.com, mst@redhat.com, marcel.a@redhat.com, luonengjun@huawei.com, armbru@redhat.com, lcapitulino@redhat.com, Gonglei , av1474@comtv.ru, kraxel@redhat.com, aliguori@amazon.com, imammedo@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, peter.huangpeng@huawei.com, afaerber@suse.de, dgilbert@redhat.com Subject: [Qemu-devel] [PATCH v2 2/8] usb: a trivial code change for more idiomatic writing style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-audio.c | 2 +- hw/usb/dev-mtp.c | 4 ++-- hw/usb/hcd-ehci.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index bfebfe9..988f6cc 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -371,7 +371,7 @@ static void output_callback(void *opaque, int avail) return; } data = streambuf_get(&s->out.buf); - if (NULL == data) { + if (data == NULL) { return; } AUD_write(s->out.voice, data, USBAUDIO_PACKET_SIZE); diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 384d4a5..0820046 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -832,7 +832,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c) return; } data_in = usb_mtp_get_object(s, c, o); - if (NULL == data_in) { + if (data_in == NULL) { usb_mtp_queue_result(s, RES_GENERAL_ERROR, c->trans, 0, 0, 0); return; @@ -851,7 +851,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c) return; } data_in = usb_mtp_get_partial_object(s, c, o); - if (NULL == data_in) { + if (data_in == NULL) { usb_mtp_queue_result(s, RES_GENERAL_ERROR, c->trans, 0, 0, 0); return; diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index a00a93c..448e007 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1596,7 +1596,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) entry = ehci_get_fetch_addr(ehci, async); q = ehci_find_queue_by_qh(ehci, entry, async); - if (NULL == q) { + if (q == NULL) { q = ehci_alloc_queue(ehci, entry, async); }