From nobody Mon Feb 9 22:24:37 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594246315; cv=none; d=zohomail.com; s=zohoarc; b=d3HMDQXKIhWDyj9s+QKzTMY4yhe286NRX2oWGTBtjCIXhcMeF+S6PkunRrCg1tS9srPPhOGNUU3XVlE0nfrIUCn+hTIf8yW/VCfLjM15SBsg6Rh6I2z9fQvSUNaNt5KTMfOd9yPSH5eRHKO0GqrlY61TfyyDBGK2Plhrq8j6nYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594246315; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nwtEnvGM0KUGrkSlt/EYsca1fPXadzeawI4DMdJ6CBc=; b=KaJ+73T57vhB6iP0EWumxtwCsVvCMnkTVSk6Fi21y+Uca77OiRdgqwxIvGQM1vY5+z2ch4yMg2nMFcM+Q9TJMooiPg6j+7m8O2i1dUIPh2sdrdtt/sd+1sGTwtuMfaKne2nrXPsi8nauS2T/dMSap29tC79WdG2FC6tZDncrZjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594246315501178.05597787498584; Wed, 8 Jul 2020 15:11:55 -0700 (PDT) Received: from localhost ([::1]:58470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtIIE-0005od-8E for importer@patchew.org; Wed, 08 Jul 2020 18:11:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtHkm-0005AA-RR for qemu-devel@nongnu.org; Wed, 08 Jul 2020 17:37:20 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20434 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jtHkk-0003Ke-VA for qemu-devel@nongnu.org; Wed, 08 Jul 2020 17:37:20 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-108-kb3BZbOlOT6UUHp9k8RMsg-1; Tue, 07 Jul 2020 17:25:19 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28A7F1005510; Tue, 7 Jul 2020 21:25:18 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-143.ams2.redhat.com [10.36.112.143]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6E1910013C2; Tue, 7 Jul 2020 21:25:17 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7C75A11275F7; Tue, 7 Jul 2020 23:25:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594244236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nwtEnvGM0KUGrkSlt/EYsca1fPXadzeawI4DMdJ6CBc=; b=AD2Se/FzK8Mbn9O039sxNlbdLlojqe7m9aD+UFWd6uXNiodi0uzmmOcWHfJgnChi/w5ZfU YKXLQYOSRDTWVLe9R+D6MffrIetYXMxFfhhMatov0FUCrPJK7fuj0Golfop0A0TT0aTwKH tZDKceFTgQoPLLpwkBWAb/O0nHeGlZk= X-MC-Unique: kb3BZbOlOT6UUHp9k8RMsg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 29/53] qom: Use returned bool to check for failure, manual part Date: Tue, 7 Jul 2020 23:24:39 +0200 Message-Id: <20200707212503.1495927-30-armbru@redhat.com> In-Reply-To: <20200707212503.1495927-1-armbru@redhat.com> References: <20200707212503.1495927-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/07 17:25:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The previous commit used Coccinelle to convert from checking the Error object to checking the return value. Convert a few more manually. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200707160613.848843-30-armbru@redhat.com> --- hw/core/bus.c | 6 +----- hw/core/qdev.c | 7 +------ hw/s390x/s390-virtio-ccw.c | 13 +++++++------ 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/hw/core/bus.c b/hw/core/bus.c index 00d1d31762..6b987b6946 100644 --- a/hw/core/bus.c +++ b/hw/core/bus.c @@ -166,11 +166,7 @@ BusState *qbus_create(const char *typename, DeviceStat= e *parent, const char *nam =20 bool qbus_realize(BusState *bus, Error **errp) { - Error *err =3D NULL; - - object_property_set_bool(OBJECT(bus), "realized", true, &err); - error_propagate(errp, err); - return !err; + return object_property_set_bool(OBJECT(bus), "realized", true, errp); } =20 void qbus_unrealize(BusState *bus) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d6416fb894..17bd8fc2ec 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -386,8 +386,6 @@ void qdev_simple_device_unplug_cb(HotplugHandler *hotpl= ug_dev, */ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp) { - Error *err =3D NULL; - assert(!dev->realized && !dev->parent_bus); =20 if (bus) { @@ -396,10 +394,7 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Err= or **errp) assert(!DEVICE_GET_CLASS(dev)->bus_type); } =20 - if (!object_property_set_bool(OBJECT(dev), "realized", true, &err)) { - error_propagate(errp, err); - } - return !err; + return object_property_set_bool(OBJECT(dev), "realized", true, errp); } =20 /* diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1a171f0c96..20e8e95c61 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -69,19 +69,20 @@ static S390CPU *s390x_new_cpu(const char *typename, uin= t32_t core_id, { S390CPU *cpu =3D S390_CPU(object_new(typename)); Error *err =3D NULL; + S390CPU *ret =3D NULL; =20 if (!object_property_set_int(OBJECT(cpu), "core-id", core_id, &err)) { goto out; } - qdev_realize(DEVICE(cpu), NULL, &err); + if (!qdev_realize(DEVICE(cpu), NULL, &err)) { + goto out; + } + ret =3D cpu; =20 out: object_unref(OBJECT(cpu)); - if (err) { - error_propagate(errp, err); - cpu =3D NULL; - } - return cpu; + error_propagate(errp, err); + return ret; } =20 static void s390_init_cpus(MachineState *machine) --=20 2.26.2