From patchwork Thu Dec 19 08:32:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 852026 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1366297wrq; Thu, 19 Dec 2024 00:35:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKQloTigpss3E6RKkAa71ZlcTlrSM1YE6SE/FMAYotqyQZr+96mz4DHdxOW+yWCMXUN7c7lA==@linaro.org X-Google-Smtp-Source: AGHT+IF/etK7JvfpfUhLk8Zilpuevs52r0a340WUvQqSMCNuu/1jkEgjnj3OqyXMB0xEa39OHqCF X-Received: by 2002:a05:620a:2404:b0:7b6:d393:c1fe with SMTP id af79cd13be357-7b9aa8d6606mr367637685a.26.1734597318366; Thu, 19 Dec 2024 00:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734597318; cv=none; d=google.com; s=arc-20240605; b=PtopznddDtuEB48OhJP9MoycKRTV7oIehHDQAAqmUfewKba4h0JE78LDoYTV7PW36A +gY2t7Ef42b71nRY6gVBUkZ9ImGS8XUoagGhaROzd2TfxQKnmIk//w+UlgHz8Fcs9pzO sz+ivHEKWICW5JVIEWxk9FMBE1lPgv1AvrD9fH4QfonANL3iub4S+xwRWKpUzNY/xX8e Z+pYZolEOVxooohWvz/e0od8AgDNbFvUEwY2EauJyoXb205OtQ/2Sgi8t1wEt+H8eaEF oSpBCVdsZAMe4tRw2gzxwrB3AhwZNlCuSCdeUQrmU/RqeDQwjoMIrAB0hrGunb3RNqyz 4I2g== 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:cc:to :from:dkim-signature; bh=lszIW+6n3q7LxjSiG56S8Pvl926aYIlcMEY05VSrnOQ=; fh=mN+7zamMqtxpbv5qGNGIO/QHsXnjUAqHW/yN5gisKlY=; b=NBAIEsSbPsNrVXXouLGo+qKNwTyVoVVVgh5zF6a2SQPlpzMCnfNk4pQsXWV5Bg5XAE dTYGZ7nKcuFuz4WZElf8AObFm1Jnkdeu2PIhkw47oCGKTjImmCXbiUi0eyXi5LFjK9qf VgTTaxzfsPxpLfzinHjQ3bRaxacM5SWQZ60PT4izGQv5ORNQGSLwdtqUTf4TdY0PF13K Q7xIP2jtw3w2c/9DZTnLRj3uACeLazq6YrNk0Cbw7janRorsDCWAPlYqQnfZCYPWfgJe FFfTbRbh4vmeTqN2FZn1HgxqPK2nLSg8+0tjL7oPFQAV9B82S4wkjcZWtpSxrBQo6gHL /63Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Eq/YHqKf"; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3eb9911fsi9425541cf.249.2024.12.19.00.35.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 00:35:18 -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=@redhat.com header.s=mimecast20190719 header.b="Eq/YHqKf"; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOBy0-0004YW-3K; Thu, 19 Dec 2024 03:33:08 -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 1tOBxx-0004Y5-RW for qemu-devel@nongnu.org; Thu, 19 Dec 2024 03:33:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOBxw-000585-A1 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 03:33:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734597183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lszIW+6n3q7LxjSiG56S8Pvl926aYIlcMEY05VSrnOQ=; b=Eq/YHqKfjdVC7kBB5+ivQHdVXIoYOiJ0hhUs1ePrbs2fJx42kW8rtc9JalAmzxK2/hfhLU 4vKeOSnmZoDxWKaNh/YCIAnyWuhuLaG0qvLZcoGj2qAQsg19imU4Y63+64Knx2MyRhIlbR TmtWfW8vjkUKAcRiVIbhzhLffYq8/Vk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-82-tc8wQJvvNe6K0nXTpI19YQ-1; Thu, 19 Dec 2024 03:33:01 -0500 X-MC-Unique: tc8wQJvvNe6K0nXTpI19YQ-1 X-Mimecast-MFC-AGG-ID: tc8wQJvvNe6K0nXTpI19YQ Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43610eba55bso4157925e9.3 for ; Thu, 19 Dec 2024 00:33:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734597180; x=1735201980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lszIW+6n3q7LxjSiG56S8Pvl926aYIlcMEY05VSrnOQ=; b=Aj6w1tisUt0eL4Za8s2qBlAlHSaLkSwRs0vBhBf1ptdzHaujhJM6SbswpEUmqYI70B T71sOx/LOvjZiaeRD8TDmMakbRKmEQt9W0nNhHLspODbDLiSOF77sgxjxBtn+VwoE0bP x4i1Hb+Dijt/qUliDl1LiUcsj20SiuVoyxYbRIfw7BpvF+WmlAR3wxe5oOXrlKl4MQaz vh8zDc+tonrVPyCvJE82xGGzCNxn5Cdofb7qEiMeJ+bAXFOGg0KYK1UmoWMeT2p/TrsW EMs8u1eS4NUEOc35LkAKUYjziw31sYu9S0Ng2lZ68OBHdEv8IDWl/MWguLK64fAuLk43 tyuA== X-Gm-Message-State: AOJu0YwIy+J/pXa2EjPcRzNVsZoElP2Ir0A53MTW21EST3PPrymRzyNl u83aPiyMkJyglSw79re9ckPivBsS9Zqd0lu7m8pBhHurry1JvwyhbozKDE4gk9L3OW3kWWPqviL 6mx9iAIzuEw0tdGEgz0XV4+c7fHt87fk5Jn7nLS5KOckyT5znmEdcgFSGkgY6q8ZyC3fuejhT/D Da/M72CJzK1VIThwZiGbGzlcBWYbleJYHBIXQq X-Gm-Gg: ASbGnct36GuLhAPa2lBRnTOLAsva6w482uxgYh+huyIGLmDtrspJk25hR8ehVnH5nUs UjQH2e284rSoFAw+8iFS8AeRD+y1nSOyWV/47ka9sBDmIlVdZq6P3LsgU6wBTy1UmbycnGlrtc/ fU2ALFScsXVzABHLn9bek3w7wNmOu1d0a2D8ov9nLX9e3RMh48LtoRf1FWmPbZ6EPy6puy4LuB3 Ytugt92uuILDMKtTO8/hPL8EFiQumbNlcMzrntKcflwl63I0p6O4XJfM7hI X-Received: by 2002:a05:600c:35cb:b0:436:18e5:6917 with SMTP id 5b1f17b1804b1-436550ae455mr63097015e9.0.1734597180116; Thu, 19 Dec 2024 00:33:00 -0800 (PST) X-Received: by 2002:a05:600c:35cb:b0:436:18e5:6917 with SMTP id 5b1f17b1804b1-436550ae455mr63096555e9.0.1734597179574; Thu, 19 Dec 2024 00:32:59 -0800 (PST) Received: from [192.168.10.47] ([151.81.118.45]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661289a18sm11005085e9.37.2024.12.19.00.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 00:32:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 15/41] hw/scsi/megasas: Use device_class_set_props_n Date: Thu, 19 Dec 2024 09:32:02 +0100 Message-ID: <20241219083228.363430-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241219083228.363430-1-pbonzini@redhat.com> References: <20241219083228.363430-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 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_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.116, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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 From: Richard Henderson We must remove DEFINE_PROP_END_OF_LIST so the count is correct. Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20241216035109.3486070-16-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- 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 8323cd18e3a..7f012c218b4 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);