From nobody Sun Feb 8 20:46:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15002959413171019.3855117911235; Mon, 17 Jul 2017 05:52:21 -0700 (PDT) Received: from localhost ([::1]:50190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX5Vb-000533-2B for importer@patchew.org; Mon, 17 Jul 2017 08:52:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX5Oi-00081G-4X for qemu-devel@nongnu.org; Mon, 17 Jul 2017 08:45:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX5Oh-0002Lw-AQ for qemu-devel@nongnu.org; Mon, 17 Jul 2017 08:45:12 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX5Oh-0002Ci-4g for qemu-devel@nongnu.org; Mon, 17 Jul 2017 08:45:11 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dX5OR-0003RN-LY for qemu-devel@nongnu.org; Mon, 17 Jul 2017 13:44:55 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 17 Jul 2017 13:44:37 +0100 Message-Id: <1500295494-8991-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500295494-8991-1-git-send-email-peter.maydell@linaro.org> References: <1500295494-8991-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 01/18] qdev-properties.h: Explicitly set the default value for arraylen properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-ZohoMail: RSF_0 Z_629925259 SPT_0 In DEFINE_PROP_ARRAY, because we use a PropertyInfo (qdev_prop_arraylen) which has a .set_default_value member we will set the field to a default value. That default value will be zero, by the C rule that struct initialization sets unmentioned members to zero if at least one member is initialized. However it's clearer to state it explicitly. Signed-off-by: Peter Maydell Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 1499788408-10096-2-git-send-email-peter.maydell@linaro.org --- include/hw/qdev-properties.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index f6692d5..12c0c7b 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -111,6 +111,7 @@ extern const PropertyInfo qdev_prop_link; _arrayfield, _arrayprop, _arraytype) { \ .name =3D (PROP_ARRAY_LEN_PREFIX _name), \ .info =3D &(qdev_prop_arraylen), \ + .defval.u =3D 0, \ .offset =3D offsetof(_state, _field) \ + type_check(uint32_t, typeof_field(_state, _field)), \ .arrayinfo =3D &(_arrayprop), \ --=20 2.7.4