From patchwork Mon Dec 16 03:51:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 851223 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp2657896wry; Sun, 15 Dec 2024 19:54:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUWj/z+5WmkYkNZkQ/ecOaZc2GbkoZoT2odGhosKI4A/3PvoEgXnt3/70H7SmiFIxu3rwIFHQ==@linaro.org X-Google-Smtp-Source: AGHT+IGrQRYSu3146QPnd4Cx52VHDNTlz0M+YVooyr++pRr63nywNMBt0c9AKZ//mM2mPrstFpZq X-Received: by 2002:a05:620a:4481:b0:7b6:eab3:cdd3 with SMTP id af79cd13be357-7b6fbf442f2mr1510828085a.59.1734321294727; Sun, 15 Dec 2024 19:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734321294; cv=none; d=google.com; s=arc-20240605; b=j4tjdinv4XRjfoJchAT7P1emcaHl8efHqWg1LbJsJOSlgC7DLUOQ8F7rp/nKGmsQH2 FUcDaHNQpdbmWzW0Q52DY3rPaDtr0KmRyt6qlsbC5xZSfTFnMKxhz/psRTiCWw8dDKt5 VT87ybvHcbwv3ayWuZ2F/vZxFehbD99jwpNFc5Hj+G/mwnc7rA64unMkw5Gb6wZ4SlRX ZpP+wqwtd0Ol9e/0n2M0VFVklE5RkoeqxftWIxdhUSlDZxLeSJreGscf7TISnyr7FJZA b29Kdaw9xwTTfiinFlJGJHViDijpIl/vJN8hlQdpn6EctPhe0H167mFsYS3yvSv81fLE Qjfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6kwxpp6H6DpWLzGbf6AeTqxyXU7uHDghdBpIzRPpVmo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=UpRzrL2QIvhEfYHLYb3OB2KWZy8gn4knfxnsivSmS7j8DQTpoRZR9x814SAu5LKS2I C+deNRO+6b/h70TCXYJ+EyRi/HV+ffzbewl3BVJ4LaWJ1d39nH1vicBePYpEYJ60pG75 nuZJVvpc0hlVZXuoKtisjrRumbQEKoBh6+ir6cs6NNWVCbX9+V8ylNGxMx0SjozuYdL4 OWl44XqHo0M/sLZ+58GEduPUbl5TKufqt4VjNMPgizgTkdVvucq5OIXBWNSKds+JVADm NxyG8tXmiyn4uarhaOEM2n11sE3awNXjRLIBzRGvcLHCqZWHhA1RpE4eemMa8M+6IrxF a62w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GePnLH0i; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b7047ca39dsi612129585a.87.2024.12.15.19.54.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Dec 2024 19:54:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GePnLH0i; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN294-0007Lw-Hj; Sun, 15 Dec 2024 22:51:46 -0500 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 1tN292-0007L1-BQ for qemu-devel@nongnu.org; Sun, 15 Dec 2024 22:51:45 -0500 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tN290-00060Y-NG for qemu-devel@nongnu.org; Sun, 15 Dec 2024 22:51:43 -0500 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-5f1dfb0b44dso790708eaf.2 for ; Sun, 15 Dec 2024 19:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734321101; x=1734925901; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6kwxpp6H6DpWLzGbf6AeTqxyXU7uHDghdBpIzRPpVmo=; b=GePnLH0ip1YYxMhETcuOH4G9Cjyc3FObFV7HqaHZkGBZNayT7h8nHX8OKDIjLynGEG AIswKzl9zUjtCdXHafomMis2/aGwnXqfZhFVHdKTxli9nh/3JSp2SKxulgrDvIDy2op4 M9djGWWongHUayy9FuwAsUlcyKhpjXun/tqiQzXGKnAwZUuXFz8J1CTHrLlOu4fmZSEr 5ArID20oL+gsMsPBHfqmaQQYanxjHT5PRNNCSeS1Ovi7i7ishE4yHbpP/kI91F5AdIqa jGq3sOJSUUUX6k0iuNcEyxEKVi80rzfP/kRg3iX1Ns4nCFdN0lxVsU9i4v+JeCUDJ4Pu gfMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734321101; x=1734925901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6kwxpp6H6DpWLzGbf6AeTqxyXU7uHDghdBpIzRPpVmo=; b=vJZPNKtnZ93+KTEdYCakLtgYHiBP531hD/v7cgrwAaIaOf6L8r0Dit0yZgIEU3HIsu xbDOSnowr4y0RG3ZXhSlh8CV3++u1vATOde0XZgV0x5E2MvvFCLeaSZlSduOECPn3qRG orRGnFXnkJvJDQWcD5T55SyCu96wkDyqwNMBLO6FOhWLaKT+XraVdAANXVYzOHXjC/oO wGQRUc9NXGkTFGp1dxjkrNz5DekWtF6p6wg1NrnfSnwJQbkYhYZfgLkaMCcgS5P+qFdt 3oDmvqmP8oFD2DZSJUDULVKIg1nEdLWqSaKq+jgLHT8qh4a2hoKvR+CZ9RnDtewQST8N dwLQ== X-Gm-Message-State: AOJu0YyDFyMoC9ohU/u+7OCBRzwuQ08GE+mTqIziyvcsx7XQVEPboWd5 JeELfzgxnMrG86stI4Ie1pMHAujCV1YikKqfPgYd2Q3KYEOUW2dimspkBKhnxvuU3RcNVyHwvt3 x5F9F8w3r X-Gm-Gg: ASbGncvyM+qf6W8+lvNsCWsriGyUtPKLxBB15MtqNii7ZJqU0wfAJHJkDQfJ35KtYMU msCxCTC64CJ9k3Ae0by6ZpioSrd5L2lJapom/+D9WzaPaS82/5vdtksyHWWHiiXHi/1/Siz19Mx xvW3FQ9SvhqMYoBds7Ktn9UCr6VSVtAm91jr3D9JscGMvaMXju3An2LQ/QK1wamf79363n3D0sc SkhSL7lPCoJVYkdSmQqpqrI+yOX//MZIeZHzvVgGiCdb3Nkzl9HNjZwsWDLq21T9agQU+Jr9PU3 bhNeys2J6k9XBsDkQuF4QEhX9aSvqnkJbFXrWlrKW0M= X-Received: by 2002:a05:6820:1a0b:b0:5ee:ebcb:e701 with SMTP id 006d021491bc7-5f32948e3e2mr7252869eaf.6.1734321101568; Sun, 15 Dec 2024 19:51:41 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5f33a93a6d1sm1287493eaf.33.2024.12.15.19.51.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Dec 2024 19:51:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/24] hw/scsi/megasas: Use device_class_set_props_n Date: Sun, 15 Dec 2024 21:51:00 -0600 Message-ID: <20241216035109.3486070-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241216035109.3486070-1-richard.henderson@linaro.org> References: <20241216035109.3486070-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2e; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2e.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We must remove DEFINE_PROP_END_OF_LIST so the count is correct. Signed-off-by: Richard Henderson --- hw/scsi/megasas.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 8323cd18e3..7f012c218b 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2459,7 +2459,6 @@ static const Property megasas_properties_gen1[] = { DEFINE_PROP_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO), DEFINE_PROP_BIT("use_jbod", MegasasState, flags, MEGASAS_FLAG_USE_JBOD, false), - DEFINE_PROP_END_OF_LIST(), }; static const Property megasas_properties_gen2[] = { @@ -2473,7 +2472,6 @@ static const Property megasas_properties_gen2[] = { DEFINE_PROP_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO), DEFINE_PROP_BIT("use_jbod", MegasasState, flags, MEGASAS_FLAG_USE_JBOD, false), - DEFINE_PROP_END_OF_LIST(), }; typedef struct MegasasInfo { @@ -2488,6 +2486,7 @@ typedef struct MegasasInfo { int osts; const VMStateDescription *vmsd; const Property *props; + size_t props_count; InterfaceInfo *interfaces; } MegasasInfo; @@ -2504,6 +2503,7 @@ static struct MegasasInfo megasas_devices[] = { .osts = MFI_1078_RM | 1, .vmsd = &vmstate_megasas_gen1, .props = megasas_properties_gen1, + .props_count = ARRAY_SIZE(megasas_properties_gen1), .interfaces = (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, @@ -2520,6 +2520,7 @@ static struct MegasasInfo megasas_devices[] = { .osts = MFI_GEN2_RM, .vmsd = &vmstate_megasas_gen2, .props = megasas_properties_gen2, + .props_count = ARRAY_SIZE(megasas_properties_gen2), .interfaces = (InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } @@ -2546,7 +2547,7 @@ static void megasas_class_init(ObjectClass *oc, void *data) e->osts = info->osts; e->product_name = info->product_name; e->product_version = info->product_version; - device_class_set_props(dc, info->props); + device_class_set_props_n(dc, info->props, info->props_count); device_class_set_legacy_reset(dc, megasas_scsi_reset); dc->vmsd = info->vmsd; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);