From nobody Wed Feb 11 00:55:48 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; 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=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1601215186; cv=none; d=zohomail.com; s=zohoarc; b=bjzVvSJz9YMHRQiTGEM8yGK1q4SPeby4sxGSDJ2T7spFFXK2f2WA/IiJMBJG701vYZhQ3cxzLBVh6BzsdpOvQr1amrXC9dpxEkjPdVhNJlh7AaJj8KZwPZSxz3+GSS/jLacJgRvSq/oTJbgqI3CqT156kXPEecwMVLUe4+wKO3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601215186; 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=LmpCmhWAanboPeYOdrKr0115M0t+Eury8wLBHs5Jc1U=; b=Xe15J+lMRu7V96EE8AlaS8HqRAi6gMbh5Nbb1BJ8CzHzp0VTUiJH07DmU+iizR8mxnJhtmot3W07bIeLdZp7QH/hQqVJ4QaBJn906G8+vqlkPHqsdiA7Zj7t2BGPr0uihXsL/aiKOfYGCY2ZJxCXVPgGBo85IhzfF3xYE+haT0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; 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 1601215186552803.0906561412756; Sun, 27 Sep 2020 06:59:46 -0700 (PDT) Received: from localhost ([::1]:33390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMXDN-0001V1-9y for importer@patchew.org; Sun, 27 Sep 2020 09:59:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMXAw-0006xK-Ol for qemu-devel@nongnu.org; Sun, 27 Sep 2020 09:57:14 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:35119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMXAv-0000N8-3E for qemu-devel@nongnu.org; Sun, 27 Sep 2020 09:57:14 -0400 Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 27 Sep 2020 21:57:07 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 06:44:03 -0700 Received: from usa003000.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.60.38]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Sep 2020 06:57:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1601215032; x=1632751032; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OeMxlU99iPdNNbIiRbMZWU89GNi9nzVJwZpprmXgZF8=; b=l3AiGlacw++82BUO7ctn4tamiRz7KZUCz84ECocCZBz/7bOb4Wrhy2Hc fc1mlk9wMksULjiYbFDDel/eGWA8vGwB9KwEQXfQpLROume4g2wcOolqD SNGC6lo/a6Icjae2PYZ065Z+OQey4ssgGDbBQqYuT6c8sga0rQAtuevsJ xaDMbGuNlaZIXIe4Hm0QieAXmtfYKa6zmQJxCd7HSl8b6KTFOj2+kKn1M e0V3oICh9QC9KzMid2n9AnfLrh2s9RnbzsbIl1EQB3bO/2JX2pAA+eFSa 2+IwGMvjcvrvn++A92Hze7iSyAezvEPVyXVg706mkhaXVucN3HbkVZo7u g==; IronPort-SDR: t6TyMuF/5NMBm57vJJ0QbyU3d/kOKV6NapmTGiHskd+rudLYu0XvjSzY7c+XW98cafc3d7chmf Fr4k4Ddjr1Z9cvQR3Be0YlgnxWFck00FXMXHKbR7WbrOe1RscYzFRc185IpptnSIHaP8bAKV1N bY4xo74kO7r2xA66p5OdbL1sS6apL1qwk0jM06FHiWGGgJ70xUF9UZZGdOX0HI1HiRN7r7jHpp j9yopOF8yoHlG+sdfhpRtMZIWikuq+TSmiQbXQpDAzatbXzpx08AP8RZQFPDF6edw5Gtq2/m42 rog= X-IronPort-AV: E=Sophos;i="5.77,310,1596470400"; d="scan'208";a="148291512" IronPort-SDR: GoIx6DazgXGkq515AH5XgF4/Ab2ToKOm2dHOq511GE0cSvRbAYVbiowxT6vzZ9hUFiiNdAFOY0 txSrI4i5DW9g== IronPort-SDR: FM8VWuOZnNk1mp3BdJJXYmuWJubIo05cdIcNQSsNzu7e6P18ovBQ5xee3bCfjxoXlBCihtdBQg t/aKlS38todw== WDCIronportException: Internal From: Alistair Francis To: qemu-devel@nongnu.org Subject: [PULL 2/2] core/register: Specify instance_size in the TypeInfo Date: Sun, 27 Sep 2020 06:46:09 -0700 Message-Id: <20200927134609.2358960-3-alistair.francis@wdc.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200927134609.2358960-1-alistair.francis@wdc.com> References: <20200927134609.2358960-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=216.71.154.42; envelope-from=prvs=5325bd5c7=alistair.francis@wdc.com; helo=esa4.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 09:57:06 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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: alistair23@gmail.com, Alistair Francis , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Reported-by: Eduardo Habkost Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <4cf1beb7dafb9143c261d266557d3173bf160524.1598376594.git.alista= ir.francis@wdc.com> --- hw/core/register.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/hw/core/register.c b/hw/core/register.c index ddf91eb445..31038bd7cc 100644 --- a/hw/core/register.c +++ b/hw/core/register.c @@ -176,17 +176,6 @@ void register_reset(RegisterInfo *reg) } } =20 -void register_init(RegisterInfo *reg) -{ - assert(reg); - - if (!reg->data || !reg->access) { - return; - } - - object_initialize((void *)reg, sizeof(*reg), TYPE_REGISTER); -} - void register_write_memory(void *opaque, hwaddr addr, uint64_t value, unsigned size) { @@ -269,13 +258,18 @@ static RegisterInfoArray *register_init_block(DeviceS= tate *owner, int index =3D rae[i].addr / data_size; RegisterInfo *r =3D &ri[index]; =20 - *r =3D (RegisterInfo) { - .data =3D data + data_size * index, - .data_size =3D data_size, - .access =3D &rae[i], - .opaque =3D owner, - }; - register_init(r); + if (data + data_size * index =3D=3D 0 || !&rae[i]) { + continue; + } + + /* Init the register, this will zero it. */ + object_initialize((void *)r, sizeof(*r), TYPE_REGISTER); + + /* Set the properties of the register */ + r->data =3D data + data_size * index; + r->data_size =3D data_size; + r->access =3D &rae[i]; + r->opaque =3D owner; =20 r_array->r[i] =3D r; } @@ -329,6 +323,7 @@ static const TypeInfo register_info =3D { .name =3D TYPE_REGISTER, .parent =3D TYPE_DEVICE, .class_init =3D register_class_init, + .instance_size =3D sizeof(RegisterInfo), }; =20 static void register_register_types(void) --=20 2.28.0