From nobody Mon Nov 25 09:57:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716397339; cv=none; d=zohomail.com; s=zohoarc; b=ba3yNfzJNP0z36W7bX28v4wDN65aafP+RSG08d0XWilgVd7pI1VRZ2bDwa/hgIiizYP6hrP2gh7YP9gxGJEvvdV4kORxKGzkeeN2epbX1/TU0DJKBlXqpATYF4lpqr7mHGtfZdt/155pxDECPu5AGF8LvqrFkx9R14TpevuV1Zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716397339; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+Z8qwgx2tbYux8MlEKpFhB/CS+fM9t1Ig/khgGvS7uY=; b=V5NxoCPddRF24rpUtIM4GX2QXISrUJFqxm0mjaW0ywGlBIENi5lGHFxWZy2Oc0DSp7OQVO4+eRQF6AZBpW8s2OuM4L8MGk49/LvAUbaB+wB76mQ0nJe+ksyQR7MjqjD8nK5ph0KlLYAwM8VCVvO0kiCzFvHVQafi0Z5WDAH1Row= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716397339099629.7145757703898; Wed, 22 May 2024 10:02:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9pLJ-0000Qp-Mr; Wed, 22 May 2024 13:01:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9pLI-0000QE-NZ for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9pL7-0006G9-35 for qemu-devel@nongnu.org; Wed, 22 May 2024 13:01:32 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-_Lm71GWaMWCg_o11oeFB0A-1; Wed, 22 May 2024 13:01:14 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 499B3380008A; Wed, 22 May 2024 17:01:14 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1AA55618; Wed, 22 May 2024 17:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716397279; 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=+Z8qwgx2tbYux8MlEKpFhB/CS+fM9t1Ig/khgGvS7uY=; b=Wsh1yfgtV6MzlpoPXD4kl+uheWoTblucQjO5sO8K9o6vuXl8+qkkYVvr4ubn96Gyn4p8yc qDvp+oexLUIxUxHs6lEclt0IunPjHByNZ82ILsG1yQIZD42ffWHJgM68bnbHmBgJn60+Oy rTwes6VVf5vJuGiRHMtkpV4e7eV5M1U= X-MC-Unique: _Lm71GWaMWCg_o11oeFB0A-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Zhenzhong Duan , Matthew Rosato , Eric Farman , Tony Krowiak , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool Date: Wed, 22 May 2024 19:01:02 +0200 Message-ID: <20240522170107.289532-3-clg@redhat.com> In-Reply-To: <20240522170107.289532-1-clg@redhat.com> References: <20240522170107.289532-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716397351395100003 Since the realize() handler of CCWDeviceClass takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. While at it, modify the call in s390_ccw_realize(). Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Anthony Krowiak Reviewed-by: Zhenzhong Duan --- hw/s390x/ccw-device.h | 2 +- hw/s390x/ccw-device.c | 3 ++- hw/s390x/s390-ccw.c | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 6dff95225df11c63f9b66975019026b215c8c448..5feeb0ee7a268b8709043b5bbc5= 6b06e707a448d 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -36,7 +36,7 @@ extern const VMStateDescription vmstate_ccw_dev; struct CCWDeviceClass { DeviceClass parent_class; void (*unplug)(HotplugHandler *, DeviceState *, Error **); - void (*realize)(CcwDevice *, Error **); + bool (*realize)(CcwDevice *, Error **); void (*refill_ids)(CcwDevice *); }; =20 diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c index fb8c1acc64d5002c861a4913f292d8346dbef192..a7d682e5af9ce90e7e2fad8c24b= 30e39328c7cf4 100644 --- a/hw/s390x/ccw-device.c +++ b/hw/s390x/ccw-device.c @@ -31,9 +31,10 @@ static void ccw_device_refill_ids(CcwDevice *dev) dev->subch_id.valid =3D true; } =20 -static void ccw_device_realize(CcwDevice *dev, Error **errp) +static bool ccw_device_realize(CcwDevice *dev, Error **errp) { ccw_device_refill_ids(dev); + return true; } =20 static Property ccw_device_properties[] =3D { diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index a06e91dfb318e3500324851488c56806fa46c08d..4b8ede701df90949720262b6fc1= b65f4e505e34d 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -137,8 +137,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char = *sysfsdev, Error **errp) goto out_err; } =20 - ck->realize(ccw_dev, &err); - if (err) { + if (!ck->realize(ccw_dev, &err)) { goto out_err; } =20 --=20 2.45.1