From patchwork Thu Feb 4 20:13:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 44551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 55792B7D5E for ; Fri, 5 Feb 2010 07:29:28 +1100 (EST) Received: from localhost ([127.0.0.1]:50429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd8J6-0007rT-T6 for incoming@patchwork.ozlabs.org; Thu, 04 Feb 2010 15:28:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd871-0002FV-0w for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:39 -0500 Received: from [199.232.76.173] (port=51265 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd870-0002F9-Hy for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:38 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd86y-00051D-Eb for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:38 -0500 Received: from mx20.gnu.org ([199.232.41.8]:11917) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nd86y-0004xZ-30 for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd86w-00042w-KQ for qemu-devel@nongnu.org; Thu, 04 Feb 2010 15:15:34 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14KFNvV019217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 15:15:23 -0500 Received: from localhost (vpn-9-202.rdu.redhat.com [10.11.9.202]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o14KFMKM022374 for ; Thu, 4 Feb 2010 15:15:23 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 4 Feb 2010 18:13:14 -0200 Message-Id: <1265314396-6583-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1265314396-6583-1-git-send-email-lcapitulino@redhat.com> References: <1265314396-6583-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [Qemu-devel] [PATCH 2/4] Monitor: remove unneeded checks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It's not needed to check the return of qobject_from_jsonf() anymore, as an assert() has been added there. Signed-off-by: Luiz Capitulino --- block.c | 3 --- hw/pci-hotplug.c | 1 - migration.c | 3 --- monitor.c | 5 ----- 4 files changed, 0 insertions(+), 12 deletions(-) diff --git a/block.c b/block.c index 1919d19..89d697e 100644 --- a/block.c +++ b/block.c @@ -1259,7 +1259,6 @@ void bdrv_info(Monitor *mon, QObject **ret_data) "'removable': %i, 'locked': %i }", bs->device_name, type, bs->removable, bs->locked); - assert(bs_obj != NULL); if (bs->drv) { QObject *obj; @@ -1270,7 +1269,6 @@ void bdrv_info(Monitor *mon, QObject **ret_data) bs->filename, bs->read_only, bs->drv->format_name, bdrv_is_encrypted(bs)); - assert(obj != NULL); if (bs->backing_file[0] != '\0') { QDict *qdict = qobject_to_qdict(obj); qdict_put(qdict, "backing_file", @@ -1356,7 +1354,6 @@ void bdrv_info_stats(Monitor *mon, QObject **ret_data) bs->device_name, bs->rd_bytes, bs->wr_bytes, bs->rd_ops, bs->wr_ops); - assert(obj != NULL); qlist_append_obj(devices, obj); } diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index ba13d2b..0fb96f0 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -285,7 +285,6 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data) qobject_from_jsonf("{ 'domain': 0, 'bus': %d, 'slot': %d, " "'function': %d }", pci_bus_num(dev->bus), PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - assert(*ret_data != NULL); } else monitor_printf(mon, "failed to add %s\n", opts); } diff --git a/migration.c b/migration.c index 5b28e42..6f26028 100644 --- a/migration.c +++ b/migration.c @@ -183,8 +183,6 @@ static void migrate_put_status(QDict *qdict, const char *name, obj = qobject_from_jsonf("{ 'transferred': %" PRId64 ", " "'remaining': %" PRId64 ", " "'total': %" PRId64 " }", trans, rem, total); - assert(obj != NULL); - qdict_put_obj(qdict, name, obj); } @@ -258,7 +256,6 @@ void do_info_migrate(Monitor *mon, QObject **ret_data) *ret_data = qobject_from_jsonf("{ 'status': 'cancelled' }"); break; } - assert(*ret_data != NULL); } } diff --git a/monitor.c b/monitor.c index a0ec7fc..cb7eb65 100644 --- a/monitor.c +++ b/monitor.c @@ -351,8 +351,6 @@ static void timestamp_put(QDict *qdict) obj = qobject_from_jsonf("{ 'seconds': %" PRId64 ", " "'microseconds': %" PRId64 " }", (int64_t) tv.tv_sec, (int64_t) tv.tv_usec); - assert(obj != NULL); - qdict_put_obj(qdict, "timestamp", obj); } @@ -897,7 +895,6 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data) obj = qobject_from_jsonf("{ 'CPU': %d, 'current': %i, 'halted': %i }", env->cpu_index, env == mon->mon_cpu, env->halted); - assert(obj != NULL); cpu = qobject_to_qdict(obj); @@ -4412,8 +4409,6 @@ static void monitor_control_event(void *opaque, int event) json_message_parser_init(&mon->mc->parser, handle_qmp_command); data = get_qmp_greeting(); - assert(data != NULL); - monitor_json_emitter(mon, data); qobject_decref(data); }