From patchwork Wed Feb 12 21:32:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24DD9C02198 for ; Wed, 12 Feb 2025 21:34:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMB-0002xU-6R; Wed, 12 Feb 2025 16:33:19 -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 1tiKLt-0002vn-NB for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:02 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKLr-0000Sr-VH for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:01 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-38dd91c313bso80696f8f.3 for ; Wed, 12 Feb 2025 13:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739395978; x=1740000778; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cF7/nSXhHunM2CJO3C+y1skuY8Xt+xo4KY2S2II5T6U=; b=vAPLxtNWrxUhnZ93vbFNKR09GDvIyXTgK4wvt76QEUXHZEgfiSZ4V5U8a8eZ0uVKgo kal506VmsyOQYkwDvClacQVfTnRWznxCPfj+hvCeQ18UxnIVZUcolFlJx3NfmFyN+8S7 axmbiNhBdcLy8wGBcy5sqXYmx0d+w7rXusySw1JCuBZHfHmxSOhROIK6hqNWDoeJRq1m kOSd+OZGXkh28wycf6zKUashtcsFh7lyK/5JCXC1+bb4S/z6g/NwKaJfRi6VPotZ0Bbs wM6Z+wJTxSuvwS/BZpN8aT9iuDz+o3C7M5anVnkWB9OBX+k+BZnJW7TgTKnkPw+W9tLJ FSng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739395978; x=1740000778; 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=cF7/nSXhHunM2CJO3C+y1skuY8Xt+xo4KY2S2II5T6U=; b=kOpA2+9YBt89feqab6C44MXADKgmmUtEdyaxBwXLZ06TcKl5yBpT47bTTErIam7O+5 FvRpjx/kmwzBi/xCFDix05Xxq0cEY1oAP/eq5dH2Oda0kt1Z5ZUbGOHQo4vFhtsc5xxr BcE3+gaEkxRz2LYrriZ3n+6ftUKj42BDbeGje4WGcwX5jjaeoKBcsfQOiRSSqQ/j1HAn 2I31waf7cRgBTiSKFljMQ1hjctTOuzuWEnBdEqDyljUoywtrhzZD1O8Sv+tU16EnhGSn FOVfp18IrPuL1zh7yMkDZ3h586E37gfPBzm8poWs++z9WqkEgtrEAM31gA04DL2VJQsP skGQ== X-Gm-Message-State: AOJu0YxZ+OGTYxAL+PqIxqxsEbQ4bx4wknhcBaXwdH/i0DShSr2OXuvr 6tM2vD/IskoihWFBT7fTIiri5ehhvpWgnXNMyWYZNHFFhCbt3JfTtXKumXfyt/1SwXf4zwoY4PO RLDo= X-Gm-Gg: ASbGncvL53Hb9/15LPNvq//EsVLHlah+pmN7EDj9a06vb68WAijSwsZXKZcTh2xnrvO J3g1BeGGPSf2/CpwYtlMbqoY33aoWdncTnUvxPrLFAlQYpeuLu+Su2Btt89aqx+PAG+689Ay/eI iOmw68+mvOZbGDCuWdIxWWiebHQtaj0imAyjtJsTjXbZUVwGG2oFjFhklNCyVVSMnSM9B9Psltr LIbndSGuJYFwu2tpiR7OYPHDmSoThSpo7fFDbzknxGmpIsA5jb6FnGk6tMuC1sKzfS1BHB9/TSe k97V6pMxmmOCjclT+D8/9+IpBA6LOBAdBqMRzbawt990aEqZUHEpgQVdydZJpTFHaA== X-Google-Smtp-Source: AGHT+IH7uHeKNC2IgyI4IpBbzK9o8DFFag2cuF5w8ENeYpyy972A19wiVnY7odD7pCuQHrRnGEayZQ== X-Received: by 2002:adf:f4c2:0:b0:38d:a910:b4d5 with SMTP id ffacd0b85a97d-38dea6050b7mr3593921f8f.54.1739395977959; Wed, 12 Feb 2025 13:32:57 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258ccef7sm46800f8f.31.2025.02.12.13.32.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:32:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 01/19] hw: Declare various const data as 'const' Date: Wed, 12 Feb 2025 22:32:31 +0100 Message-ID: <20250212213249.45574-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/isa/vt82c686.c | 2 +- hw/rtc/m48t59-isa.c | 2 +- hw/rtc/m48t59.c | 2 +- hw/sensor/tmp421.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-uhci.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 6f44b381a5f..43bd67eeef2 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -224,7 +224,7 @@ static void via_pm_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - ViaPMInitInfo *info = data; + const ViaPMInitInfo *info = data; k->realize = via_pm_realize; k->config_write = pm_write_config; diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index 38bc8dcf100..9c3855a3ef1 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -129,7 +129,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void *data) static void m48txx_isa_concrete_class_init(ObjectClass *klass, void *data) { M48txxISADeviceClass *u = M48TXX_ISA_CLASS(klass); - M48txxInfo *info = data; + const M48txxInfo *info = data; u->info = *info; } diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index c9bd6f878fe..3fb2f27d9d1 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -639,7 +639,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data) static void m48txx_sysbus_concrete_class_init(ObjectClass *klass, void *data) { M48txxSysBusDeviceClass *u = M48TXX_SYS_BUS_CLASS(klass); - M48txxInfo *info = data; + const M48txxInfo *info = data; u->info = *info; } diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 82e604279c5..007f7cd018b 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -68,7 +68,7 @@ struct TMP421State { struct TMP421Class { I2CSlaveClass parent_class; - DeviceInfo *dev; + const DeviceInfo *dev; }; #define TYPE_TMP421 "tmp421-generic" diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index d410c38a8a2..e00316721ac 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -182,7 +182,7 @@ static void ehci_data_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - EHCIPCIInfo *i = data; + const EHCIPCIInfo *i = data; k->vendor_id = i->vendor_id; k->device_id = i->device_id; diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 8528d493d63..0561a6d801a 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1289,7 +1289,7 @@ void uhci_data_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); UHCIPCIDeviceClass *u = UHCI_CLASS(klass); - UHCIInfo *info = data; + const UHCIInfo *info = data; k->realize = info->realize ? info->realize : usb_uhci_common_realize; k->exit = info->unplug ? usb_uhci_exit : NULL; From patchwork Wed Feb 12 21:32:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6FD7CC02198 for ; Wed, 12 Feb 2025 21:33:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMC-0002ym-Gs; Wed, 12 Feb 2025 16:33:20 -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 1tiKM0-0002wN-58 for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:09 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKLx-0000Ti-JW for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:07 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso1281105e9.1 for ; Wed, 12 Feb 2025 13:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739395983; x=1740000783; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R12M5ZnGbHACUNdYXBDvzARNitejWg7AX1PjTOT2rHs=; b=h5BOvduIUabF0YmI1kdFtUdUX2u1q/FKSKoHBg1avQb1wutbXYTFLiHgdGlOxOdVhp Nm40KLbz/lOtUW4buhS6J33ySoI56C66R7yG1NypNuJfFHwrep0KDWbHMLwQNjLKBNzR Su3YylQUM8SKflp6gwW6Dr8a0FHLZGjoOZKUa4g26xguQVcCkZE0ZzZPFCwdlSyMhnUU vqV8tu+i6Exbj8lGyl4sYQGPst0VnPSlvXKuGEqkVyOYJa9Uuf4VNr1iY9o43/gTaBeq wYr0ky/YKq6btPcW+SndMIQ90gWCHNIYpnpxXjFrxY8Q7iMMj3q/h07GkhW19jczdk/n Ei3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739395983; x=1740000783; 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=R12M5ZnGbHACUNdYXBDvzARNitejWg7AX1PjTOT2rHs=; b=Cg+0OczlG1A25d7z29FvIG8cd4RfSKlSPC+cIKzdjXawR7hrwuBDp/fMzBO/8g2o3V lOZU4yOvG4I2FhzQpMnRYsF8PBzobZUejGOytn7Z5VM5BxBlKontyCXZlN+aD8lBPxP0 76dzPXei1O3oJGg1wlX++om6Y9q140PmdSiuLSnsgpDCwKbU/eoRfAtjYKfaBvMv2ZVB ZQd4d/6D/6ANfiWgotXMYLVuShsTIcV1SAvBUowcHYxRnHsyovFjxB7u3vJKA2syd5S1 YXoK1TBl8fPVITQHzVRCFMhUWAPcVH3QNb9RA1aadaT4vHzyrbwfArO9w4/ePc8n4AMk GZZQ== X-Gm-Message-State: AOJu0YyB0eRBrUfMlYSbzExHgKMgPnEH8cpzVJyR38DXrIhYzjsiB2LI QfaYdqpCIIX6pgz7lAHdrPlvR4g1ND/QqflDGpKdo+MmZGC8GMAWnoDst1W2aj17F26lWI3GYYW 4Cmk= X-Gm-Gg: ASbGncssXNGpecMbxHW9Gkak6h+gavj7eqYHExx7CnDAGfCN1zy0yZe1AttEQ1PzoJN 6TnNaFT92ZIunJWgRy9y85SEwf0qYQc+kQzxHjCflqhRIcl9X57MdKCfSZ3y+TmKnnS7vECpfCw 8psudolttMw2aOcVb+Pw0NjFF440Emj3JndYoEmUm8jZ7XM+cuvK/yJPJ1W0BkMPQ/3KFZYFLMU mzKayN6B3dKqdxnMnGjZOJeEwuNV+jq6fYXvKJWkQcFOpPQaCcQRjwFNw7w5/ee09pJ4PdobzoA FsSxUA4oIQ5Ah6xk4ikukcwWUgigOm+NvzKbGppaxR9jKXoazGLor/O4Os4aihpZbg== X-Google-Smtp-Source: AGHT+IHgUN4CZXfWbbrkjCjUMr5kAJGJfenS6riFNkGXKOUmBTQyflTDuhnzvLcgjs/r1pkynKgeUg== X-Received: by 2002:a05:600c:3110:b0:439:35d2:ed2 with SMTP id 5b1f17b1804b1-4395815f593mr46889855e9.2.1739395982803; Wed, 12 Feb 2025 13:33:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a07867esm30728535e9.36.2025.02.12.13.33.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 02/19] hw: Make class data 'const' Date: Wed, 12 Feb 2025 22:32:32 +0100 Message-ID: <20250212213249.45574-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When the %data argument is not modified, we can declare it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/sd/sdhci-internal.h | 2 +- hw/sd/sdhci.c | 2 +- hw/sensor/emc141x.c | 2 +- hw/sensor/isl_pmbus_vr.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h index 5f3765f12d2..9f768c418e0 100644 --- a/hw/sd/sdhci-internal.h +++ b/hw/sd/sdhci-internal.h @@ -322,6 +322,6 @@ void sdhci_initfn(SDHCIState *s); void sdhci_uninitfn(SDHCIState *s); void sdhci_common_realize(SDHCIState *s, Error **errp); void sdhci_common_unrealize(SDHCIState *s); -void sdhci_common_class_init(ObjectClass *klass, void *data); +void sdhci_common_class_init(ObjectClass *klass, const void *data); #endif diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 99dd4a4e952..1f45a77566c 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1542,7 +1542,7 @@ const VMStateDescription sdhci_vmstate = { }, }; -void sdhci_common_class_init(ObjectClass *klass, void *data) +void sdhci_common_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc = DEVICE_CLASS(klass); diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c index aeccd2a3c94..33c1bd330fd 100644 --- a/hw/sensor/emc141x.c +++ b/hw/sensor/emc141x.c @@ -265,7 +265,7 @@ static void emc141x_initfn(Object *obj) emc141x_set_temperature, NULL, NULL); } -static void emc141x_class_init(ObjectClass *klass, void *data) +static void emc141x_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc = DEVICE_CLASS(klass); I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c index 304a66ea8b0..c60282cfe77 100644 --- a/hw/sensor/isl_pmbus_vr.c +++ b/hw/sensor/isl_pmbus_vr.c @@ -233,7 +233,7 @@ static void raa228000_init(Object *obj) isl_pmbus_vr_add_props(obj, flags, 1); } -static void isl_pmbus_vr_class_init(ObjectClass *klass, void *data, +static void isl_pmbus_vr_class_init(ObjectClass *klass, const void *data, uint8_t pages) { PMBusDeviceClass *k = PMBUS_DEVICE_CLASS(klass); From patchwork Wed Feb 12 21:32:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2265C021A0 for ; Wed, 12 Feb 2025 21:34:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMG-0002yv-0u; Wed, 12 Feb 2025 16:33:24 -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 1tiKM3-0002wU-DX for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:11 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKM1-0000U3-JP for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:11 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso1278955e9.3 for ; Wed, 12 Feb 2025 13:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739395987; x=1740000787; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YyHOKWoeSC403uuReOzBJ6t1qCvcqW/3Uih7M9Jpk2E=; b=cOOETH3OnexnE+4Wo6fGkn2kycG1c8dHUar70lXeXc/xH2LPOt6bzFq5bCr0BIwWyA tHk+HfVYoJDlU2nuXCrQ71adnZT6bV1wP8yWc4RTqoj663WIbreHhJ4N99yBicclfSzu YwcJfZBr3A4ayyQVAFK/kg0AT82PZywSVM1Euvkr5UFWMq0dlEuANWOtaMqp6Rma4LnS pR7wLwL6haIKALLN6uapynaq8CfO9ogShsSQ9C2z4lRcpNsiCnnLw94DuRB0+Uo/CBRt svH5xZ2hftTCiLNRrsLhFirbCT44ummocCtZFO8IsTYX9hmbNxfYoh9zFkElvXBDhtVs vmZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739395987; x=1740000787; 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=YyHOKWoeSC403uuReOzBJ6t1qCvcqW/3Uih7M9Jpk2E=; b=m2V1ylha202kttzAzh0o1GddtDHj93D9MW1QX6aq9XOmvxLfOR3uHiN69CXe8YykwV axO9ei8bISqZsF4Aaay7LdCn+6HaoyN0smMsErSYijgi/Hkdr6QYvb2oko4pA6aygUBv uGwJcJEZru+MDOrrwh4FfvdSD80mPJ+Z30VQMWoprNYx1lOOEInsJAF0z4dJ2hPbr48g 3u9ILDDsaKiaJxPl/cwmMGISdajPCFT3l/WVKLxL0+UdlAz3JZO4yDOtx/DSdBfR6JLA PFSERZtWOmozjm3ZTY+cNB+XYv8K3aM+hIZQjkfuuDVk5CQqeVe1iD2umlpcKca0RZQm XWIw== X-Gm-Message-State: AOJu0YxD1QS8qDekaJeBQ5yXhSU7ntLUcuPgR0/8LEgJp7vIcFScOU4p fE56LesIoy3hYGOVy1Xz+PccbfHdStn9ZwcZai/hniJNJlpuY+Mk9DClJWgRyUZPyzreOdVMrlq mppo= X-Gm-Gg: ASbGncuL1cUZOzt5C8kN3mnBD2pGPRUtk609RI/nYobx4EZs9o7VkKQNCwXSss6SjAc T1iFLfig7etu9tlI2AHyVO35C7sobU3JH6sYl/MJT1qe2JCXrY2oxJUB0LMYgqmpIZgOtNZIWK0 Dfyjygby+un+KZvuKHSU8zIvbU3fshERDTZ5UJQx5ulaPLVTbrHOv1H3olNHmwUzm5TWf9667Pm qJU9Voka8x1jEroDCl/2OBR7IoMgvu0uIdRNRO3ijeckQ4qLvtfRznviEFXqLi3YCxj1cI7Jivs 5ojdKJY+VOgAja1eKoDsGy5mKfostSJ+1ZGVoUS22TtgQnVI+V7gcRPez3LZdMlszA== X-Google-Smtp-Source: AGHT+IHkxQCCpkTO0KjUXBnkOH/jnfo+/JzF8rC7b2kEDpvgCkn9QRMy1WgTH5GNNYKuNAtuTfszfg== X-Received: by 2002:a05:6000:381:b0:38f:230d:4c77 with SMTP id ffacd0b85a97d-38f230d4e90mr1116619f8f.46.1739395987325; Wed, 12 Feb 2025 13:33:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259f7987sm20517f8f.87.2025.02.12.13.33.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 03/19] target/i386: Constify X86CPUModel uses Date: Wed, 12 Feb 2025 22:32:33 +0100 Message-ID: <20250212213249.45574-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c67b42d34fc..f9ce6970ee1 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2288,7 +2288,7 @@ struct X86CPUClass { * CPU definition, automatically loaded by instance_init if not NULL. * Should be eventually replaced by subclass-specific property defaults. */ - X86CPUModel *model; + const X86CPUModel *model; bool host_cpuid_required; int ordering; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b5dd60d2812..4b2da45366b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6436,7 +6436,7 @@ void x86_cpu_apply_props(X86CPU *cpu, PropValue *props) * Only for builtin_x86_defs models initialized with x86_register_cpudef_types. */ -static void x86_cpu_apply_version_props(X86CPU *cpu, X86CPUModel *model) +static void x86_cpu_apply_version_props(X86CPU *cpu, const X86CPUModel *model) { const X86CPUVersionDefinition *vdef; X86CPUVersion version = x86_cpu_model_resolve_version(model); @@ -6465,7 +6465,7 @@ static void x86_cpu_apply_version_props(X86CPU *cpu, X86CPUModel *model) } static const CPUCaches *x86_cpu_get_versioned_cache_info(X86CPU *cpu, - X86CPUModel *model) + const X86CPUModel *model) { const X86CPUVersionDefinition *vdef; X86CPUVersion version = x86_cpu_model_resolve_version(model); @@ -6493,7 +6493,7 @@ static const CPUCaches *x86_cpu_get_versioned_cache_info(X86CPU *cpu, * Load data from X86CPUDefinition into a X86CPU object. * Only for builtin_x86_defs models initialized with x86_register_cpudef_types. */ -static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) +static void x86_cpu_load_model(X86CPU *cpu, const X86CPUModel *model) { const X86CPUDefinition *def = model->cpudef; CPUX86State *env = &cpu->env; @@ -6563,7 +6563,7 @@ static const gchar *x86_gdb_arch_name(CPUState *cs) static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) { - X86CPUModel *model = data; + const X86CPUModel *model = data; X86CPUClass *xcc = X86_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); From patchwork Wed Feb 12 21:32:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0861CC02198 for ; Wed, 12 Feb 2025 21:34:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMJ-00032x-0f; Wed, 12 Feb 2025 16:33:27 -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 1tiKM9-0002xm-Cy for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:18 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKM6-0000UR-Ic for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:15 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-439307d83f0so1068215e9.3 for ; Wed, 12 Feb 2025 13:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739395992; x=1740000792; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eRab0hDnaS4AewVF3P4hSBJEHzwC6g1AT44Nvwa7bNQ=; b=ph0VreMv5ab9owix5zqnUwPY3FJqYzYwkrLl6sjsSCg40lm8zBgmUndQ8PSpYapnII t8PZNwynaSbSGUifdWoCydfabG9CGcLXcMa1/OhGt6oirRZvdQVOxJjAppOVcpTDVgit PMmL66WZegLCa+h+lJVhY7Hsj9bBiUTn5QUgeoxkcPPlM9LsiNHkSYRKhYv5AkTgB3t9 A+rS9eKSKU8/vJVsMOf5+5C8M+/AiP64J4p58ty2JtHNtd2iumlSg0ENL8gzf9MwEEbc pKeU2/YV1MrngWeGzunPNF27fh6i14S2qzx4HSKS3zwdu8N6rnalMt4MrPtueWNcqEX7 rDiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739395992; x=1740000792; 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=eRab0hDnaS4AewVF3P4hSBJEHzwC6g1AT44Nvwa7bNQ=; b=Wn7Kn/ddNKY53TG2rAD/5lL1g2oS2bv2LRQEW/2qVkXW6R/7aTE6jRKVkimFQD6f9m Ba1MxfSaOcmBYQT5RPUXEkmZJRN9nxvYYN8CN6xst31qgzAEZ3D7Gk3uv+xEd/I7In1/ 9BQGX5gYrGjXLUOL9HZ7A/+jJ8i3D8XVDPc1qDslskvRly4sophifZjl9jgjPBenMlCc 8Y2M13oILC2FgUUsW6glwdoDiySa2koCeDh5ks1dzyj6NIWxQIY8pxVtFWPrOAPEr481 GbAaxMnV9SyayaXPD7a350QsaMJFouE1Ep6Ebhp8vxvdEmi8plkkn4mpLC4wAab5P8j5 oEIg== X-Gm-Message-State: AOJu0YwDcqnFA4ZQyrWjTVi7glYe/AgyZBFWD3HEq6b/xjUvRyHlGqNK Im4D5dAuhiIVsMTXA+GfAILWl8gAns+FYbhC9tBhPK7Uq7/nEZDBZU+ygyN2R2pCxvYyRr8e7AK pjSQ= X-Gm-Gg: ASbGncvzXJm8ocYL+t/MIt3YpOSbD9tOTIfM/HYY0QuMg5t8TnNTnmrMUGQ1AtkZNYs YVvL38Hnf/8RJY1RPq5rXg52Fu9DAomlMYjzYXTsaZ826OGuERCSYSBC69JeP0hnlKrOIxhi6/3 Wm9HkZpsjNL2Hf/uAg5rmfcPgFTcFbPncjKgL5WKeHh1yvfPO4shmbRwwgkcR6PLzjw2M+URTtu 2DUkBa7+9rgI1pCBknl0sbfIF/Vt40COwa2OdilAHU7zYxCBpTEipriXKN1yaS2cbHTA75Xl2bU K7VDGJcyHrbVGKP7Qta4ws/xvx3msGUrugOQhldqrsFaKYfX8brl7yArmmaUeSvO5g== X-Google-Smtp-Source: AGHT+IFPUqhXXf6J4nkRU0xHl898AweZfyqSrFwJnIiuYISnNZc28bwM9XNkKOlfXR+vY4r76nmZ1g== X-Received: by 2002:a05:600c:1d88:b0:439:574c:bf77 with SMTP id 5b1f17b1804b1-439601799b2mr10236315e9.8.1739395991839; Wed, 12 Feb 2025 13:33:11 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a04ee2fsm30764105e9.4.2025.02.12.13.33.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 04/19] target/sparc: Constify SPARCCPUClass::cpu_def Date: Wed, 12 Feb 2025 22:32:34 +0100 Message-ID: <20250212213249.45574-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/sparc/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index dda811503b5..462bcb6c0e6 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -574,7 +574,7 @@ struct SPARCCPUClass { DeviceRealize parent_realize; ResettablePhases parent_phases; - sparc_def_t *cpu_def; + const sparc_def_t *cpu_def; }; #ifndef CONFIG_USER_ONLY From patchwork Wed Feb 12 21:32:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F146C02198 for ; Wed, 12 Feb 2025 21:36:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKML-00033B-UN; Wed, 12 Feb 2025 16:33:30 -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 1tiKMC-0002yl-DS for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:20 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMA-0000Ux-FX for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:20 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38dcf8009f0so63973f8f.2 for ; Wed, 12 Feb 2025 13:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739395996; x=1740000796; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=en/a7ffbK9haoJlAFPh+g3jAc0kZoPBDHYq0Zc8C/ng=; b=VRkD8h1q7eEuiCXyHHs7IAeeCPUhEPZbNnRuP7n/rMretRDUTaqyTxQwAfDxnWXzZr 5adXrHjixOUxO/Oc6eF533AEx/BY8v0sw1BZcWXJx8U0Zm1biCyj6+YItA2zBXchCF22 ukvzmBy0WPur5o3pgiZwzUuQoQRhFjY2AMd4GgJDCp5lKZuNUT7wlijxoD/ryxlNjVy7 Whbt7Mq2ULGl9TI6E3a+FnbQWC15Hy0SAN7tAu1Fd2UlgYix4v7JqBDM+2orMkNgnH6i KhpLDw6No6MzmUFeX0p2VsAa9CEY+URd+GnKbxpAXVe46G5ryu0+GHVVD3vO45uOqm6a rVEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739395996; x=1740000796; 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=en/a7ffbK9haoJlAFPh+g3jAc0kZoPBDHYq0Zc8C/ng=; b=RnvIApu4SHzfMlWBscP0Hs6x6jnhDgoTOb/KXfDas8B5T9JnxJhfhCjn1dFhbBg3LA Q1/nbn2Jh87XsGmDj7fh6toAV6DDsrdoDdLn3iBjEWV2ieGWM0MH1DLlU9XA291weXNz 1mwmDP3pE80B6w4FLWz1Nbgt4erySUo28XdXb+6ggWEK7Smzy2O/AJ008F1VCCxTsrot 3A7o5LLMbOlCMvy44cNsap9jDBGKDWCh0hjAmrpDO/UbZQ5mnKF4d/A2ETgwY3w2+QSf xs/xCuLOUyee/Jp6gLyy1YqPiuausTZVRBEzWcEGmqdKeJtGJbLbL8Ow46juFfwUc0aO LmWA== X-Gm-Message-State: AOJu0YzheKDQFx7uwFwv4q5/wX8dgSdwCApInD3P39smyjsKq6Ba6XUX K72ub5/31iC+twyouH/t1kDFv5+DGnWOyuuOeedgbeUmgqvDp2RnnSpc7fZdZuOxXj2c2MwPrKZ 6Vks= X-Gm-Gg: ASbGncsa5Jqx87Iup8z59G/4kay0nAOvr3MnjAmRhBtgGQHzsmqUl4uJHJeel4Qs9Jq 4+rQhRXTlo+e/wcvvNdpwm1BdBm1yWra6UwNs0g9oX82LZXVpvF4Uwy+HaHQTa9BC28xBVdeTuG 8OJZISRJPZrcFiuIQrEwNWji53iQFo9SLltbqlnna9hQGjwYlP7JhwctdOEWZFJuGnWq3l0Sl0H kYBBYMkGBU+wyb1YLIAMVGoKjoTLTjRn2f6hHJD6jgFyQpsJTiI7+BdZhXJcctV9ahjkqGp/h8s Oc+qNHb1+7oMk1T5XD+EFOU4mPJQmuprGO+LXk9sbg2my5C18c86OkWAFCiKIGc/8g== X-Google-Smtp-Source: AGHT+IEUgDyZVMNgIkJB1U8Q8yH1O95KOFIEvIEZhMu/qienxCs/xbRlETJVuhWulc4V1EwHU+NGQw== X-Received: by 2002:a05:6000:2ab:b0:38d:d39a:d13c with SMTP id ffacd0b85a97d-38dea256ee7mr4345866f8f.2.1739395996646; Wed, 12 Feb 2025 13:33:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258f5fb6sm40695f8f.44.2025.02.12.13.33.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Max Filippov Subject: [PATCH v3 05/19] target/xtensa: Finalize config in xtensa_register_core() Date: Wed, 12 Feb 2025 22:32:35 +0100 Message-ID: <20250212213249.45574-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Make XtensaConfigList::config not const. Only modify XtensaConfig within xtensa_register_core(), when the class is registered, not when it is initialized. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Max Filippov --- target/xtensa/cpu.h | 2 +- target/xtensa/helper.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 0e6302c5bd3..8d70bfc0cd4 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -490,7 +490,7 @@ typedef struct XtensaConfig { } XtensaConfig; typedef struct XtensaConfigList { - const XtensaConfig *config; + XtensaConfig *config; struct XtensaConfigList *next; } XtensaConfigList; diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 2978c471c1f..f64699b116d 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -173,9 +173,8 @@ static void xtensa_core_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); XtensaCPUClass *xcc = XTENSA_CPU_CLASS(oc); - XtensaConfig *config = data; + const XtensaConfig *config = data; - xtensa_finalize_config(config); xcc->config = config; /* @@ -195,6 +194,8 @@ void xtensa_register_core(XtensaConfigList *node) .class_data = (void *)node->config, }; + xtensa_finalize_config(node->config); + node->next = xtensa_cores; xtensa_cores = node; type.name = g_strdup_printf(XTENSA_CPU_TYPE_NAME("%s"), node->config->name); From patchwork Wed Feb 12 21:32:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E21F7C021A0 for ; Wed, 12 Feb 2025 21:35:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKML-00033C-Ul; Wed, 12 Feb 2025 16:33:30 -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 1tiKMG-00031V-NM for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:25 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMF-0000Vw-2A for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:24 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4393dc02b78so949645e9.3 for ; Wed, 12 Feb 2025 13:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396001; x=1740000801; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c5ZardDRY5uFFdKZhZV+6eAW2H8HO/6VhBaUOEC8cY8=; b=F0dwIX3aj380c+FCpVqVapBRhSoIp9gHtlh7OjBpCeQLtLDoPjcvyM4TZ0sDj8hYDq FkzC6hef07DCu55j1hD2aD5Dqk8rxKS37RBbvLFm1LcPLZfALxJ9OnChuoU0O90be79T XksR2Cwnb4p6pZhflLe07qT43hPsY2T7Hm4ulUmtJPLS/wgllt+h5AWdoQPRBJzrpGgK VfRkWmp0HXjq/stXSWHuaexklQXZ1BISfYc2xSGHO5uRqN7rj/a3tuPybwwLenVldh4Z IwWzkPhbWqKDXjnd33O4HAtVesmHg3+KWgGEBbeED1UuxsVwXh+C8bLAhrigJhIlEuwD sfYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396001; x=1740000801; 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=c5ZardDRY5uFFdKZhZV+6eAW2H8HO/6VhBaUOEC8cY8=; b=Fkp0DbFjTzZBrpZSiKT/Fop0sfYSu5MZdmpnzldIcQ0lnB+8IfIIHTbn2E29D/QcAI ubeHgz6z3Ek9ciMLjX8+Sn41lu4VLN0YQfl3hBvnWpP/mtQFQJTV393ANf/s0V5386P/ QNl3RBI8lJoer80v9rd13Ycz+ztruZjlFR4bt9UGl48lAOVzRm1m9QSlYuXuNtlYjjeo V6g3323GxA9barPg3D5rkQ88Tju00VZTA9aKik/emgj9GWs6oqUKLW0ArLGOgKynizOc 7Hgr2pigehMtGru1lZyTTiqTOWl3ngNDKkFh5KX1/YxDmlabgS9QGgupzrgJ86klobms KIdQ== X-Gm-Message-State: AOJu0Ywp7fICts3cH6a4mwHQ+u3Ae6BsmFeSHtscJi95CANV7inpqTdY +pbVawUPpi7g07Nnv1V1ejFip3aG0+/lMBJq9Yk0WiuEa4ToCptirB+LtTxkpBUKMYjf9hMOVdn 6jug= X-Gm-Gg: ASbGncu31AEXB7LOwHZ0czFmmkhLsrxX18JrMt54QaM+wwqcmZv8au7NFn77xNS1g3P OjZBiUTd8DpZ8Idli7Xv2CDxifVQBaaazNpsRoEGVciwL7TFA+aRyaq3hXGopnRvaS3UgNSgVgA SLgVTBe4kNDpMX+m8FWE5NgbbKiLG6k/IG229ymJYmb4O6mZs3qg2799ON4wt0E5N5bQAdK6eaC aYjyGebOQ3EcaE+acor54NR7qv6mEM/4fvHOwvv1RSmL0fNtns1YUPw2eDThu1LhRThbcSYfJl0 IAXnkWYY5F/bra6heorexFZYZT3hU1xBEL3PR9EnofavBB25vI6DBkLpu/11MLPzBQ== X-Google-Smtp-Source: AGHT+IGeNRZCV5y8645k2W6HrR773i8Kad5BFmKCsZ/+le/1+MFrTk1ujGEGItA8nUt5IiJI2B8Nhg== X-Received: by 2002:a05:600c:45d1:b0:434:a529:3b87 with SMTP id 5b1f17b1804b1-43959a2ac8cmr42334305e9.10.1739396001233; Wed, 12 Feb 2025 13:33:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43959d3d5f3sm31622955e9.0.2025.02.12.13.33.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 06/19] target/riscv: Declare RISCVCPUClass::misa_mxl_max as RISCVMXL Date: Wed, 12 Feb 2025 22:32:36 +0100 Message-ID: <20250212213249.45574-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 2 +- target/riscv/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 97713681cbe..fbe5548cf5a 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -529,7 +529,7 @@ struct RISCVCPUClass { DeviceRealize parent_realize; ResettablePhases parent_phases; - uint32_t misa_mxl_max; /* max mxl for this cpu */ + RISCVMXL misa_mxl_max; /* max mxl for this cpu */ }; static inline int riscv_has_ext(CPURISCVState *env, target_ulong ext) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 3d4bd157d2c..f3ad7f88f0e 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2955,7 +2955,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) { RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); - mcc->misa_mxl_max = (uint32_t)(uintptr_t)data; + mcc->misa_mxl_max = (RISCVMXL)(uintptr_t)data; riscv_cpu_validate_misa_mxl(mcc); } From patchwork Wed Feb 12 21:32:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BCC3C02198 for ; Wed, 12 Feb 2025 21:34:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMO-00034W-Ml; Wed, 12 Feb 2025 16:33:32 -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 1tiKML-00033L-8d for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:29 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMJ-0000WC-H6 for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:28 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43956e3863eso1882075e9.2 for ; Wed, 12 Feb 2025 13:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396005; x=1740000805; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WQTyyvM1Ut/4hxqH2Y3t7FYtP781gxP4U1LmrtAk4dw=; b=cLhJzJL735ge8XUXbknOn8J0mhEoSumK9p9Pn+8tvlArM8i/HDOTpjbGwN17cjx8Qj 23TpxyEer0hY1x5/YbL8lQznshno0FaOEr5/RcjL4XCzAaz3v7uYNLlhMXqflYqwIgVU jWKN42mKPS1epmhAJ/S3Okw4CbZNLWXAZ7WZDAG4DAnrR31RZ+4heTPaI3CfESCqqFal AFb9Cw26JUvJYjd7Vm0Jo+xQE/P7QpWkNQEKGIrYaswqIaVeDxRcxhvMCvJXFwPkbkEf SRIaQayXULkmoncSxX5WP+34DzHovIC8a8n1QVPDGigsvvnZBFWv2TBGCr8zctH+9RAE k2ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396005; x=1740000805; 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=WQTyyvM1Ut/4hxqH2Y3t7FYtP781gxP4U1LmrtAk4dw=; b=F+JIcMCaqHHM9In0yceNAfc11Gnm7QYwa0p0Pec47+QPxW0Yvdyy8b6M1oetIQANRa IGjH3zGVE+ig89wqoKKXOkHE/OWCQbdF90W3iuaQWY0tQO5iec2/4bu8dLd0yjvuNqYa wCb5bw7hjwJYeB0/NMBpCdTVylacGwPQjZNNuV0794WrX6wXu5rI8aSV+2InwOJFT5R5 rKXx4wn/fWqvwR9fJq8Jh0wY5zqcb5mofSWkrZuAzpFwouroANso0oAx6xN9zjXLDZEz /5XEme323jOR2lTI2qAq0yvYrKj/Won+uO1Ob2PMlWFF1raqNr4KskiItGoez74xkOQx QWSA== X-Gm-Message-State: AOJu0YyWZ60UZdzkuXHhvwHnrsnpgjq1BzsWkcmIuuzP94anryn9AKxL 5k8qMQF1o8eNTWDLb7LyD3E7BI3m+UNpqR/HLMKCkTpgVW3pmKsMFUtBUah0TXVveStyTX/zriJ CyAE= X-Gm-Gg: ASbGncstILCx3gjUpMEEaEGib9WX9bXRMQNKGRDUOBEqLrNM/us3hMtlkPf6oJd76Bm U04jcKLY3dksw1NRxZsXtHspt/WZ5WMNFC4eP0S2v1Twfjfye+T/LLyyTJ/5DIqPgfsr+z7zn5f EXO6IYScaR6CYmjMbsoxnnbuVDx1oYaex2a9cGOR3F0UiU6TrV0xYOMJ5xO2JkupufGIUl2qZM2 DsB2Mf7Ad/No9Uu+5ukdE5szMmYWjM6/eul+Kuj6WnF8/x/Y1BUPGkEdI/72i0U9Cn1Djw9a48H V+xVzMaAQ2hqdfKU4w8jQZQpNH/YEHlt9qi/yi9QxWWbYmbBniKP3M4FVsPrEDjNEQ== X-Google-Smtp-Source: AGHT+IHS58kwk3oWB/IegAxEQVFIQnKW/mF08yBPC1PsW5/x3xsIFn7Y0QyCV5m7ILTw+xOeGiuTqA== X-Received: by 2002:a05:600c:3d99:b0:439:614b:1c15 with SMTP id 5b1f17b1804b1-439614b1f2emr431715e9.13.1739396005610; Wed, 12 Feb 2025 13:33:25 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a053fb3sm31371155e9.16.2025.02.12.13.33.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 07/19] target/riscv: Convert misa_mxl_max using GLib macros Date: Wed, 12 Feb 2025 22:32:37 +0100 Message-ID: <20250212213249.45574-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use GLib conversion macros to pass misa_mxl_max as riscv_cpu_class_init() class data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f3ad7f88f0e..9fe1b23a297 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2955,7 +2955,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) { RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); - mcc->misa_mxl_max = (RISCVMXL)(uintptr_t)data; + mcc->misa_mxl_max = (RISCVMXL)GPOINTER_TO_UINT(data); riscv_cpu_validate_misa_mxl(mcc); } @@ -3057,7 +3057,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_DYNAMIC_CPU(type_name, misa_mxl_max, initfn) \ @@ -3066,7 +3066,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_DYNAMIC_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_VENDOR_CPU(type_name, misa_mxl_max, initfn) \ @@ -3075,7 +3075,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_VENDOR_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_BARE_CPU(type_name, misa_mxl_max, initfn) \ @@ -3084,7 +3084,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_BARE_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_PROFILE_CPU(type_name, misa_mxl_max, initfn) \ @@ -3093,7 +3093,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_BARE_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } static const TypeInfo riscv_cpu_type_infos[] = { From patchwork Wed Feb 12 21:32:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B050C021A4 for ; Wed, 12 Feb 2025 21:34:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMQ-00034j-Qy; Wed, 12 Feb 2025 16:33:34 -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 1tiKMQ-00034b-5A for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:34 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMO-0000WZ-I7 for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:33 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43948021a45so1923865e9.1 for ; Wed, 12 Feb 2025 13:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396011; x=1740000811; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AFP0q4a5BbpXO9N+k9FpLHSVcTPUWaHfXxJUQBy2kxE=; b=xCdlVAZw8bWD5paEKEuKOWCZl7+w3JEyjILngVA2m0qI120a7/ACqaU2cZxHeO+mRw BxnXFfWdSoE3QXVvZjLjMO1dUIB7+8L4X7E6zXKPjK93hxG5vpPWZT3QMVsxypHIBysQ i2wBED4+QZ+ERrjlcyN0zDWsTUQ7PN4UhjGmCqOYZSRBK4LAro2nEwDCUd/cnviZYa2h 5Ri+q/emstyh2tLDVIyQ6o/LgQb1NULp/+2UkKGvILK/BaIamB2UiPbtYWqLeCl6529g hPlbnJkViLEl1VDvMwoHPaBsRaPosLAfxcFojVMa7vbLKYm/1mA+aPESuJqYWbhznDn1 B99A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396011; x=1740000811; 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=AFP0q4a5BbpXO9N+k9FpLHSVcTPUWaHfXxJUQBy2kxE=; b=J3jDYqG3u0hNYq73TbOVxRHwLo41LV+fw1M7i1vf70eW2COGFGeTWzMULs1vC6zqYv eJQ4t4P3veVV8eVCUiGp36ed6TlmJJmUjjZbaovALdAMVcVpDeGQ5x2X0EO9OwmAdkYJ zbJxDqMg/4piz0Jvo5G8yjnbVwhu/OVX3oJDtGB4+rldUDY4ujAO+sYwklwJ5RyeKlmd CuPV+Kvvp/OZnrdpVVFOzYX9Y9yi9TCB34iMlPyWfEpFgCnl+0Ae9SXXkccZkACLJ8X3 vew8U/q5m0cjxZ+b9O+JpMUQhdiJFUqrk2py6owEfqjxaxER+qlVIE9Kj1wrGb3JJLTN CDrQ== X-Gm-Message-State: AOJu0YxiTfJNQVUmSaA8v27Z0wwdmweAz5rTJ2dH8IUp9+VXqo2Tbk4E a88dnDFS9HVUozVfb5GmqzwDQwFUqGrrrlazODob0UQvBPuzNOVq6wPZkTPRJiRTibGFVIAb4AR B84c= X-Gm-Gg: ASbGncufwD6qntexQhIerX4UjvSbnS9egCbQQUDJLkDyiJJwAkIhoHGgQjEC6AfG6tU aPUoUSaf6AQwLZzLo9dSMqdMEvad0I1zHQ1fXQUgyEV822ZTau1HKQRcmNYOtzVx8yFSTsU+Oq3 ONIL7gMr7d24M+xuOjY3SKClMxHFXInYeuoUs4YwdoLH7x/rODhZyQRnpPZ19/K/dYJjBDyK2/1 GPP6hDpAUTaKnf2ax99GXmRHdObBrVgbyD+6uemAafzID8B1ujTKMVGwDDzU/0e/llYb+63kNQ8 m0SmB7l+6i9c8D5tnNOO8Hqfz4QyeoVDIoZlNezq76MTJy+rWSzxygn2EQpid610MA== X-Google-Smtp-Source: AGHT+IFF2N3A/XD7OM1l05/vSyz0Y0A/WB6aHsP3qelGoXl8VR1GpUMZC9F6AMx8/VzG+KUv8RHTSg== X-Received: by 2002:a05:600c:3b82:b0:439:31e0:d9ab with SMTP id 5b1f17b1804b1-439580d3a55mr54219565e9.0.1739396010884; Wed, 12 Feb 2025 13:33:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259f7987sm21121f8f.87.2025.02.12.13.33.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 08/19] qom: Have class_base_init() take a const data argument Date: Wed, 12 Feb 2025 22:32:38 +0100 Message-ID: <20250212213249.45574-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/qom/object.h | 2 +- hw/core/machine.c | 2 +- hw/core/qdev.c | 2 +- hw/pci/pci.c | 2 +- qom/object.c | 2 +- rust/qemu-api/src/qom.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 9192265db76..7bb14ca7067 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -487,7 +487,7 @@ struct TypeInfo size_t class_size; void (*class_init)(ObjectClass *klass, void *data); - void (*class_base_init)(ObjectClass *klass, void *data); + void (*class_base_init)(ObjectClass *klass, const void *data); void *class_data; InterfaceInfo *interfaces; diff --git a/hw/core/machine.c b/hw/core/machine.c index 254cc20c4cb..7bdde9286c2 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1236,7 +1236,7 @@ static void machine_class_init(ObjectClass *oc, void *data) "Memory size configuration"); } -static void machine_class_base_init(ObjectClass *oc, void *data) +static void machine_class_base_init(ObjectClass *oc, const void *data) { MachineClass *mc = MACHINE_CLASS(oc); mc->max_cpus = mc->max_cpus ?: 1; diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 2745b5e0929..1e0f47cc848 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -693,7 +693,7 @@ static void device_finalize(Object *obj) g_free(dev->id); } -static void device_class_base_init(ObjectClass *class, void *data) +static void device_class_base_init(ObjectClass *class, const void *data) { DeviceClass *klass = DEVICE_CLASS(class); diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2afa423925c..00f50e6f2cc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2712,7 +2712,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data) "access to indirect DMA memory"); } -static void pci_device_class_base_init(ObjectClass *klass, void *data) +static void pci_device_class_base_init(ObjectClass *klass, const void *data) { if (!object_class_is_abstract(klass)) { ObjectClass *conventional = diff --git a/qom/object.c b/qom/object.c index 01618d06bd8..dfd59502d11 100644 --- a/qom/object.c +++ b/qom/object.c @@ -55,7 +55,7 @@ struct TypeImpl size_t instance_align; void (*class_init)(ObjectClass *klass, void *data); - void (*class_base_init)(ObjectClass *klass, void *data); + void (*class_base_init)(ObjectClass *klass, const void *data); void *class_data; diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index f50ee371aac..f3d43e066ef 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -475,7 +475,7 @@ pub trait ObjectImpl: ObjectType + ClassInitImpl { /// the effects of copying the contents of the parent's class struct /// to the descendants. const CLASS_BASE_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut c_void), + unsafe extern "C" fn(klass: *mut ObjectClass, data: *const c_void), > = None; const TYPE_INFO: TypeInfo = TypeInfo { From patchwork Wed Feb 12 21:32:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68802C02198 for ; Wed, 12 Feb 2025 21:34:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKMo-0003Y0-Ny; Wed, 12 Feb 2025 16:34:00 -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 1tiKMe-0003I1-Lt for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:49 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMb-0000XG-Sx for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:48 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so1974925e9.3 for ; Wed, 12 Feb 2025 13:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396024; x=1740000824; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FNh5OTPHP4aaZIYWtVp+snPJdFPyxvwXlmdr7ShVKcU=; b=c7Xk76qv2bhqJfQrNIxn5MyirfDVOgw44MrpXOoJ2Avlyt7j958e6WArfD9OsxQo95 LtompOLkAHLrqtyae/o+g92cmWw5TTb+OtF+xfxJFJ+JqSwu5MJlM7vJZoaMyp1EDTkk dvzN8nl+v86Bemvr1ixvOxBz0c+JOYOiXbeESqGbMW3TbKGQY1VGKgZOXaQp83ICgSws MNHzkPlodz7Vm9v8Mkkph8z6KZqafjxGnI/QABVWixPj42QDJSnC3ttvZVTfWq/bbagK jVFKbuZ3YzeWA8G4VwHHFsj+uD2YhLMeDxcsz7iRZ+l0oY5V6nett8Syc4ONHY7xAI9+ n0Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396024; x=1740000824; 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=FNh5OTPHP4aaZIYWtVp+snPJdFPyxvwXlmdr7ShVKcU=; b=ijXEWCjEffQaMswmpJpUaIebgYQBoAKpm7Q4SZdZUSof25odcUJ3mX0uH+lXLvzb8T 5F9nTAREp3YVNdzd/ri0hNSxafyTqV3WDLRTlyx/vDizWksMqi/pX9On5/nJtCT07Doy 8B3+zyjuI1L2RPYLPnUPKI/hW1au1GEPy837HqfGrV03T8KTRYfsB5sBfwITrw5omLJx XTlkS8J6lMtwjcDHDsdk3y2dnN9KYp9czQP86Tkw+mdSRO0IsrO1hIaZ6QFZ/j3CtGE9 Co5RPzvLxXD/7QmGeE7FoCcUPDGmuKEK+0LGJnKrzJ6wScJf0tjlrst+3WIg9NIc6nde VfXA== X-Gm-Message-State: AOJu0YwZmlG6nbSmyfWVVnbovNogbbtlPtpLxuKVN1SjTYSDEUb48QGf +NVC++jhdi9Qujzn4UYtyQwh2uhVdp9Z88Ur+iI7AuBRqKURBOyUqEtNsUjggExhB9N6Cd7SxOr TYH0= X-Gm-Gg: ASbGncsaQXsS8AyILwkwK2iu+mvsUOdVXEb6bJhPJvRo0vHTActL2Q5DweMRpUk1LL5 uHTu023XG8QAwVlnf+mHKEhgWRUHAYiwm0bA+27tj7l++p228+dWf13NaIj8B6WiMTLMhHuDfbo VwnrJMggTnXbyKGuWLKVL0Y0CdLIFat4bkq5CV+4joZj2EyVl9rlM5x+W2XdzhV9GvK7qjGR10i zVX39XtAAvp6U6R5dStZvlBc3311NxUMrZk+VdRZCiqRw8wFrvLZrU4S4kLgt/nNrMyK/v2NdFP AervKOQAcZOvxKTBCbHLqOj8eo6NaWnuhGiAt8t8jq1yoEgywniWInUjQY/jA6yuQw== X-Google-Smtp-Source: AGHT+IG0+1QDnZtuMYIx64KsTdeeG+RBfmQVNi7v3Ma1S9qs05Fcko4i0jVtx6gRjrPhsGvL7rRWAg== X-Received: by 2002:a05:600c:46ce:b0:439:4706:ae04 with SMTP id 5b1f17b1804b1-43958183d00mr51150735e9.16.1739396023919; Wed, 12 Feb 2025 13:33:43 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a1b824dsm30629755e9.34.2025.02.12.13.33.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 10/19] qom: Constify TypeInfo::class_data Date: Wed, 12 Feb 2025 22:32:40 +0100 Message-ID: <20250212213249.45574-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org All callers now correctly expect a const class data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/qom/object.h | 2 +- hw/arm/armsse.c | 2 +- hw/block/m25p80.c | 2 +- hw/isa/vt82c686.c | 4 ++-- hw/net/e1000.c | 2 +- hw/ppc/spapr_cpu_core.c | 2 +- hw/scsi/megasas.c | 2 +- hw/sensor/tmp421.c | 2 +- hw/virtio/virtio-pci.c | 4 ++-- qom/object.c | 2 +- target/arm/cpu.c | 2 +- target/arm/cpu64.c | 2 +- target/mips/cpu.c | 2 +- target/s390x/cpu_models.c | 4 ++-- target/sparc/cpu.c | 2 +- target/xtensa/helper.c | 2 +- rust/qemu-api/src/qom.rs | 2 +- scripts/codeconverter/codeconverter/test_regexps.py | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 2fb86f00a68..42b75d10a43 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -488,7 +488,7 @@ struct TypeInfo void (*class_init)(ObjectClass *klass, const void *data); void (*class_base_init)(ObjectClass *klass, const void *data); - void *class_data; + const void *class_data; InterfaceInfo *interfaces; }; diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index d65a46b8d8d..9403b65ddb5 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -1730,7 +1730,7 @@ static void armsse_register_types(void) .name = armsse_variants[i].name, .parent = TYPE_ARM_SSE, .class_init = armsse_class_init, - .class_data = (void *)&armsse_variants[i], + .class_data = &armsse_variants[i], }; type_register_static(&ti); } diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 236fa798c34..eee7bedd6b3 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -1891,7 +1891,7 @@ static void m25p80_register_types(void) .name = known_devices[i].part_name, .parent = TYPE_M25P80, .class_init = m25p80_class_init, - .class_data = (void *)&known_devices[i], + .class_data = &known_devices[i], }; type_register_static(&ti); } diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 80366aaf647..c62afc907b2 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -259,7 +259,7 @@ static const TypeInfo vt82c686b_pm_info = { .name = TYPE_VT82C686B_PM, .parent = TYPE_VIA_PM, .class_init = via_pm_class_init, - .class_data = (void *)&vt82c686b_pm_init_info, + .class_data = &vt82c686b_pm_init_info, }; static const ViaPMInitInfo vt8231_pm_init_info = { @@ -272,7 +272,7 @@ static const TypeInfo vt8231_pm_info = { .name = TYPE_VT8231_PM, .parent = TYPE_VIA_PM, .class_init = via_pm_class_init, - .class_data = (void *)&vt8231_pm_init_info, + .class_data = &vt8231_pm_init_info, }; diff --git a/hw/net/e1000.c b/hw/net/e1000.c index d49730f4ad4..13814e84d18 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1770,7 +1770,7 @@ static void e1000_register_types(void) type_info.name = info->name; type_info.parent = TYPE_E1000_BASE; - type_info.class_data = (void *)info; + type_info.class_data = info; type_info.class_init = e1000_class_init; type_register_static(&type_info); diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index c1964d3dc8a..e1929a546a3 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -380,7 +380,7 @@ static void spapr_cpu_core_class_init(ObjectClass *oc, const void *data) #define DEFINE_SPAPR_CPU_CORE_TYPE(cpu_model) \ { \ .parent = TYPE_SPAPR_CPU_CORE, \ - .class_data = (void *) POWERPC_CPU_TYPE_NAME(cpu_model), \ + .class_data = POWERPC_CPU_TYPE_NAME(cpu_model), \ .class_init = spapr_cpu_core_class_init, \ .name = SPAPR_CPU_CORE_TYPE_NAME(cpu_model), \ } diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index cfa5516b96c..6104d4202aa 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2573,7 +2573,7 @@ static void megasas_register_types(void) type_info.name = info->name; type_info.parent = TYPE_MEGASAS_BASE; - type_info.class_data = (void *)info; + type_info.class_data = info; type_info.class_init = megasas_class_init; type_info.interfaces = info->interfaces; diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c index 263bfa1bbda..3421c440869 100644 --- a/hw/sensor/tmp421.c +++ b/hw/sensor/tmp421.c @@ -382,7 +382,7 @@ static void tmp421_register_types(void) .name = devices[i].name, .parent = TYPE_TMP421, .class_init = tmp421_class_init, - .class_data = (void *) &devices[i], + .class_data = &devices[i], }; type_register_static(&ti); } diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index acb49a6a330..48082445bc6 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2500,13 +2500,13 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) generic_type_info.parent = base_name; generic_type_info.class_init = virtio_pci_base_class_init; - generic_type_info.class_data = (void *)t; + generic_type_info.class_data = t; assert(!t->non_transitional_name); assert(!t->transitional_name); } else { base_type_info.class_init = virtio_pci_base_class_init; - base_type_info.class_data = (void *)t; + base_type_info.class_data = t; } type_register_static(&base_type_info); diff --git a/qom/object.c b/qom/object.c index 06d7367032e..425ee2f0ee8 100644 --- a/qom/object.c +++ b/qom/object.c @@ -57,7 +57,7 @@ struct TypeImpl void (*class_init)(ObjectClass *klass, const void *data); void (*class_base_init)(ObjectClass *klass, const void *data); - void *class_data; + const void *class_data; void (*instance_init)(Object *obj); void (*instance_post_init)(Object *obj); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index fbcd9274843..edfae8be40a 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2769,7 +2769,7 @@ void arm_cpu_register(const ARMCPUInfo *info) .parent = TYPE_ARM_CPU, .instance_init = arm_cpu_instance_init, .class_init = info->class_init ?: cpu_register_class_init, - .class_data = (void *)info, + .class_data = info, }; type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 1184c92b4c0..eaf5705cdc2 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -855,7 +855,7 @@ void aarch64_cpu_register(const ARMCPUInfo *info) .parent = TYPE_AARCH64_CPU, .instance_init = aarch64_cpu_instance_init, .class_init = info->class_init ?: cpu_register_class_init, - .class_data = (void *)info, + .class_data = info, }; type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 9a45adb3ec5..a7abaf9b286 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -619,7 +619,7 @@ static void mips_register_cpudef_type(const struct mips_def_t *def) .name = typename, .parent = TYPE_MIPS_CPU, .class_init = mips_cpu_cpudef_class_init, - .class_data = (void *)def, + .class_data = def, }; type_register_static(&ti); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 972a99236f0..4afef45c72f 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -1073,7 +1073,7 @@ static void register_types(void) .instance_init = s390_cpu_model_initfn, .instance_finalize = s390_cpu_model_finalize, .class_init = s390_base_cpu_model_class_init, - .class_data = (void *) &s390_cpu_defs[i], + .class_data = &s390_cpu_defs[i], }; char *name = s390_cpu_type_name(s390_cpu_defs[i].name); TypeInfo ti = { @@ -1082,7 +1082,7 @@ static void register_types(void) .instance_init = s390_cpu_model_initfn, .instance_finalize = s390_cpu_model_finalize, .class_init = s390_cpu_model_class_init, - .class_data = (void *) &s390_cpu_defs[i], + .class_data = &s390_cpu_defs[i], }; type_register_static(&ti_base); diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index f46600249bd..d140fb948e3 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -1074,7 +1074,7 @@ static void sparc_register_cpudef_type(const struct sparc_def_t *def) .name = typename, .parent = TYPE_SPARC_CPU, .class_init = sparc_cpu_cpudef_class_init, - .class_data = (void *)def, + .class_data = def, }; type_register_static(&ti); diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 75bb00ee246..1ca6f37562c 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -191,7 +191,7 @@ void xtensa_register_core(XtensaConfigList *node) TypeInfo type = { .parent = TYPE_XTENSA_CPU, .class_init = xtensa_core_class_init, - .class_data = (void *)node->config, + .class_data = node->config, }; xtensa_finalize_config(node->config); diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index b39dba829d4..b007f089153 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -496,7 +496,7 @@ pub trait ObjectImpl: ObjectType + ClassInitImpl { class_size: core::mem::size_of::(), class_init: Some(rust_class_init::), class_base_init: Self::CLASS_BASE_INIT, - class_data: core::ptr::null_mut(), + class_data: core::ptr::null(), interfaces: core::ptr::null_mut(), }; diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/codeconverter/codeconverter/test_regexps.py index 72113927960..08857c5008d 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -70,7 +70,7 @@ def fullmatch(regexp, s): .name = armsse_variants[i].name, .parent = TYPE_ARMSSE, .class_init = armsse_class_init, - .class_data = (void *)&armsse_variants[i], + .class_data = &armsse_variants[i], };''', re.MULTILINE) print(RE_ARRAY_ITEM) From patchwork Wed Feb 12 21:32:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972450 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1217C021A0 for ; Wed, 12 Feb 2025 21:34:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKN2-0003oy-3L; Wed, 12 Feb 2025 16:34:12 -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 1tiKMo-0003Zz-0o for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:58 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMj-0000Xh-FU for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:57 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso2191405e9.1 for ; Wed, 12 Feb 2025 13:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396032; x=1740000832; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iwsn+19wqGgkeuviXw/Ht/CFnVphllZWJU/vSRHxt40=; b=fzzJK9koUtzAv9b3s3IasgwkSLelmmS/B2pldMo9c5CorehA2gYoBD52+i1WmjQDQY mocLYdAkiX8QbLvIiswYVXdxuRyBrwqvtaZdCbG53R93QfEgikU5cIi5vjvVnBJpHyvY aVFI+lvMGRBSchFNA82sjCGX6UKDMSaI/DOrsTeGPmfEbm+m0tC+FG68rxnpHHK0KrjK +LEbXbBf5ACwVDSLLX1CDARSW7NEupr6maAQOc2RB6G9QXyonCjKwil6fbtfa3Jzoezg W2PfMZVqn/wyGTH+zgdMqxjRWrBoTYj1OlenoS34mUlmOLUamZIagYlSjgxpHOwunx3u 6bPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396032; x=1740000832; 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=iwsn+19wqGgkeuviXw/Ht/CFnVphllZWJU/vSRHxt40=; b=cgH7xrV5dQfzzpXuCD0kAP1XVyaI2SaK2Dl0D9BLxyS+LEajwe/gwYEErrXXpx0kis FPpSvO6lOZyo/0KEseFOmq7AItu56sQ/pKI4jYOmhnvnMkZa1rUpDR/aHY4vE/0UN4I3 qIxEmMT8r9B3Jwcm2pkouOwvglE4zPBdUyJWACABr9LuMj4JMcKUbbUAj9ycgzP1SaLg lMCfFFCpbiQAZBBNHrkcCfCuuDINzCjwz3ezIBmfU/DWiz9KKluw5OmR/66B8RBEh/NI 2PwdyGVnKe9iT1YYjiMAGKaROtyHRp9mEnhRXSlLygD4rcubh6DBsefGKx/zLgqGfZfB 5rpw== X-Gm-Message-State: AOJu0YxBe0sPBsY2rXndbHAggRN1IqRggjIRidunpOqM7BDPOnvJUxI4 kyZiLeyO0UEYIkbRJzRZBLvVlUiEDtxznKbJIX21vMSksLA+UkrYU4D4fbZ+stHnI+JX1vQg64F HYrc= X-Gm-Gg: ASbGnct/4rQO2cYo5hoL9P31EXKrpLETgsGh9Ed57Frb3l8a7TOQOPLdxCVQhPuUhb8 eG77OWYLEANG6cq451ED7tOZzncbPvCOdf4vQzJStqmLBJlbfoyqoptVOW1LqM0E25z4S2O2EBM sroY0DrY/2UlWaT89xSDQ5XJ8pxSkJ5g6qCBu/UirCMNozP9IfKTOyNgpNcX3pVpiEcqOZkLbyh pIkpNI05CArbgsQmDBWyPn1UVh7+1TjMqg3DJhlIz0aL6yzunwJIYSj8toHjCyV0JoIsUS4PvbD 4yFv1A3NOYT0X3MSiLIwWyzKniBLh/CfyoZA1pXkVC+V+yW2fOddRgYtabxnNnNxUg== X-Google-Smtp-Source: AGHT+IEwXxCZzpeRi7ltJLkMZldHGKP+9ur0apfUG8JGNETmiVV6ZCQ6R3hAycuK+lhplooI+ofYxQ== X-Received: by 2002:a05:600c:3485:b0:439:5a37:8140 with SMTP id 5b1f17b1804b1-439601b7addmr10309395e9.22.1739396030531; Wed, 12 Feb 2025 13:33:50 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a053e42sm30725145e9.15.2025.02.12.13.33.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 11/19] qom: Constify InterfaceInfo[] interfaces Date: Wed, 12 Feb 2025 22:32:41 +0100 Message-ID: <20250212213249.45574-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Mechanical change using gsed. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/virtio/virtio-pci.h | 2 +- include/qom/object.h | 4 ++-- authz/list.c | 2 +- authz/listfile.c | 2 +- authz/pamacct.c | 2 +- authz/simple.c | 2 +- backends/cryptodev.c | 2 +- backends/dbus-vmstate.c | 2 +- backends/hostmem.c | 2 +- backends/iommufd.c | 2 +- backends/rng.c | 2 +- block/throttle-groups.c | 2 +- crypto/secret_common.c | 2 +- crypto/tls-cipher-suites.c | 2 +- crypto/tlscredsanon.c | 2 +- crypto/tlscredspsk.c | 2 +- crypto/tlscredsx509.c | 2 +- event-loop-base.c | 2 +- hw/acpi/erst.c | 2 +- hw/acpi/generic_event_device.c | 2 +- hw/acpi/piix4.c | 2 +- hw/arm/armsse.c | 2 +- hw/arm/mps2-tz.c | 2 +- hw/arm/virt.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/intel-hda.c | 2 +- hw/audio/via-ac97.c | 4 ++-- hw/block/fdc-isa.c | 2 +- hw/char/diva-gsp.c | 4 ++-- hw/char/parallel.c | 2 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci-multi.c | 4 ++-- hw/char/serial-pci.c | 2 +- hw/char/virtio-serial-bus.c | 2 +- hw/core/bus.c | 2 +- hw/core/qdev.c | 2 +- hw/cxl/switch-mailbox-cci.c | 2 +- hw/display/ati.c | 2 +- hw/display/bochs-display.c | 2 +- hw/display/cirrus_vga.c | 2 +- hw/display/qxl.c | 2 +- hw/display/sm501.c | 2 +- hw/display/vga-pci.c | 2 +- hw/display/virtio-gpu-pci-rutabaga.c | 2 +- hw/display/vmware_vga.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/xilinx_axidma.c | 4 ++-- hw/dma/xlnx_csu_dma.c | 2 +- hw/hppa/machine.c | 4 ++-- hw/i2c/smbus_ich9.c | 2 +- hw/i386/amd_iommu.c | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 2 +- hw/i386/sgx-epc.c | 2 +- hw/i386/x86.c | 2 +- hw/i386/xen/xen_platform.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ide/ich.c | 2 +- hw/ide/pci.c | 2 +- hw/input/pckbd.c | 2 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/arm_gicv3_common.c | 2 +- hw/intc/goldfish_pic.c | 2 +- hw/intc/i8259_common.c | 2 +- hw/intc/ioapic_common.c | 2 +- hw/intc/m68k_irqc.c | 2 +- hw/intc/pnv_xive.c | 2 +- hw/intc/pnv_xive2.c | 2 +- hw/intc/slavio_intctl.c | 2 +- hw/intc/spapr_xive.c | 2 +- hw/intc/xics_spapr.c | 2 +- hw/intc/xive.c | 2 +- hw/intc/xive2.c | 2 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/ipmi/pci_ipmi_bt.c | 2 +- hw/ipmi/pci_ipmi_kcs.c | 2 +- hw/ipmi/smbus_ipmi.c | 2 +- hw/isa/i82378.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/isa/piix.c | 2 +- hw/isa/vt82c686.c | 4 ++-- hw/loongarch/virt.c | 2 +- hw/m68k/q800-glue.c | 2 +- hw/mem/cxl_type3.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/misc/applesmc.c | 2 +- hw/misc/edu.c | 2 +- hw/misc/ivshmem-pci.c | 2 +- hw/misc/macio/gpio.c | 2 +- hw/misc/macio/macio.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic-isa.c | 2 +- hw/misc/pvpanic-pci.c | 2 +- hw/misc/xlnx-versal-cframe-reg.c | 2 +- hw/misc/xlnx-versal-cfu.c | 4 ++-- hw/net/can/can_kvaser_pci.c | 2 +- hw/net/can/can_mioe3680_pci.c | 2 +- hw/net/can/can_pcm3680_pci.c | 2 +- hw/net/can/ctucan_pci.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/igb.c | 2 +- hw/net/igbvf.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/vmxnet3.c | 2 +- hw/net/xilinx_axienet.c | 4 ++-- hw/nvme/ctrl.c | 2 +- hw/pci-bridge/cxl_downstream.c | 2 +- hw/pci-bridge/cxl_root_port.c | 2 +- hw/pci-bridge/cxl_upstream.c | 2 +- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 6 +++--- hw/pci-bridge/pcie_pci_bridge.c | 2 +- hw/pci-bridge/pcie_root_port.c | 2 +- hw/pci-bridge/simba.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-bridge/xio3130_upstream.c | 2 +- hw/pci-host/articia.c | 4 ++-- hw/pci-host/bonito.c | 2 +- hw/pci-host/designware.c | 2 +- hw/pci-host/gpex.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/gt64120.c | 2 +- hw/pci-host/i440fx.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/pnv_phb3_pbcq.c | 2 +- hw/pci-host/pnv_phb4.c | 2 +- hw/pci-host/pnv_phb4_pec.c | 4 ++-- hw/pci-host/ppc4xx_pci.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/raven.c | 2 +- hw/pci-host/sabre.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 8 ++++---- hw/pci-host/versatile.c | 2 +- hw/pci-host/xilinx-pcie.c | 2 +- hw/pci/pci.c | 2 +- hw/pci/pci_bridge.c | 2 +- hw/pci/pcie_port.c | 2 +- hw/ppc/e500plat.c | 2 +- hw/ppc/mac_newworld.c | 2 +- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/pegasos2.c | 2 +- hw/ppc/pnv.c | 8 ++++---- hw/ppc/pnv_adu.c | 2 +- hw/ppc/pnv_chiptod.c | 4 ++-- hw/ppc/pnv_i2c.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_n1_chiplet.c | 2 +- hw/ppc/pnv_nest_pervasive.c | 2 +- hw/ppc/pnv_psi.c | 4 ++-- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/remote/machine.c | 2 +- hw/remote/proxy.c | 2 +- hw/remote/remote-obj.c | 2 +- hw/remote/vfio-user-obj.c | 2 +- hw/riscv/riscv-iommu-pci.c | 2 +- hw/riscv/virt.c | 2 +- hw/rtc/m48t59-isa.c | 2 +- hw/rtc/m48t59.c | 2 +- hw/rtc/mc146818rtc.c | 2 +- hw/s390x/ap-bridge.c | 2 +- hw/s390x/css-bridge.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/s390x/virtio-ccw-md.c | 2 +- hw/scsi/esp-pci.c | 2 +- hw/scsi/lsi53c895a.c | 2 +- hw/scsi/megasas.c | 6 +++--- hw/scsi/mptsas.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/vhost-user-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/sd/sdhci-pci.c | 2 +- hw/sparc64/sun4u.c | 4 ++-- hw/ssi/pnv_spi.c | 2 +- hw/tpm/tpm_crb.c | 2 +- hw/tpm/tpm_spapr.c | 2 +- hw/tpm/tpm_tis_i2c.c | 2 +- hw/tpm/tpm_tis_isa.c | 2 +- hw/tpm/tpm_tis_sysbus.c | 2 +- hw/ufs/ufs.c | 2 +- hw/usb/bus.c | 2 +- hw/usb/dev-smartcard-reader.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ohci-pci.c | 2 +- hw/usb/hcd-uhci.c | 2 +- hw/usb/hcd-xhci-pci.c | 2 +- hw/vfio/igd.c | 2 +- hw/vfio/pci.c | 2 +- hw/virtio/virtio-md-pci.c | 2 +- hw/virtio/virtio-mem.c | 2 +- hw/virtio/virtio-pci.c | 6 +++--- hw/watchdog/wdt_i6300esb.c | 2 +- hw/xen/xen-bus.c | 2 +- hw/xen/xen-legacy-backend.c | 2 +- hw/xen/xen_pt.c | 2 +- hw/xen/xen_pt_graphics.c | 2 +- net/can/can_core.c | 2 +- net/can/can_host.c | 2 +- net/colo-compare.c | 2 +- net/filter.c | 2 +- scsi/pr-manager.c | 2 +- system/qtest.c | 2 +- target/i386/sev.c | 2 +- target/ppc/cpu_init.c | 2 +- tests/unit/check-qom-interface.c | 2 +- tests/unit/check-qom-proplist.c | 2 +- ui/dbus.c | 2 +- ui/input-barrier.c | 2 +- ui/input-linux.c | 2 +- util/thread-context.c | 2 +- hw/display/apple-gfx-pci.m | 2 +- rust/qemu-api/src/qom.rs | 2 +- scripts/codeconverter/codeconverter/test_regexps.py | 10 +++++----- 230 files changed, 260 insertions(+), 260 deletions(-) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index 567a9b0a9da..31ec144509f 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -256,7 +256,7 @@ typedef struct VirtioPCIDeviceTypeInfo { void (*instance_init)(Object *obj); void (*instance_finalize)(Object *obj); void (*class_init)(ObjectClass *klass, const void *data); - InterfaceInfo *interfaces; + const InterfaceInfo *interfaces; } VirtioPCIDeviceTypeInfo; /* Register virtio-pci type(s). @t must be static. */ diff --git a/include/qom/object.h b/include/qom/object.h index 42b75d10a43..1d5b0337242 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -294,7 +294,7 @@ struct Object .class_size = CLASS_SIZE, \ .class_init = module_obj_name##_class_init, \ .abstract = ABSTRACT, \ - .interfaces = (InterfaceInfo[]) { __VA_ARGS__ } , \ + .interfaces = (const InterfaceInfo[]) { __VA_ARGS__ } , \ }; \ \ static void \ @@ -490,7 +490,7 @@ struct TypeInfo void (*class_base_init)(ObjectClass *klass, const void *data); const void *class_data; - InterfaceInfo *interfaces; + const InterfaceInfo *interfaces; }; /** diff --git a/authz/list.c b/authz/list.c index bbd99f2b7fc..17aa0efd80e 100644 --- a/authz/list.c +++ b/authz/list.c @@ -253,7 +253,7 @@ static const TypeInfo qauthz_list_info = { .instance_size = sizeof(QAuthZList), .instance_finalize = qauthz_list_finalize, .class_init = qauthz_list_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/authz/listfile.c b/authz/listfile.c index b58d4ebd1d8..13741d5a722 100644 --- a/authz/listfile.c +++ b/authz/listfile.c @@ -272,7 +272,7 @@ static const TypeInfo qauthz_list_file_info = { .instance_size = sizeof(QAuthZListFile), .instance_finalize = qauthz_list_file_finalize, .class_init = qauthz_list_file_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/authz/pamacct.c b/authz/pamacct.c index 07b8aad4972..c0ad67479a7 100644 --- a/authz/pamacct.c +++ b/authz/pamacct.c @@ -136,7 +136,7 @@ static const TypeInfo qauthz_pam_info = { .instance_size = sizeof(QAuthZPAM), .instance_finalize = qauthz_pam_finalize, .class_init = qauthz_pam_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/authz/simple.c b/authz/simple.c index f6985b840ea..f8f2b98518a 100644 --- a/authz/simple.c +++ b/authz/simple.c @@ -111,7 +111,7 @@ static const TypeInfo qauthz_simple_info = { .instance_size = sizeof(QAuthZSimple), .instance_finalize = qauthz_simple_finalize, .class_init = qauthz_simple_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 51bbe5ce40f..79f8882d3be 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -641,7 +641,7 @@ static const TypeInfo cryptodev_backend_info = { .instance_finalize = cryptodev_backend_finalize, .class_size = sizeof(CryptoDevBackendClass), .class_init = cryptodev_backend_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index 8c2deef43d4..7d5b58b4c90 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -505,7 +505,7 @@ static const TypeInfo dbus_vmstate_info = { .instance_size = sizeof(DBusVMState), .instance_finalize = dbus_vmstate_finalize, .class_init = dbus_vmstate_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { TYPE_VMSTATE_IF }, { } diff --git a/backends/hostmem.c b/backends/hostmem.c index 195f37fa443..35734d6f4d1 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -586,7 +586,7 @@ static const TypeInfo host_memory_backend_info = { .instance_size = sizeof(HostMemoryBackend), .instance_init = host_memory_backend_init, .instance_post_init = host_memory_backend_post_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/backends/iommufd.c b/backends/iommufd.c index 53566beb8a5..cbe34994884 100644 --- a/backends/iommufd.c +++ b/backends/iommufd.c @@ -345,7 +345,7 @@ static const TypeInfo types[] = { .instance_finalize = iommufd_backend_finalize, .class_size = sizeof(IOMMUFDBackendClass), .class_init = iommufd_backend_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/backends/rng.c b/backends/rng.c index b3480d27a12..ab94dfea850 100644 --- a/backends/rng.c +++ b/backends/rng.c @@ -119,7 +119,7 @@ static const TypeInfo rng_backend_info = { .class_size = sizeof(RngBackendClass), .class_init = rng_backend_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/block/throttle-groups.c b/block/throttle-groups.c index a72765e847e..24851972e84 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -968,7 +968,7 @@ static const TypeInfo throttle_group_info = { .instance_size = sizeof(ThrottleGroup), .instance_init = throttle_group_obj_init, .instance_finalize = throttle_group_obj_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } }, diff --git a/crypto/secret_common.c b/crypto/secret_common.c index 2399ce412be..a5ecb876aeb 100644 --- a/crypto/secret_common.c +++ b/crypto/secret_common.c @@ -375,7 +375,7 @@ static const TypeInfo qcrypto_secret_info = { .class_size = sizeof(QCryptoSecretCommonClass), .class_init = qcrypto_secret_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c index e546cc7c0e6..d9b61d0c08a 100644 --- a/crypto/tls-cipher-suites.c +++ b/crypto/tls-cipher-suites.c @@ -118,7 +118,7 @@ static const TypeInfo qcrypto_tls_cipher_suites_info = { .instance_size = sizeof(QCryptoTLSCipherSuites), .class_size = sizeof(QCryptoTLSCredsClass), .class_init = qcrypto_tls_cipher_suites_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE }, { } diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c index 0e2d133821f..44af9e6c9af 100644 --- a/crypto/tlscredsanon.c +++ b/crypto/tlscredsanon.c @@ -152,7 +152,7 @@ static const TypeInfo qcrypto_tls_creds_anon_info = { .instance_finalize = qcrypto_tls_creds_anon_finalize, .class_size = sizeof(QCryptoTLSCredsAnonClass), .class_init = qcrypto_tls_creds_anon_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/crypto/tlscredspsk.c b/crypto/tlscredspsk.c index 287c2a3c96c..5b68a6b7ba2 100644 --- a/crypto/tlscredspsk.c +++ b/crypto/tlscredspsk.c @@ -255,7 +255,7 @@ static const TypeInfo qcrypto_tls_creds_psk_info = { .instance_finalize = qcrypto_tls_creds_psk_finalize, .class_size = sizeof(QCryptoTLSCredsPSKClass), .class_init = qcrypto_tls_creds_psk_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c index 143993f5393..63a72fe47c8 100644 --- a/crypto/tlscredsx509.c +++ b/crypto/tlscredsx509.c @@ -828,7 +828,7 @@ static const TypeInfo qcrypto_tls_creds_x509_info = { .instance_finalize = qcrypto_tls_creds_x509_finalize, .class_size = sizeof(QCryptoTLSCredsX509Class), .class_init = qcrypto_tls_creds_x509_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/event-loop-base.c b/event-loop-base.c index 10b669ffc73..b3e2978450d 100644 --- a/event-loop-base.c +++ b/event-loop-base.c @@ -128,7 +128,7 @@ static const TypeInfo event_loop_base_info = { .class_size = sizeof(EventLoopBaseClass), .class_init = event_loop_base_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c index 621c82f019f..6c653a92cd4 100644 --- a/hw/acpi/erst.c +++ b/hw/acpi/erst.c @@ -1044,7 +1044,7 @@ static const TypeInfo erst_type_info = { .parent = TYPE_PCI_DEVICE, .class_init = erst_class_init, .instance_size = sizeof(ERSTDeviceState), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } } diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index f589e79a2bb..d8adfea6480 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -494,7 +494,7 @@ static const TypeInfo acpi_ged_info = { .instance_size = sizeof(AcpiGedState), .instance_init = acpi_ged_initfn, .class_init = acpi_ged_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, { } diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 5860e8408bd..b16d45f03e1 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -657,7 +657,7 @@ static const TypeInfo piix4_pm_info = { .instance_init = piix4_pm_init, .instance_size = sizeof(PIIX4PMState), .class_init = piix4_pm_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 9403b65ddb5..50ab7f48105 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -1713,7 +1713,7 @@ static const TypeInfo armsse_info = { .class_size = sizeof(ARMSSEClass), .instance_init = armsse_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IDAU_INTERFACE }, { } } diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 609abe9db65..c53604e6108 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -1453,7 +1453,7 @@ static const TypeInfo mps2tz_info = { .instance_size = sizeof(MPS2TZMachineState), .class_size = sizeof(MPS2TZMachineClass), .class_init = mps2tz_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IDAU_INTERFACE }, { } }, diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 03ce6dcff4a..b17442e143a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3342,7 +3342,7 @@ static const TypeInfo virt_machine_info = { .class_size = sizeof(VirtMachineClass), .class_init = virt_machine_class_init, .instance_init = virt_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } }, diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 7454cc60deb..669a0463cc1 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1351,7 +1351,7 @@ static const TypeInfo ac97_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(AC97LinkState), .class_init = ac97_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 322b7798149..8efb9692128 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -896,7 +896,7 @@ static const TypeInfo es1370_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof (ES1370State), .class_init = es1370_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 2f1b08e9c1c..b256c8ccea1 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -1262,7 +1262,7 @@ static const TypeInfo intel_hda_info = { .instance_size = sizeof(IntelHDAState), .class_init = intel_hda_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c index 5feef663d8c..1e0a5c7398b 100644 --- a/hw/audio/via-ac97.c +++ b/hw/audio/via-ac97.c @@ -487,7 +487,7 @@ static const TypeInfo via_ac97_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(ViaAC97State), .class_init = via_ac97_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -522,7 +522,7 @@ static const TypeInfo via_mc97_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = via_mc97_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index 1d32a66d3b7..6a6fca43748 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -331,7 +331,7 @@ static const TypeInfo isa_fdc_info = { .instance_size = sizeof(FDCtrlISABus), .class_init = isabus_fdc_class_init, .instance_init = isabus_fdc_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/char/diva-gsp.c b/hw/char/diva-gsp.c index 9a623d680b3..60f933191d2 100644 --- a/hw/char/diva-gsp.c +++ b/hw/char/diva-gsp.c @@ -268,7 +268,7 @@ static const TypeInfo diva_aux_info = { .instance_size = sizeof(DivaAuxState), .instance_init = diva_aux_init, .class_init = diva_aux_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -282,7 +282,7 @@ static const TypeInfo diva_serial_pci_info = { .instance_size = sizeof(PCIDivaSerialState), .instance_init = diva_serial_init, .class_init = diva_serial_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 217ddaf2e3e..8732e4e9f96 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -627,7 +627,7 @@ static const TypeInfo parallel_isa_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(ISAParallelState), .class_init = parallel_isa_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index fe7fb1625b5..0ea59a3d5c2 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -146,7 +146,7 @@ static const TypeInfo serial_isa_info = { .instance_size = sizeof(ISASerialState), .instance_init = serial_isa_initfn, .class_init = serial_isa_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c index ee1c0f7dc4f..fb184c2e6dc 100644 --- a/hw/char/serial-pci-multi.c +++ b/hw/char/serial-pci-multi.c @@ -194,7 +194,7 @@ static const TypeInfo multi_2x_serial_pci_info = { .instance_size = sizeof(PCIMultiSerialState), .instance_init = multi_serial_init, .class_init = multi_2x_serial_pci_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -206,7 +206,7 @@ static const TypeInfo multi_4x_serial_pci_info = { .instance_size = sizeof(PCIMultiSerialState), .instance_init = multi_serial_init, .class_init = multi_4x_serial_pci_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index bd38c7428c6..8707e819144 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -115,7 +115,7 @@ static const TypeInfo serial_pci_info = { .instance_size = sizeof(PCISerialState), .instance_init = serial_pci_init, .class_init = serial_pci_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 00572873d28..eb79f5258b6 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -1188,7 +1188,7 @@ static const TypeInfo virtio_device_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIOSerial), .class_init = virtio_serial_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/core/bus.c b/hw/core/bus.c index c3b431a014b..bddfc22d388 100644 --- a/hw/core/bus.c +++ b/hw/core/bus.c @@ -260,7 +260,7 @@ static const TypeInfo bus_info = { .instance_init = qbus_initfn, .instance_finalize = qbus_finalize, .class_init = bus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_RESETTABLE_INTERFACE }, { } }, diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 4a3760c101e..f6002261768 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -870,7 +870,7 @@ static const TypeInfo device_type_info = { .class_init = device_class_init, .abstract = true, .class_size = sizeof(DeviceClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_VMSTATE_IF }, { TYPE_RESETTABLE_INTERFACE }, { } diff --git a/hw/cxl/switch-mailbox-cci.c b/hw/cxl/switch-mailbox-cci.c index c57bf555f97..5455b4f6219 100644 --- a/hw/cxl/switch-mailbox-cci.c +++ b/hw/cxl/switch-mailbox-cci.c @@ -97,7 +97,7 @@ static const TypeInfo cswmbcci_info = { .parent = TYPE_PCI_DEVICE, .class_init = cswmbcci_class_init, .instance_size = sizeof(CSWMBCCIDev), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/display/ati.c b/hw/display/ati.c index 4e88d099431..7de27732cdc 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -1079,7 +1079,7 @@ static const TypeInfo ati_vga_info = { .instance_size = sizeof(ATIVGAState), .class_init = ati_vga_class_init, .instance_init = ati_vga_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 1d329fc9cce..ad2821c9745 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -374,7 +374,7 @@ static const TypeInfo bochs_display_type_info = { .instance_size = sizeof(BochsDisplayState), .instance_init = bochs_display_init, .class_init = bochs_display_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 4e5ae04af0f..ef08694626d 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -3013,7 +3013,7 @@ static const TypeInfo cirrus_vga_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCICirrusVGAState), .class_init = cirrus_vga_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 0e4612d55aa..a8cd0209a3c 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2496,7 +2496,7 @@ static const TypeInfo qxl_pci_type_info = { .instance_size = sizeof(PCIQXLDevice), .abstract = true, .class_init = qxl_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/display/sm501.c b/hw/display/sm501.c index dcff1e978ed..6d2f18684c3 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -2196,7 +2196,7 @@ static const TypeInfo sm501_pci_info = { .instance_size = sizeof(SM501PCIState), .class_init = sm501_pci_class_init, .instance_init = sm501_pci_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index a8601972740..b81f7fd2d0f 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -369,7 +369,7 @@ static const TypeInfo vga_pci_type_info = { .instance_size = sizeof(PCIVGAState), .abstract = true, .class_init = vga_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { TYPE_ACPI_DEV_AML_IF }, { }, diff --git a/hw/display/virtio-gpu-pci-rutabaga.c b/hw/display/virtio-gpu-pci-rutabaga.c index abbb898c65d..5fdff37f2c1 100644 --- a/hw/display/virtio-gpu-pci-rutabaga.c +++ b/hw/display/virtio-gpu-pci-rutabaga.c @@ -34,7 +34,7 @@ static const TypeInfo virtio_gpu_rutabaga_pci_info[] = { .parent = TYPE_VIRTIO_GPU_PCI_BASE, .instance_size = sizeof(VirtIOGPURutabagaPCI), .instance_init = virtio_gpu_rutabaga_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, } diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 7777deb17d0..544bb65320b 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -1363,7 +1363,7 @@ static const TypeInfo vmsvga_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(struct pci_vmsvga_state_s), .class_init = vmsvga_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index 1d67e505364..2463952ada2 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -618,7 +618,7 @@ static const TypeInfo i8257_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(I8257State), .class_init = i8257_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ISADMA }, { } } diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index bf1b523ac88..2020399fd59 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -662,7 +662,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = { .instance_size = sizeof(XilinxAXIDMAStreamSink), .class_init = xilinx_axidma_stream_class_init, .class_data = &xilinx_axidma_data_stream_class, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_STREAM_SINK }, { } } @@ -674,7 +674,7 @@ static const TypeInfo xilinx_axidma_control_stream_info = { .instance_size = sizeof(XilinxAXIDMAStreamSink), .class_init = xilinx_axidma_stream_class_init, .class_data = &xilinx_axidma_control_stream_class, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_STREAM_SINK }, { } } diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 6943c927d07..3db3904d835 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -744,7 +744,7 @@ static const TypeInfo xlnx_csu_dma_info = { .class_init = xlnx_csu_dma_class_init, .class_size = sizeof(XlnxCSUDMAClass), .instance_init = xlnx_csu_dma_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_STREAM_SINK }, { } } diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 37f6cb6346b..6e04c0d13d5 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -712,7 +712,7 @@ static const TypeInfo HP_B160L_machine_init_typeinfo = { .name = MACHINE_TYPE_NAME("B160L"), .parent = TYPE_MACHINE, .class_init = HP_B160L_machine_init_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { } }, @@ -748,7 +748,7 @@ static const TypeInfo HP_C3700_machine_init_typeinfo = { .name = MACHINE_TYPE_NAME("C3700"), .parent = TYPE_MACHINE, .class_init = HP_C3700_machine_init_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { } }, diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index f1fca30fea5..956c9b59bbc 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -145,7 +145,7 @@ static const TypeInfo ich9_smb_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(ICH9SMBState), .class_init = ich9_smb_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { TYPE_ACPI_DEV_AML_IF }, { }, diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index a6654cfa8af..08c18174c2e 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1720,7 +1720,7 @@ static const TypeInfo amdvi_pci = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(AMDVIPCIState), .class_init = amdvi_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index a0e39673c9e..ef7401dc162 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -726,7 +726,7 @@ static const TypeInfo microvm_machine_info = { .instance_init = microvm_machine_initfn, .class_size = sizeof(MicrovmMachineClass), .class_init = microvm_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } }, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a20ca1e54fb..3b2539753b5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1862,7 +1862,7 @@ static const TypeInfo pc_machine_info = { .instance_init = pc_machine_initfn, .class_size = sizeof(PCMachineClass), .class_init = pc_machine_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } }, diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c index d5590cd0b53..e3defb774f6 100644 --- a/hw/i386/sgx-epc.c +++ b/hw/i386/sgx-epc.c @@ -173,7 +173,7 @@ static const TypeInfo sgx_epc_info = { .instance_init = sgx_epc_init, .class_init = sgx_epc_class_init, .class_size = sizeof(DeviceClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_MEMORY_DEVICE }, { } }, diff --git a/hw/i386/x86.c b/hw/i386/x86.c index c8e2551b2b4..e2d04092992 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -450,7 +450,7 @@ static const TypeInfo x86_machine_info = { .instance_init = x86_machine_initfn, .class_size = sizeof(X86MachineClass), .class_init = x86_machine_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { } }, diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 7c0d345f964..c8b852be0cc 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -604,7 +604,7 @@ static const TypeInfo xen_platform_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIXenPlatformState), .class_init = xen_platform_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 65868bd5e59..87a974ae5a0 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -139,7 +139,7 @@ static const TypeInfo xen_pv_type_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(XenPVDevice), .class_init = xen_pv_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/ide/ich.c b/hw/ide/ich.c index f2773ab4621..4cade0d1219 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -197,7 +197,7 @@ static const TypeInfo ich_ahci_info = { .instance_size = sizeof(AHCIPCIState), .instance_init = pci_ich9_ahci_init, .class_init = ich_ahci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 0ed72e42233..1e50bb9e483 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -625,7 +625,7 @@ static const TypeInfo pci_ide_type_info = { .instance_size = sizeof(PCIIDEState), .instance_init = pci_ide_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 83930dd50c0..71f5f976e9c 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -958,7 +958,7 @@ static const TypeInfo i8042_info = { .instance_size = sizeof(ISAKBDState), .instance_init = i8042_initfn, .class_init = i8042_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c index f61d1c1fe60..0f0c48d89ab 100644 --- a/hw/intc/arm_gic_common.c +++ b/hw/intc/arm_gic_common.c @@ -382,7 +382,7 @@ static const TypeInfo arm_gic_common_type = { .class_size = sizeof(ARMGICCommonClass), .class_init = arm_gic_common_class_init, .abstract = true, - .interfaces = (InterfaceInfo []) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ARM_LINUX_BOOT_IF }, { }, }, diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index dd86a50300a..1cee68193ca 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -644,7 +644,7 @@ static const TypeInfo arm_gicv3_common_type = { .class_init = arm_gicv3_common_class_init, .instance_finalize = arm_gicv3_finalize, .abstract = true, - .interfaces = (InterfaceInfo []) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ARM_LINUX_BOOT_IF }, { }, }, diff --git a/hw/intc/goldfish_pic.c b/hw/intc/goldfish_pic.c index b80538cdeba..2359861785d 100644 --- a/hw/intc/goldfish_pic.c +++ b/hw/intc/goldfish_pic.c @@ -204,7 +204,7 @@ static const TypeInfo goldfish_pic_info = { .class_init = goldfish_pic_class_init, .instance_init = goldfish_pic_instance_init, .instance_size = sizeof(GoldfishPICState), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_INTERRUPT_STATS_PROVIDER }, { } }, diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c index 4a92e0da908..602e44c8eaf 100644 --- a/hw/intc/i8259_common.c +++ b/hw/intc/i8259_common.c @@ -226,7 +226,7 @@ static const TypeInfo pic_common_type = { .class_size = sizeof(PICCommonClass), .class_init = pic_common_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_INTERRUPT_STATS_PROVIDER }, { } }, diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c index b0381c7990d..fce3486e519 100644 --- a/hw/intc/ioapic_common.c +++ b/hw/intc/ioapic_common.c @@ -215,7 +215,7 @@ static const TypeInfo ioapic_common_type = { .class_size = sizeof(IOAPICCommonClass), .class_init = ioapic_common_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_INTERRUPT_STATS_PROVIDER }, { } }, diff --git a/hw/intc/m68k_irqc.c b/hw/intc/m68k_irqc.c index 215e1a6ed5b..2532322618a 100644 --- a/hw/intc/m68k_irqc.c +++ b/hw/intc/m68k_irqc.c @@ -110,7 +110,7 @@ static const TypeInfo m68k_irqc_type_info = { .instance_size = sizeof(M68KIRQCState), .instance_init = m68k_irqc_instance_init, .class_init = m68k_irqc_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { TYPE_INTERRUPT_STATS_PROVIDER }, { } diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index b67c2ed6c7e..155c46b6404 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -2106,7 +2106,7 @@ static const TypeInfo pnv_xive_info = { .instance_size = sizeof(PnvXive), .class_init = pnv_xive_class_init, .class_size = sizeof(PnvXiveClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 8c9bcd40b92..fd9ecd2a898 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -2441,7 +2441,7 @@ static const TypeInfo pnv_xive2_info = { .instance_size = sizeof(PnvXive2), .class_init = pnv_xive2_class_init, .class_size = sizeof(PnvXive2Class), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c index 5776055a8b4..00b80bb177c 100644 --- a/hw/intc/slavio_intctl.c +++ b/hw/intc/slavio_intctl.c @@ -460,7 +460,7 @@ static const TypeInfo slavio_intctl_info = { .instance_size = sizeof(SLAVIO_INTCTLState), .instance_init = slavio_intctl_init, .class_init = slavio_intctl_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_INTERRUPT_STATS_PROVIDER }, { } }, diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index fad03dbfbe8..9f00d717c98 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -856,7 +856,7 @@ static const TypeInfo spapr_xive_info = { .instance_size = sizeof(SpaprXive), .class_init = spapr_xive_class_init, .class_size = sizeof(SpaprXiveClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_SPAPR_INTC }, { } }, diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c index 9e465fb8f3b..7663596a4a4 100644 --- a/hw/intc/xics_spapr.c +++ b/hw/intc/xics_spapr.c @@ -461,7 +461,7 @@ static const TypeInfo ics_spapr_info = { .name = TYPE_ICS_SPAPR, .parent = TYPE_ICS, .class_init = ics_spapr_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_SPAPR_INTC }, { } }, diff --git a/hw/intc/xive.c b/hw/intc/xive.c index a91d71d108e..43c1bf5296c 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -2028,7 +2028,7 @@ static const TypeInfo xive_router_info = { .instance_size = sizeof(XiveRouter), .class_size = sizeof(XiveRouterClass), .class_init = xive_router_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XIVE_NOTIFIER }, { TYPE_XIVE_PRESENTER }, { } diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index cf37aa2e4a7..88eef9a1d14 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -1052,7 +1052,7 @@ static const TypeInfo xive2_router_info = { .instance_size = sizeof(Xive2Router), .class_size = sizeof(Xive2RouterClass), .class_init = xive2_router_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XIVE_NOTIFIER }, { TYPE_XIVE_PRESENTER }, { } diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index f6993330d23..40b30517c75 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -650,7 +650,7 @@ static const TypeInfo tpci200_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(TPCI200State), .class_init = tpci200_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index f7f7abcca89..fa8b3ac1066 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -161,7 +161,7 @@ static const TypeInfo isa_ipmi_bt_info = { .instance_size = sizeof(ISAIPMIBTDevice), .instance_init = isa_ipmi_bt_init, .class_init = isa_ipmi_bt_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, { TYPE_ACPI_DEV_AML_IF }, { } diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index 67969ca0636..0bd5554f78f 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -168,7 +168,7 @@ static const TypeInfo isa_ipmi_kcs_info = { .instance_size = sizeof(ISAIPMIKCSDevice), .instance_init = isa_ipmi_kcs_init, .class_init = isa_ipmi_kcs_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, { TYPE_ACPI_DEV_AML_IF }, { } diff --git a/hw/ipmi/pci_ipmi_bt.c b/hw/ipmi/pci_ipmi_bt.c index 78d81420089..5709a1efe89 100644 --- a/hw/ipmi/pci_ipmi_bt.c +++ b/hw/ipmi/pci_ipmi_bt.c @@ -133,7 +133,7 @@ static const TypeInfo pci_ipmi_bt_info = { .instance_size = sizeof(PCIIPMIBTDevice), .instance_init = pci_ipmi_bt_instance_init, .class_init = pci_ipmi_bt_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } diff --git a/hw/ipmi/pci_ipmi_kcs.c b/hw/ipmi/pci_ipmi_kcs.c index 40127de393e..64d70506779 100644 --- a/hw/ipmi/pci_ipmi_kcs.c +++ b/hw/ipmi/pci_ipmi_kcs.c @@ -133,7 +133,7 @@ static const TypeInfo pci_ipmi_kcs_info = { .instance_size = sizeof(PCIIPMIKCSDevice), .instance_init = pci_ipmi_kcs_instance_init, .class_init = pci_ipmi_kcs_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c index 7345844a3a9..78c332de54d 100644 --- a/hw/ipmi/smbus_ipmi.c +++ b/hw/ipmi/smbus_ipmi.c @@ -376,7 +376,7 @@ static const TypeInfo smbus_ipmi_info = { .instance_size = sizeof(SMBusIPMIDevice), .instance_init = smbus_ipmi_init, .class_init = smbus_ipmi_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, { TYPE_ACPI_DEV_AML_IF }, { } diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 26c8ec4f77a..06e8f0ce3e0 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -142,7 +142,7 @@ static const TypeInfo i82378_type_info = { .instance_size = sizeof(I82378State), .instance_init = i82378_init, .class_init = i82378_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index d3e623b1e88..71afb45b631 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -915,7 +915,7 @@ static const TypeInfo ich9_lpc_info = { .instance_size = sizeof(ICH9LPCState), .instance_init = ich9_lpc_initfn, .class_init = ich9_lpc_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, diff --git a/hw/isa/piix.c b/hw/isa/piix.c index 2c6e76f97cc..52c14d3cd5b 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c @@ -445,7 +445,7 @@ static const TypeInfo piix_pci_type_info = { .instance_init = pci_piix_init, .abstract = true, .class_init = pci_piix_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { TYPE_ACPI_DEV_AML_IF }, { }, diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index c62afc907b2..337958617a4 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -243,7 +243,7 @@ static const TypeInfo via_pm_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(ViaPMState), .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -634,7 +634,7 @@ static const TypeInfo via_isa_info = { .instance_size = sizeof(ViaISAState), .instance_init = via_isa_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9c3ede6e74c..422259c3a81 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1507,7 +1507,7 @@ static const TypeInfo virt_machine_types[] = { .instance_size = sizeof(LoongArchVirtMachineState), .class_init = virt_class_init, .instance_init = virt_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } }, diff --git a/hw/m68k/q800-glue.c b/hw/m68k/q800-glue.c index b428e7c833e..36de67c328e 100644 --- a/hw/m68k/q800-glue.c +++ b/hw/m68k/q800-glue.c @@ -248,7 +248,7 @@ static const TypeInfo glue_info_types[] = { .instance_init = glue_init, .instance_finalize = glue_finalize, .class_init = glue_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { } }, diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index b98c068476d..4ae2985891d 100644 --- a/hw/mem/cxl_type3.c +++ b/hw/mem/cxl_type3.c @@ -2161,7 +2161,7 @@ static const TypeInfo ct3d_info = { .class_size = sizeof(struct CXLType3Class), .class_init = ct3_class_init, .instance_size = sizeof(CXLType3Dev), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CXL_DEVICE }, { INTERFACE_PCIE_DEVICE }, {} diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 6f68171442f..f701d5b5f9b 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -301,7 +301,7 @@ static const TypeInfo pc_dimm_info = { .instance_init = pc_dimm_init, .class_init = pc_dimm_class_init, .class_size = sizeof(PCDIMMDeviceClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_MEMORY_DEVICE }, { } }, diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index d83a81b60d3..a015d4a9b8c 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -393,7 +393,7 @@ static const TypeInfo applesmc_isa_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(AppleSMCState), .class_init = qdev_applesmc_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/misc/edu.c b/hw/misc/edu.c index a6e0786b6f1..b92c7e06bef 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -431,7 +431,7 @@ static void edu_class_init(ObjectClass *class, const void *data) static void pci_edu_register_types(void) { - static InterfaceInfo interfaces[] = { + static const InterfaceInfo interfaces[] = { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }; diff --git a/hw/misc/ivshmem-pci.c b/hw/misc/ivshmem-pci.c index 2844b6f9099..5a10bca633d 100644 --- a/hw/misc/ivshmem-pci.c +++ b/hw/misc/ivshmem-pci.c @@ -1002,7 +1002,7 @@ static const TypeInfo ivshmem_common_info = { .instance_size = sizeof(IVShmemState), .abstract = true, .class_init = ivshmem_common_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index 1b4e386b0d8..f03cf7e06fc 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -205,7 +205,7 @@ static const TypeInfo macio_gpio_init_info = { .instance_size = sizeof(MacIOGPIOState), .instance_init = macio_gpio_init, .class_init = macio_gpio_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { } }, diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index b0418db49ea..6710485d728 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -465,7 +465,7 @@ static const TypeInfo macio_type_info = { .instance_init = macio_instance_init, .abstract = true, .class_init = macio_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 0ea26451f1f..3f6a8bba84f 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -345,7 +345,7 @@ static const TypeInfo pci_testdev_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCITestDevState), .class_init = pci_testdev_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/misc/pvpanic-isa.c b/hw/misc/pvpanic-isa.c index 55522ee56cb..f7b421c713b 100644 --- a/hw/misc/pvpanic-isa.c +++ b/hw/misc/pvpanic-isa.c @@ -121,7 +121,7 @@ static const TypeInfo pvpanic_isa_info = { .instance_size = sizeof(PVPanicISAState), .instance_init = pvpanic_isa_initfn, .class_init = pvpanic_isa_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/misc/pvpanic-pci.c b/hw/misc/pvpanic-pci.c index 51ebf661076..2869b6a7ff8 100644 --- a/hw/misc/pvpanic-pci.c +++ b/hw/misc/pvpanic-pci.c @@ -80,7 +80,7 @@ static const TypeInfo pvpanic_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PVPanicPCIState), .class_init = pvpanic_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } } diff --git a/hw/misc/xlnx-versal-cframe-reg.c b/hw/misc/xlnx-versal-cframe-reg.c index e28d569ebef..1ce083e2409 100644 --- a/hw/misc/xlnx-versal-cframe-reg.c +++ b/hw/misc/xlnx-versal-cframe-reg.c @@ -833,7 +833,7 @@ static const TypeInfo cframe_reg_info = { .instance_size = sizeof(XlnxVersalCFrameReg), .class_init = cframe_reg_class_init, .instance_init = cframe_reg_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XLNX_CFI_IF }, { } } diff --git a/hw/misc/xlnx-versal-cfu.c b/hw/misc/xlnx-versal-cfu.c index 02e4fed05b9..b920fc77c3f 100644 --- a/hw/misc/xlnx-versal-cfu.c +++ b/hw/misc/xlnx-versal-cfu.c @@ -532,7 +532,7 @@ static const TypeInfo cfu_apb_info = { .instance_size = sizeof(XlnxVersalCFUAPB), .class_init = cfu_apb_class_init, .instance_init = cfu_apb_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XLNX_CFI_IF }, { } } @@ -545,7 +545,7 @@ static const TypeInfo cfu_fdro_info = { .class_init = cfu_fdro_class_init, .instance_init = cfu_fdro_init, .instance_finalize = cfu_fdro_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XLNX_CFI_IF }, { } } diff --git a/hw/net/can/can_kvaser_pci.c b/hw/net/can/can_kvaser_pci.c index c0bb598baef..be16769de29 100644 --- a/hw/net/can/can_kvaser_pci.c +++ b/hw/net/can/can_kvaser_pci.c @@ -305,7 +305,7 @@ static const TypeInfo kvaser_pci_info = { .instance_size = sizeof(KvaserPCIState), .class_init = kvaser_pci_class_init, .instance_init = kvaser_pci_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/can/can_mioe3680_pci.c b/hw/net/can/can_mioe3680_pci.c index 9aac70dccd3..44f3ba370dc 100644 --- a/hw/net/can/can_mioe3680_pci.c +++ b/hw/net/can/can_mioe3680_pci.c @@ -248,7 +248,7 @@ static const TypeInfo mioe3680_pci_info = { .instance_size = sizeof(Mioe3680PCIState), .class_init = mioe3680_pci_class_init, .instance_init = mioe3680_pci_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/can/can_pcm3680_pci.c b/hw/net/can/can_pcm3680_pci.c index b305f7e9b7d..7296d63be79 100644 --- a/hw/net/can/can_pcm3680_pci.c +++ b/hw/net/can/can_pcm3680_pci.c @@ -249,7 +249,7 @@ static const TypeInfo pcm3680i_pci_info = { .instance_size = sizeof(Pcm3680iPCIState), .class_init = pcm3680i_pci_class_init, .instance_init = pcm3680i_pci_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/can/ctucan_pci.c b/hw/net/can/ctucan_pci.c index 0dee9b59d10..bed6785433e 100644 --- a/hw/net/can/ctucan_pci.c +++ b/hw/net/can/ctucan_pci.c @@ -262,7 +262,7 @@ static const TypeInfo ctucan_pci_info = { .instance_size = sizeof(CtuCanPCIState), .class_init = ctucan_pci_class_init, .instance_init = ctucan_pci_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 13814e84d18..cba4999e6d0 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1732,7 +1732,7 @@ static const TypeInfo e1000_base_info = { .instance_init = e1000_instance_init, .class_size = sizeof(E1000BaseClass), .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index 5e58f39235e..ae4fcdc544d 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -722,7 +722,7 @@ static const TypeInfo e1000e_info = { .instance_size = sizeof(E1000EState), .class_init = e1000e_class_init, .instance_init = e1000e_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 02a4e787f67..10d4a00ec99 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -2096,7 +2096,7 @@ static void eepro100_register_types(void) type_info.class_init = eepro100_class_init; type_info.instance_size = sizeof(EEPRO100State); type_info.instance_init = eepro100_instance_init; - type_info.interfaces = (InterfaceInfo[]) { + type_info.interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }; diff --git a/hw/net/igb.c b/hw/net/igb.c index 61e7ea7896b..62c5869f51d 100644 --- a/hw/net/igb.c +++ b/hw/net/igb.c @@ -632,7 +632,7 @@ static const TypeInfo igb_info = { .instance_size = sizeof(IGBState), .class_init = igb_class_init, .instance_init = igb_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/net/igbvf.c b/hw/net/igbvf.c index 91e7ccf931b..31d72c4977d 100644 --- a/hw/net/igbvf.c +++ b/hw/net/igbvf.c @@ -325,7 +325,7 @@ static const TypeInfo igbvf_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(IgbVfState), .class_init = igbvf_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c index 2153973af43..ce937e1b618 100644 --- a/hw/net/ne2000-pci.c +++ b/hw/net/ne2000-pci.c @@ -122,7 +122,7 @@ static const TypeInfo ne2000_info = { .instance_size = sizeof(PCINE2000State), .class_init = ne2000_class_init, .instance_init = ne2000_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 429c2171803..0ca5bc21938 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -280,7 +280,7 @@ static const TypeInfo pcnet_info = { .instance_size = sizeof(PCIPCNetState), .class_init = pcnet_class_init, .instance_init = pcnet_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 3d307f4ab15..cc49701dd3c 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1498,7 +1498,7 @@ static const TypeInfo rocker_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(Rocker), .class_init = rocker_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index ad812954cf8..15b8f7501ae 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3438,7 +3438,7 @@ static const TypeInfo rtl8139_info = { .instance_size = sizeof(RTL8139State), .class_init = rtl8139_class_init, .instance_init = rtl8139_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 123d08ee8e3..b405eb89fa5 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -1477,7 +1477,7 @@ static const TypeInfo sungem_info = { .instance_size = sizeof(SunGEMState), .class_init = sungem_class_init, .instance_init = sungem_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } } diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 46c9f5020b1..c2f7a8483da 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -958,7 +958,7 @@ static const TypeInfo sunhme_info = { .class_init = sunhme_class_init, .instance_size = sizeof(SunHMEState), .instance_init = sunhme_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } } diff --git a/hw/net/tulip.c b/hw/net/tulip.c index fb3366d8ee3..63fe5134586 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -1035,7 +1035,7 @@ static const TypeInfo tulip_info = { .instance_size = sizeof(TULIPState), .class_init = tulip_class_init, .instance_init = tulip_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 702a0ac78dc..85c230e3e93 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -2523,7 +2523,7 @@ static const TypeInfo vmxnet3_info = { .instance_size = sizeof(VMXNET3State), .class_init = vmxnet3_class_init, .instance_init = vmxnet3_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index e45bc048e05..1f5c7480476 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -1045,7 +1045,7 @@ static const TypeInfo xilinx_enet_data_stream_info = { .parent = TYPE_OBJECT, .instance_size = sizeof(XilinxAXIEnetStreamSink), .class_init = xilinx_enet_data_stream_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_STREAM_SINK }, { } } @@ -1056,7 +1056,7 @@ static const TypeInfo xilinx_enet_control_stream_info = { .parent = TYPE_OBJECT, .instance_size = sizeof(XilinxAXIEnetStreamSink), .class_init = xilinx_enet_control_stream_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_STREAM_SINK }, { } } diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index a49f1ea9cfe..5c378034ee1 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -9097,7 +9097,7 @@ static const TypeInfo nvme_info = { .instance_size = sizeof(NvmeCtrl), .instance_init = nvme_instance_init, .class_init = nvme_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-bridge/cxl_downstream.c b/hw/pci-bridge/cxl_downstream.c index ab3b550a889..1065245a8b8 100644 --- a/hw/pci-bridge/cxl_downstream.c +++ b/hw/pci-bridge/cxl_downstream.c @@ -241,7 +241,7 @@ static const TypeInfo cxl_dsp_info = { .instance_size = sizeof(CXLDownstreamPort), .parent = TYPE_PCIE_SLOT, .class_init = cxl_dsp_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CXL_DEVICE }, { } diff --git a/hw/pci-bridge/cxl_root_port.c b/hw/pci-bridge/cxl_root_port.c index 8b1e149e9ba..e6a4035d26c 100644 --- a/hw/pci-bridge/cxl_root_port.c +++ b/hw/pci-bridge/cxl_root_port.c @@ -294,7 +294,7 @@ static const TypeInfo cxl_root_port_info = { .parent = TYPE_PCIE_ROOT_PORT, .instance_size = sizeof(CXLRootPort), .class_init = cxl_root_port_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CXL_DEVICE }, { } }, diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c index 822a8285554..208e0c6172e 100644 --- a/hw/pci-bridge/cxl_upstream.c +++ b/hw/pci-bridge/cxl_upstream.c @@ -394,7 +394,7 @@ static const TypeInfo cxl_usp_info = { .parent = TYPE_PCIE_PORT, .instance_size = sizeof(CXLUpstreamPort), .class_init = cxl_upstream_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CXL_DEVICE }, { } diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index f2b294aee27..1d73c14c1f8 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -107,7 +107,7 @@ static const TypeInfo i82801b11_bridge_info = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(I82801b11Bridge), .class_init = i82801b11_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 4ac07e82567..3df2517dbc9 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -268,7 +268,7 @@ static const TypeInfo pci_bridge_dev_info = { .instance_size = sizeof(PCIBridgeDev), .class_init = pci_bridge_dev_class_init, .instance_finalize = pci_bridge_dev_instance_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 1e2e394ee8a..3a29dfefc2c 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -449,7 +449,7 @@ static const TypeInfo pxb_dev_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PXBDev), .class_init = pxb_dev_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -486,7 +486,7 @@ static const TypeInfo pxb_pcie_dev_info = { .parent = TYPE_PXB_DEV, .instance_size = sizeof(PXBPCIEDev), .class_init = pxb_pcie_dev_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -537,7 +537,7 @@ static const TypeInfo pxb_cxl_dev_info = { .instance_size = sizeof(PXBCXLDev), .class_init = pxb_cxl_dev_class_init, .interfaces = - (InterfaceInfo[]){ + (const InterfaceInfo[]){ { INTERFACE_CONVENTIONAL_PCI_DEVICE }, {}, }, diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c index bb81bccb185..4f3cfb11ceb 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -163,7 +163,7 @@ static const TypeInfo pcie_pci_bridge_info = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(PCIEPCIBridge), .class_init = pcie_pci_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { INTERFACE_PCIE_DEVICE }, { }, diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 512c2ab305c..22c2fdb71e7 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -188,7 +188,7 @@ static const TypeInfo rp_info = { .class_init = rp_class_init, .abstract = true, .class_size = sizeof(PCIERootPortClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-bridge/simba.c b/hw/pci-bridge/simba.c index c7565d9e946..bbae594e119 100644 --- a/hw/pci-bridge/simba.c +++ b/hw/pci-bridge/simba.c @@ -87,7 +87,7 @@ static const TypeInfo simba_pci_bridge_info = { .parent = TYPE_PCI_BRIDGE, .class_init = simba_pci_bridge_class_init, .instance_size = sizeof(SimbaPCIBridge), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c index d85c23fe4a8..dc7d1aa7d77 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -175,7 +175,7 @@ static const TypeInfo xio3130_downstream_info = { .name = TYPE_XIO3130_DOWNSTREAM, .parent = TYPE_PCIE_SLOT, .class_init = xio3130_downstream_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c index d7a27158124..40057b749bf 100644 --- a/hw/pci-bridge/xio3130_upstream.c +++ b/hw/pci-bridge/xio3130_upstream.c @@ -144,7 +144,7 @@ static const TypeInfo xio3130_upstream_info = { .name = "x3130-upstream", .parent = TYPE_PCIE_PORT, .class_init = xio3130_upstream_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-host/articia.c b/hw/pci-host/articia.c index 043fb85e840..cc65aac2a87 100644 --- a/hw/pci-host/articia.c +++ b/hw/pci-host/articia.c @@ -273,7 +273,7 @@ static const TypeInfo articia_types[] = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(ArticiaHostState), .class_init = articia_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -283,7 +283,7 @@ static const TypeInfo articia_types[] = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = articia_pci_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 4508cdd21ae..7d6251a78d7 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -783,7 +783,7 @@ static const TypeInfo bonito_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIBonitoState), .class_init = bonito_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 70759cab149..4a2cf11bac1 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -766,7 +766,7 @@ static const TypeInfo designware_pcie_types[] = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(DesignwarePCIERoot), .class_init = designware_pcie_root_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c index 7dcac4ee3c4..b806a2286f7 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -261,7 +261,7 @@ static const TypeInfo gpex_root_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(GPEXRootState), .class_init = gpex_root_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index b48d44623dd..f9da5a908c1 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -116,7 +116,7 @@ static const TypeInfo grackle_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = grackle_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index bd74b6e8714..56a6ef93b7a 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -1268,7 +1268,7 @@ static const TypeInfo gt64120_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = gt64120_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index fcc9f3818a4..e13bb1b53e4 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -341,7 +341,7 @@ static const TypeInfo i440fx_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCII440FXState), .class_init = i440fx_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c index 591186f41ff..41a68959831 100644 --- a/hw/pci-host/mv64361.c +++ b/hw/pci-host/mv64361.c @@ -46,7 +46,7 @@ static const TypeInfo mv64361_pcibridge_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = mv64361_pcibridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/pnv_phb3_pbcq.c b/hw/pci-host/pnv_phb3_pbcq.c index 4e24b1449d0..1f7a149580d 100644 --- a/hw/pci-host/pnv_phb3_pbcq.c +++ b/hw/pci-host/pnv_phb3_pbcq.c @@ -354,7 +354,7 @@ static const TypeInfo pnv_pbcq_type_info = { .instance_size = sizeof(PnvPBCQState), .instance_init = phb3_pbcq_instance_init, .class_init = pnv_pbcq_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index feb812dc1a9..77ea35299d3 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1714,7 +1714,7 @@ static const TypeInfo pnv_phb4_type_info = { .instance_init = pnv_phb4_instance_init, .instance_size = sizeof(PnvPHB4), .class_init = pnv_phb4_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XIVE_NOTIFIER }, { }, } diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index a4e5e8c226c..645c745dd45 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -340,7 +340,7 @@ static const TypeInfo pnv_pec_type_info = { .instance_size = sizeof(PnvPhb4PecState), .class_init = pnv_pec_class_init, .class_size = sizeof(PnvPhb4PecClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } @@ -392,7 +392,7 @@ static const TypeInfo pnv_phb5_pec_type_info = { .instance_size = sizeof(PnvPhb4PecState), .class_init = pnv_phb5_pec_class_init, .class_size = sizeof(PnvPhb4PecClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/pci-host/ppc4xx_pci.c b/hw/pci-host/ppc4xx_pci.c index dcc4b78660c..25478176881 100644 --- a/hw/pci-host/ppc4xx_pci.c +++ b/hw/pci-host/ppc4xx_pci.c @@ -370,7 +370,7 @@ static const TypeInfo ppc4xx_host_bridge_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = ppc4xx_host_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 2f6354c931e..e97a515d5fe 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -528,7 +528,7 @@ static const TypeInfo e500_pci_types[] = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PPCE500PCIBridgeState), .class_init = e500_host_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index c2a71108f2e..1951ae440cc 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -703,7 +703,7 @@ static const TypeInfo mch_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(MCHPCIState), .class_init = mch_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 3f158838a0a..21f7ca65e06 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -416,7 +416,7 @@ static const TypeInfo raven_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(RavenPCIState), .class_init = raven_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index f7086086f9a..538624c5079 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -477,7 +477,7 @@ static const TypeInfo sabre_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(SabrePCIState), .class_init = sabre_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 52bff66d6a1..de8f6a84aab 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -186,7 +186,7 @@ static const TypeInfo sh_pcic_types[] = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = sh_pcic_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 7cb37e01d8f..194037d6e75 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -333,7 +333,7 @@ static const TypeInfo unin_main_pci_host_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = unin_main_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -361,7 +361,7 @@ static const TypeInfo u3_agp_pci_host_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = u3_agp_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -389,7 +389,7 @@ static const TypeInfo unin_agp_pci_host_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = unin_agp_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -418,7 +418,7 @@ static const TypeInfo unin_internal_pci_host_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = unin_internal_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index 10bb89f528f..24458b676e9 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -492,7 +492,7 @@ static const TypeInfo versatile_pci_host_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = versatile_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 70e9b2b9810..c71492de9e7 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -314,7 +314,7 @@ static const TypeInfo xilinx_pcie_root_info = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(XilinxPCIERoot), .class_init = xilinx_pcie_root_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e9e0524f5c3..4529241ee8f 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -288,7 +288,7 @@ static const TypeInfo pci_bus_info = { .instance_size = sizeof(PCIBus), .class_size = sizeof(PCIBusClass), .class_init = pci_bus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE }, { } } diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 0fe66e8b12d..76255c4cd89 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -497,7 +497,7 @@ static const TypeInfo pci_bridge_type_info = { .instance_size = sizeof(PCIBridge), .class_init = pci_bridge_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c index 8629b3aafd6..54f639e3d4f 100644 --- a/hw/pci/pcie_port.c +++ b/hw/pci/pcie_port.c @@ -230,7 +230,7 @@ static const TypeInfo pcie_slot_type_info = { .instance_size = sizeof(PCIESlot), .abstract = true, .class_init = pcie_slot_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index cd594eeb3ed..775b9d8da00 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -107,7 +107,7 @@ static const TypeInfo e500plat_info = { .name = TYPE_E500PLAT_MACHINE, .parent = TYPE_PPCE500_MACHINE, .class_init = e500plat_machine_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index dc4bd85544a..bc74808a785 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -645,7 +645,7 @@ static const TypeInfo core99_machine_info = { .class_init = core99_machine_class_init, .instance_init = core99_instance_init, .instance_size = sizeof(Core99MachineState), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_PATH_PROVIDER }, { } }, diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 3906fb724e6..614929b463e 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -434,7 +434,7 @@ static const TypeInfo ppc_heathrow_machine_info = { .name = MACHINE_TYPE_NAME("g3beige"), .parent = TYPE_MACHINE, .class_init = heathrow_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_PATH_PROVIDER }, { } }, diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index dac1f11c225..724299c7b69 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -620,7 +620,7 @@ static const TypeInfo pegasos2_machine_info = { .parent = TYPE_MACHINE, .class_init = pegasos2_machine_class_init, .instance_size = sizeof(Pegasos2MachineState), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PPC_VIRTUAL_HYPERVISOR }, { TYPE_VOF_MACHINE_IF }, { } diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 6d95e24dd2b..8bf8c1149d0 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -2926,7 +2926,7 @@ static const TypeInfo types[] = { .name = MACHINE_TYPE_NAME("powernv10"), .parent = TYPE_PNV_MACHINE, .class_init = pnv_machine_power10_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XIVE_FABRIC }, { }, }, @@ -2935,7 +2935,7 @@ static const TypeInfo types[] = { .name = MACHINE_TYPE_NAME("powernv9"), .parent = TYPE_PNV_MACHINE, .class_init = pnv_machine_power9_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XIVE_FABRIC }, { }, }, @@ -2944,7 +2944,7 @@ static const TypeInfo types[] = { .name = MACHINE_TYPE_NAME("powernv8"), .parent = TYPE_PNV_MACHINE, .class_init = pnv_machine_power8_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XICS_FABRIC }, { }, }, @@ -2956,7 +2956,7 @@ static const TypeInfo types[] = { .instance_size = sizeof(PnvMachineState), .class_init = pnv_machine_class_init, .class_size = sizeof(PnvMachineClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_INTERRUPT_STATS_PROVIDER }, { TYPE_NMI }, { }, diff --git a/hw/ppc/pnv_adu.c b/hw/ppc/pnv_adu.c index f9620806ec7..005fbda4750 100644 --- a/hw/ppc/pnv_adu.c +++ b/hw/ppc/pnv_adu.c @@ -204,7 +204,7 @@ static const TypeInfo pnv_adu_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(PnvADU), .class_init = pnv_adu_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } }, }; diff --git a/hw/ppc/pnv_chiptod.c b/hw/ppc/pnv_chiptod.c index 4ca511a4dee..b9e9c7ba3db 100644 --- a/hw/ppc/pnv_chiptod.c +++ b/hw/ppc/pnv_chiptod.c @@ -478,7 +478,7 @@ static const TypeInfo pnv_chiptod_power9_type_info = { .parent = TYPE_PNV_CHIPTOD, .instance_size = sizeof(PnvChipTOD), .class_init = pnv_chiptod_power9_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } @@ -514,7 +514,7 @@ static const TypeInfo pnv_chiptod_power10_type_info = { .parent = TYPE_PNV_CHIPTOD, .instance_size = sizeof(PnvChipTOD), .class_init = pnv_chiptod_power10_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c index b2f372c8743..60de4794917 100644 --- a/hw/ppc/pnv_i2c.c +++ b/hw/ppc/pnv_i2c.c @@ -569,7 +569,7 @@ static const TypeInfo pnv_i2c_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(PnvI2C), .class_init = pnv_i2c_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 84079443738..ae309a130aa 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -721,7 +721,7 @@ static const TypeInfo pnv_lpc_power8_info = { .name = TYPE_PNV8_LPC, .parent = TYPE_PNV_LPC, .class_init = pnv_lpc_power8_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/ppc/pnv_n1_chiplet.c b/hw/ppc/pnv_n1_chiplet.c index 05e3fd6f731..053f6473f22 100644 --- a/hw/ppc/pnv_n1_chiplet.c +++ b/hw/ppc/pnv_n1_chiplet.c @@ -159,7 +159,7 @@ static const TypeInfo pnv_n1_chiplet_info = { .instance_init = pnv_n1_chiplet_instance_init, .instance_size = sizeof(PnvN1Chiplet), .class_init = pnv_n1_chiplet_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/ppc/pnv_nest_pervasive.c b/hw/ppc/pnv_nest_pervasive.c index b5182d54fa1..1b1b14fed95 100644 --- a/hw/ppc/pnv_nest_pervasive.c +++ b/hw/ppc/pnv_nest_pervasive.c @@ -194,7 +194,7 @@ static const TypeInfo pnv_nest_pervasive_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(PnvNestChipletPervasive), .class_init = pnv_nest_pervasive_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index 5eed22252df..1e84ab97aeb 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -913,7 +913,7 @@ static const TypeInfo pnv_psi_power9_info = { .instance_size = sizeof(Pnv9Psi), .instance_init = pnv_psi_power9_instance_init, .class_init = pnv_psi_power9_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_XIVE_NOTIFIER }, { }, }, @@ -959,7 +959,7 @@ static const TypeInfo pnv_psi_info = { .class_init = pnv_psi_class_init, .class_size = sizeof(PnvPsiClass), .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bb31dc96a80..6bb226c726f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4683,7 +4683,7 @@ static const TypeInfo spapr_machine_info = { .instance_finalize = spapr_machine_finalizefn, .class_size = sizeof(SpaprMachineClass), .class_init = spapr_machine_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_PATH_PROVIDER }, { TYPE_NMI }, { TYPE_HOTPLUG_HANDLER }, diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index a2f7e731623..ce10818f42f 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2186,7 +2186,7 @@ static const TypeInfo spapr_phb_info = { .instance_size = sizeof(SpaprPhbState), .instance_finalize = spapr_phb_finalizefn, .class_init = spapr_phb_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/remote/machine.c b/hw/remote/machine.c index dadc5ce3307..0cc3c3ad770 100644 --- a/hw/remote/machine.c +++ b/hw/remote/machine.c @@ -146,7 +146,7 @@ static const TypeInfo remote_machine = { .instance_size = sizeof(RemoteMachineState), .instance_init = remote_machine_instance_init, .class_init = remote_machine_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/remote/proxy.c b/hw/remote/proxy.c index d2de48c9e37..b0165aa2a1d 100644 --- a/hw/remote/proxy.c +++ b/hw/remote/proxy.c @@ -215,7 +215,7 @@ static const TypeInfo pci_proxy_dev_type_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIProxyDev), .class_init = pci_proxy_dev_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/remote/remote-obj.c b/hw/remote/remote-obj.c index 75f8d6df8a1..85882902d7f 100644 --- a/hw/remote/remote-obj.c +++ b/hw/remote/remote-obj.c @@ -188,7 +188,7 @@ static const TypeInfo remote_object_info = { .instance_finalize = remote_object_finalize, .class_size = sizeof(RemoteObjectClass), .class_init = remote_object_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 23f339936a2..803ca656a29 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -944,7 +944,7 @@ static const TypeInfo vfu_object_info = { .instance_finalize = vfu_object_finalize, .class_size = sizeof(VfuObjectClass), .class_init = vfu_object_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/hw/riscv/riscv-iommu-pci.c b/hw/riscv/riscv-iommu-pci.c index 4e0e3cc5be5..106410b7ca4 100644 --- a/hw/riscv/riscv-iommu-pci.c +++ b/hw/riscv/riscv-iommu-pci.c @@ -208,7 +208,7 @@ static const TypeInfo riscv_iommu_pci = { .class_init = riscv_iommu_pci_class_init, .instance_init = riscv_iommu_pci_init, .instance_size = sizeof(RISCVIOMMUStatePci), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { }, }, diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 1744ed8c73c..eb1878b8b20 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1980,7 +1980,7 @@ static const TypeInfo virt_machine_typeinfo = { .class_init = virt_machine_class_init, .instance_init = virt_machine_instance_init, .instance_size = sizeof(RISCVVirtState), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } }, diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index 4a7c0af9f04..9e2f6563a0a 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -140,7 +140,7 @@ static const TypeInfo m48txx_isa_type_info = { .instance_size = sizeof(M48txxISAState), .abstract = true, .class_init = m48txx_isa_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NVRAM }, { } } diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index 821472a680e..68be2dad6f3 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -658,7 +658,7 @@ static const TypeInfo m48txx_sysbus_type_info = { .instance_init = m48t59_init1, .abstract = true, .class_init = m48txx_sysbus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NVRAM }, { } } diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 93b632bdf4a..6f787be7af8 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -1038,7 +1038,7 @@ static const TypeInfo mc146818rtc_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(MC146818RtcState), .class_init = rtc_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_ACPI_DEV_AML_IF }, { }, }, diff --git a/hw/s390x/ap-bridge.c b/hw/s390x/ap-bridge.c index 4aa7d5a90db..edeb3dbef34 100644 --- a/hw/s390x/ap-bridge.c +++ b/hw/s390x/ap-bridge.c @@ -75,7 +75,7 @@ static const TypeInfo ap_bridge_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = 0, .class_init = ap_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c index 9d91e5a5fec..0f87b8c5c44 100644 --- a/hw/s390x/css-bridge.c +++ b/hw/s390x/css-bridge.c @@ -136,7 +136,7 @@ static const TypeInfo virtual_css_bridge_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(VirtualCssBridge), .class_init = virtual_css_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 3edc3493a46..cc777470bc1 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1338,7 +1338,7 @@ static const TypeInfo s390_pcihost_info = { .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(S390pciState), .class_init = s390_pcihost_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 74848d34710..e95f885bce6 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -873,7 +873,7 @@ static const TypeInfo ccw_machine_info = { .instance_init = s390_machine_initfn, .class_size = sizeof(S390CcwMachineClass), .class_init = ccw_machine_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_NMI }, { TYPE_HOTPLUG_HANDLER}, { } diff --git a/hw/s390x/virtio-ccw-md.c b/hw/s390x/virtio-ccw-md.c index de333282df4..0370f584505 100644 --- a/hw/s390x/virtio-ccw-md.c +++ b/hw/s390x/virtio-ccw-md.c @@ -140,7 +140,7 @@ static const TypeInfo virtio_ccw_md_info = { .instance_size = sizeof(VirtIOMDCcw), .class_size = sizeof(VirtIOMDCcwClass), .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_MEMORY_DEVICE }, { } }, diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 74e9af0b5d8..12c86eb7aaa 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -450,7 +450,7 @@ static const TypeInfo esp_pci_info = { .instance_init = esp_pci_init, .instance_size = sizeof(PCIESPState), .class_init = esp_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 81da262289c..4f01ab2ce08 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2396,7 +2396,7 @@ static const TypeInfo lsi_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(LSIState), .class_init = lsi_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 6104d4202aa..03cd837b44f 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2487,7 +2487,7 @@ typedef struct MegasasInfo { const VMStateDescription *vmsd; const Property *props; size_t props_count; - InterfaceInfo *interfaces; + const InterfaceInfo *interfaces; } MegasasInfo; static struct MegasasInfo megasas_devices[] = { @@ -2504,7 +2504,7 @@ static struct MegasasInfo megasas_devices[] = { .vmsd = &vmstate_megasas_gen1, .props = megasas_properties_gen1, .props_count = ARRAY_SIZE(megasas_properties_gen1), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -2521,7 +2521,7 @@ static struct MegasasInfo megasas_devices[] = { .vmsd = &vmstate_megasas_gen2, .props = megasas_properties_gen2, .props_count = ARRAY_SIZE(megasas_properties_gen2), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { } }, diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 17f73ce3816..1ebe0b82a79 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -1441,7 +1441,7 @@ static const TypeInfo mptsas_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(MPTSASState), .class_init = mptsas1068_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index d7d0ef8f21f..7212e8a84bd 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1995,7 +1995,7 @@ static const TypeInfo scsi_bus_info = { .parent = TYPE_BUS, .instance_size = sizeof(SCSIBus), .class_init = scsi_bus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 6a7bb5949ad..3e5ae2e3379 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -398,7 +398,7 @@ static const TypeInfo vhost_scsi_info = { .instance_size = sizeof(VHostSCSI), .class_init = vhost_scsi_class_init, .instance_init = vhost_scsi_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_PATH_PROVIDER }, { } }, diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index 807a58ecf4c..8298e8cc6d8 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -422,7 +422,7 @@ static const TypeInfo vhost_user_scsi_info = { .instance_size = sizeof(VHostUserSCSI), .class_init = vhost_user_scsi_class_init, .instance_init = vhost_user_scsi_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_PATH_PROVIDER }, { } }, diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 8490a4dc711..f0bcf7895ed 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -1354,7 +1354,7 @@ static const TypeInfo virtio_scsi_info = { .parent = TYPE_VIRTIO_SCSI_COMMON, .instance_size = sizeof(VirtIOSCSI), .class_init = virtio_scsi_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index a8ea57ffad3..d5825b67868 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -1346,7 +1346,7 @@ static const TypeInfo pvscsi_info = { .class_size = sizeof(PVSCSIClass), .instance_size = sizeof(PVSCSIState), .class_init = pvscsi_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, diff --git a/hw/sd/sdhci-pci.c b/hw/sd/sdhci-pci.c index 4c2944df01c..e957dea4827 100644 --- a/hw/sd/sdhci-pci.c +++ b/hw/sd/sdhci-pci.c @@ -73,7 +73,7 @@ static const TypeInfo sdhci_pci_types[] = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(SDHCIState), .class_init = sdhci_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 0794c1fbff0..f92cb599881 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -397,7 +397,7 @@ static const TypeInfo ebus_info = { .parent = TYPE_PCI_DEVICE, .class_init = ebus_class_init, .instance_size = sizeof(EbusState), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, @@ -817,7 +817,7 @@ static const TypeInfo sun4u_type = { .name = MACHINE_TYPE_NAME("sun4u"), .parent = TYPE_MACHINE, .class_init = sun4u_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_FW_PATH_PROVIDER }, { } }, diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c index 9575cb88fd5..a43878528e0 100644 --- a/hw/ssi/pnv_spi.c +++ b/hw/ssi/pnv_spi.c @@ -1255,7 +1255,7 @@ static const TypeInfo pnv_spi_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(PnvSpi), .class_init = pnv_spi_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_PNV_XSCOM_INTERFACE }, { } } diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index 8a3dd32fbeb..47c3e36282a 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm/tpm_crb.c @@ -337,7 +337,7 @@ static const TypeInfo tpm_crb_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(CRBState), .class_init = tpm_crb_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { } } diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c index 1cad9a88ead..ea608ba4c80 100644 --- a/hw/tpm/tpm_spapr.c +++ b/hw/tpm/tpm_spapr.c @@ -414,7 +414,7 @@ static const TypeInfo tpm_spapr_info = { .parent = TYPE_VIO_SPAPR_DEVICE, .instance_size = sizeof(SpaprTpmState), .class_init = tpm_spapr_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { } } diff --git a/hw/tpm/tpm_tis_i2c.c b/hw/tpm/tpm_tis_i2c.c index 2c28028b54f..c23deaf7d96 100644 --- a/hw/tpm/tpm_tis_i2c.c +++ b/hw/tpm/tpm_tis_i2c.c @@ -556,7 +556,7 @@ static const TypeInfo tpm_tis_i2c_info = { .parent = TYPE_I2C_SLAVE, .instance_size = sizeof(TPMStateI2C), .class_init = tpm_tis_i2c_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { } } diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index c0098a26e80..dce83057a94 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -189,7 +189,7 @@ static const TypeInfo tpm_tis_isa_info = { .instance_size = sizeof(TPMStateISA), .instance_init = tpm_tis_isa_initfn, .class_init = tpm_tis_isa_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { TYPE_ACPI_DEV_AML_IF }, { } diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c index 862556c3a64..969917c4c08 100644 --- a/hw/tpm/tpm_tis_sysbus.c +++ b/hw/tpm/tpm_tis_sysbus.c @@ -146,7 +146,7 @@ static const TypeInfo tpm_tis_sysbus_info = { .instance_size = sizeof(TPMStateSysBus), .instance_init = tpm_tis_sysbus_initfn, .class_init = tpm_tis_sysbus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { } } diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index 24dcdc7ee36..54acdc56068 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -1813,7 +1813,7 @@ static const TypeInfo ufs_info = { .parent = TYPE_PCI_DEVICE, .class_init = ufs_class_init, .instance_size = sizeof(UfsHc), - .interfaces = (InterfaceInfo[]){ { INTERFACE_PCIE_DEVICE }, {} }, + .interfaces = (const InterfaceInfo[]){ { INTERFACE_PCIE_DEVICE }, {} }, }; static const TypeInfo ufs_bus_info = { diff --git a/hw/usb/bus.c b/hw/usb/bus.c index d8446cf50e6..8dd2ce415eb 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -42,7 +42,7 @@ static const TypeInfo usb_bus_info = { .parent = TYPE_BUS, .instance_size = sizeof(USBBus), .class_init = usb_bus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 1bb4332238f..73a624aec69 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1459,7 +1459,7 @@ static const TypeInfo ccid_info = { .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBCCIDState), .class_init = ccid_class_initfn, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 73122aa7971..38ad3406b32 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -172,7 +172,7 @@ static const TypeInfo ehci_pci_type_info = { .instance_finalize = usb_ehci_pci_finalize, .abstract = true, .class_init = ehci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 3c82525a1e4..94d1077eb9e 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -149,7 +149,7 @@ static const TypeInfo ohci_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(OHCIPCIState), .class_init = ohci_pci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 2b1aee1f21f..4822c704f69 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1278,7 +1278,7 @@ static const TypeInfo uhci_pci_type_info = { .class_size = sizeof(UHCIPCIDeviceClass), .abstract = true, .class_init = uhci_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index cc5c4e600e0..9128cbf16c9 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -224,7 +224,7 @@ static const TypeInfo xhci_pci_info = { .class_init = xhci_class_init, .instance_init = xhci_instance_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c index ebeceaadcd9..e92678fcc07 100644 --- a/hw/vfio/igd.c +++ b/hw/vfio/igd.c @@ -265,7 +265,7 @@ static const TypeInfo vfio_pci_igd_lpc_bridge_info = { .name = "vfio-pci-igd-lpc-bridge", .parent = TYPE_PCI_DEVICE, .class_init = vfio_pci_igd_lpc_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 5f3d7d044f3..c595f67c7b7 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3442,7 +3442,7 @@ static const TypeInfo vfio_pci_dev_info = { .class_init = vfio_pci_dev_class_init, .instance_init = vfio_instance_init, .instance_finalize = vfio_instance_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } diff --git a/hw/virtio/virtio-md-pci.c b/hw/virtio/virtio-md-pci.c index 9ec50676626..9278b32cf84 100644 --- a/hw/virtio/virtio-md-pci.c +++ b/hw/virtio/virtio-md-pci.c @@ -138,7 +138,7 @@ static const TypeInfo virtio_md_pci_info = { .instance_size = sizeof(VirtIOMDPCI), .class_size = sizeof(VirtIOMDPCIClass), .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_MEMORY_DEVICE }, { } }, diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 9fc05a11da0..f8e8d52d992 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -1909,7 +1909,7 @@ static const TypeInfo virtio_mem_info = { .instance_finalize = virtio_mem_instance_finalize, .class_init = virtio_mem_class_init, .class_size = sizeof(VirtIOMEMClass), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_RAM_DISCARD_MANAGER }, { } }, diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 48082445bc6..a72f878e949 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2484,7 +2484,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->generic_name, .parent = base_type_info.name, .class_init = virtio_pci_generic_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } @@ -2519,7 +2519,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->non_transitional_name, .parent = base_type_info.name, .instance_init = virtio_pci_non_transitional_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { } @@ -2533,7 +2533,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->transitional_name, .parent = base_type_info.name, .instance_init = virtio_pci_transitional_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { /* * Transitional virtio devices work only as Conventional PCI * devices because they require PIO ports. diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index 1536e1fe032..bb8a2766b69 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -480,7 +480,7 @@ static const TypeInfo i6300esb_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(I6300State), .class_init = i6300esb_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 435e03a1e72..eff5d1a059e 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -399,7 +399,7 @@ static const TypeInfo xen_bus_type_info = { .instance_size = sizeof(XenBus), .class_size = sizeof(XenBusClass), .class_init = xen_bus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } }, diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 938dd8fb28f..eb1cb590b53 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -663,7 +663,7 @@ static const TypeInfo xensysbus_info = { .name = TYPE_XENSYSBUS, .parent = TYPE_BUS, .class_init = xen_sysbus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { } } diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index d9f1ddd25c6..6ab06d8ff6c 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -1019,7 +1019,7 @@ static const TypeInfo xen_pci_passthrough_info = { .class_init = xen_pci_passthrough_class_init, .class_size = sizeof(XenPTDeviceClass), .instance_init = xen_pci_passthrough_instance_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { INTERFACE_PCIE_DEVICE }, { }, diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c index 264851ece36..2c0cec97234 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -363,7 +363,7 @@ static const TypeInfo isa_bridge_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), .class_init = isa_bridge_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, }, diff --git a/net/can/can_core.c b/net/can/can_core.c index e16e15c036e..77fe2b8ba48 100644 --- a/net/can/can_core.c +++ b/net/can/can_core.c @@ -162,7 +162,7 @@ static const TypeInfo can_bus_info = { .instance_size = sizeof(CanBusState), .instance_init = can_bus_instance_init, .class_init = can_bus_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/net/can/can_host.c b/net/can/can_host.c index ca5fcf1ea12..3f9bb33e474 100644 --- a/net/can/can_host.c +++ b/net/can/can_host.c @@ -92,7 +92,7 @@ static const TypeInfo can_host_info = { .class_size = sizeof(CanHostClass), .abstract = true, .class_init = can_host_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/net/colo-compare.c b/net/colo-compare.c index 7e5f6e09dba..fe39038d00e 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1478,7 +1478,7 @@ static const TypeInfo colo_compare_info = { .instance_finalize = colo_compare_finalize, .class_size = sizeof(CompareClass), .class_init = colo_compare_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/net/filter.c b/net/filter.c index 03b3c793f76..c7cc6615dc9 100644 --- a/net/filter.c +++ b/net/filter.c @@ -363,7 +363,7 @@ static const TypeInfo netfilter_info = { .instance_size = sizeof(NetFilterState), .instance_init = netfilter_init, .instance_finalize = netfilter_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c index 1977d99ce0d..40e1210eb21 100644 --- a/scsi/pr-manager.c +++ b/scsi/pr-manager.c @@ -77,7 +77,7 @@ static const TypeInfo pr_manager_info = { .name = TYPE_PR_MANAGER, .class_size = sizeof(PRManagerClass), .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/system/qtest.c b/system/qtest.c index 7a8b9ff2a76..1613771de0b 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -1012,7 +1012,7 @@ static const TypeInfo qtest_info = { .parent = TYPE_OBJECT, .class_init = qtest_class_init, .instance_size = sizeof(QTest), - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/target/i386/sev.c b/target/i386/sev.c index f44cc1d2153..6e34f934df5 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -2088,7 +2088,7 @@ static const TypeInfo sev_common_info = { .class_size = sizeof(SevCommonStateClass), .class_init = sev_common_class_init, .abstract = true, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 864741e85ec..0e72aa10b91 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7519,7 +7519,7 @@ static const TypeInfo ppc_cpu_type_info = { .class_size = sizeof(PowerPCCPUClass), .class_init = ppc_cpu_class_init, #ifndef CONFIG_USER_ONLY - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_INTERRUPT_STATS_PROVIDER }, { } }, diff --git a/tests/unit/check-qom-interface.c b/tests/unit/check-qom-interface.c index 4e1c4d67297..86ae5f6c3b1 100644 --- a/tests/unit/check-qom-interface.c +++ b/tests/unit/check-qom-interface.c @@ -52,7 +52,7 @@ static const TypeInfo direct_impl_info = { .name = TYPE_DIRECT_IMPL, .parent = TYPE_OBJECT, .class_init = test_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TEST_IF }, { } } diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplist.c index f1de1618f60..ee3c6fb32b1 100644 --- a/tests/unit/check-qom-proplist.c +++ b/tests/unit/check-qom-proplist.c @@ -164,7 +164,7 @@ static const TypeInfo dummy_info = { .instance_finalize = dummy_finalize, .class_size = sizeof(DummyObjectClass), .class_init = dummy_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/ui/dbus.c b/ui/dbus.c index 0c0f86eaa6f..dd0336702de 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -514,7 +514,7 @@ static const TypeInfo dbus_display_info = { .instance_init = dbus_display_init, .instance_finalize = dbus_display_finalize, .class_init = dbus_display_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 9dce31ea9a7..9793258aac1 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -732,7 +732,7 @@ static const TypeInfo input_barrier_info = { .instance_size = sizeof(InputBarrier), .instance_init = input_barrier_instance_init, .instance_finalize = input_barrier_instance_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/ui/input-linux.c b/ui/input-linux.c index b940198bfe2..147f0052c89 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -523,7 +523,7 @@ static const TypeInfo input_linux_info = { .instance_size = sizeof(InputLinux), .instance_init = input_linux_instance_init, .instance_finalize = input_linux_instance_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/util/thread-context.c b/util/thread-context.c index 95228a3d4f6..0146154fa56 100644 --- a/util/thread-context.c +++ b/util/thread-context.c @@ -319,7 +319,7 @@ static const TypeInfo thread_context_info = { .instance_size = sizeof(ThreadContext), .instance_init = thread_context_instance_init, .instance_finalize = thread_context_instance_finalize, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } diff --git a/hw/display/apple-gfx-pci.m b/hw/display/apple-gfx-pci.m index 2f0d24f7fee..b0694f4cb85 100644 --- a/hw/display/apple-gfx-pci.m +++ b/hw/display/apple-gfx-pci.m @@ -147,7 +147,7 @@ static void apple_gfx_pci_class_init(ObjectClass *klass, const void *data) .instance_size = sizeof(AppleGFXPCIState), .class_init = apple_gfx_pci_class_init, .instance_init = apple_gfx_pci_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { }, }, diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index b007f089153..0faca41affe 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -497,7 +497,7 @@ pub trait ObjectImpl: ObjectType + ClassInitImpl { class_init: Some(rust_class_init::), class_base_init: Self::CLASS_BASE_INIT, class_data: core::ptr::null(), - interfaces: core::ptr::null_mut(), + interfaces: core::ptr::null(), }; // methods on ObjectClass diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/codeconverter/codeconverter/test_regexps.py index 08857c5008d..4526268ae80 100644 --- a/scripts/codeconverter/codeconverter/test_regexps.py +++ b/scripts/codeconverter/codeconverter/test_regexps.py @@ -77,8 +77,8 @@ def fullmatch(regexp, s): assert fullmatch(RE_ARRAY_ITEM, '{ TYPE_HOTPLUG_HANDLER },') assert fullmatch(RE_ARRAY_ITEM, '{ TYPE_ACPI_DEVICE_IF },') assert fullmatch(RE_ARRAY_ITEM, '{ }') - assert fullmatch(RE_ARRAY_CAST, '(InterfaceInfo[])') - assert fullmatch(RE_ARRAY, '''(InterfaceInfo[]) { + assert fullmatch(RE_ARRAY_CAST, '(const InterfaceInfo[])') + assert fullmatch(RE_ARRAY, '''(const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, { } @@ -98,7 +98,7 @@ def fullmatch(regexp, s): .parent = TYPE_DEVICE, .instance_size = sizeof(CRBState), .class_init = tpm_crb_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { } } @@ -134,7 +134,7 @@ def fullmatch(regexp, s): .instance_size = sizeof(AcpiGedState), .instance_init = acpi_ged_initfn, .class_init = acpi_ged_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, { } @@ -164,7 +164,7 @@ def fullmatch(regexp, s): .parent = TYPE_DEVICE, .instance_size = sizeof(CRBState), .class_init = tpm_crb_class_init, - .interfaces = (InterfaceInfo[]) { + .interfaces = (const InterfaceInfo[]) { { TYPE_TPM_IF }, { } } From patchwork Wed Feb 12 21:32:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 731B9C02198 for ; Wed, 12 Feb 2025 21:34:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKN5-000422-AN; Wed, 12 Feb 2025 16:34:15 -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 1tiKMp-0003b7-DF for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:00 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMn-0000Xl-QF for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:59 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4394036c0efso1234285e9.2 for ; Wed, 12 Feb 2025 13:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396036; x=1740000836; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vdFpkqfd4B+rA0TtuwX6WnKMXV9HddDmN8ccU2WMJQw=; b=zK0+oije8isd9oOLy0H+mFcsypRoG7+ddoKPRq5M+fI/0+KRBDRT/6pkm7pEGNnVQ6 SLe1HUSXcDIC+duJufYb7DTLBRQvjlqkt7JC1KPkvf/mkP09NbChaXbYG69NDmBclZ6i uPIIjH6xwGt6GMJ+5iX0icIS7aJ3JIG4QDbmaZ9xxI+OTvjF2QonDgqto8tnRG104sdQ RBGwnUL+O6Vlup1GiPl6Pa0izmhlQhFLG+GkDZr7RsTxykKWaY1+ybSBCSTyx/2stC1Q 06rUQzDO9vWtF+tUjQazq8BD8NHJy+EuIPOak56XHWMv5vHFiFX/nzag5g0ysvijn9YC Zy6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396036; x=1740000836; 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=vdFpkqfd4B+rA0TtuwX6WnKMXV9HddDmN8ccU2WMJQw=; b=V+L9CJYk7acXfIE2OeuqeMUhcJOkv4HAgIfroPboJhmRHOgigMDVzVdDYxD/37+RmX eJ7bi7Yj71toXE0TtGPbImTiPdcxNHBMnXHwEfyDlGt3YdEEB0T9uLAx7eaOjDdT3Vk9 JCJm8H7tyvzPCltq/HWbJufUCvbR5MjtBKGc2ciUiBWOl8hLktpHlZAJ0r8nZYLqDPGv grayDbxUyoJD/fdvDoE6FfM6uiHEGmnxJnJlt8QCI9gG7z+1TzrA5yzQDyLZYBc0V/mL G8bahtntHtczxjG1m2QnY+gqdqT4tUirE6jb0T3mS2jnBTRk9kUluZDm5b0E/ONo32NB 6S+g== X-Gm-Message-State: AOJu0YwgyMTcVFVoJFYUlVathzZVRRjwULXvrhQI4iidSMNla5UegQgz se3ZMRkD5m/VwHN5ondFJFEQHvJpACpnznUvrZ+wMxvlsc+l529yOplzTVJg4OvaDzAS+OPgJEp RV6Y= X-Gm-Gg: ASbGncsqVWye7UXqwmNKPt9ntkfDHr+cFHpL01Rj5T9r61HcRc6WsZowfOd1/AjTRqG JUokGJTHZPG701Svlmw19dxztz55Lrm8vUGKHCHhI8CA9G0NxQH5mKUbDUzX/msA37OX/oR95Ld VKuUl8DdbukZif4qOT/mzNWaZYBp9aOUDT2XbD7GQYx0UBH7Yb7UtknXPzCk0tdF96K5PSlwBoC K9KuayCUKXrmB5BSEyWxQTYex0spATeciLetMCh+Ql1o24Ut9xbyOw7uebBLfDy8PKEB3I7JodY Cr9swt0qOUIE01nGcX/sM4ZSMH5aFfoHRoYOrrmuPJo+HHsWz25CTJVYT8HWNHSSjQ== X-Google-Smtp-Source: AGHT+IF4xILXPfhsfqGiPijUunnlxzjPtHU5wrtcrk7nT/RaRP1WGuO5VyqUocNnledxgA+VmlEpqw== X-Received: by 2002:a05:600c:4fc9:b0:431:547e:81d0 with SMTP id 5b1f17b1804b1-4395816a6bfmr62224215e9.11.1739396035785; Wed, 12 Feb 2025 13:33:55 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a056151sm31283875e9.16.2025.02.12.13.33.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 12/19] hw/virtio/virtio-pci: Always allocate QOM type base_name Date: Wed, 12 Feb 2025 22:32:42 +0100 Message-ID: <20250212213249.45574-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Introduce 'single_generic_device' boolean for clarity. Allocate base_name on entry. Replace the g_free() call by g_autofree qualifier. Use g_strconcat() instead of g_strdup_printf(). Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index a72f878e949..15383570c91 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2469,7 +2469,12 @@ static void virtio_pci_non_transitional_instance_init(Object *obj) void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) { - char *base_name = NULL; + /* No base type -> register a single generic device type */ + bool single_generic_device = !t->base_name; + /* use intermediate %s-base-type to add generic device props */ + g_autofree char *base_name = single_generic_device + ? g_strconcat(t->generic_name, "-base-type", NULL) + : NULL; TypeInfo base_type_info = { .name = t->base_name, .parent = t->parent ? t->parent : TYPE_VIRTIO_PCI, @@ -2492,9 +2497,6 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) }; if (!base_type_info.name) { - /* No base type -> register a single generic device type */ - /* use intermediate %s-base-type to add generic device props */ - base_name = g_strdup_printf("%s-base-type", t->generic_name); base_type_info.name = base_name; base_type_info.class_init = virtio_pci_generic_class_init; @@ -2544,7 +2546,6 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) }; type_register_static(&transitional_type_info); } - g_free(base_name); } unsigned virtio_pci_optimal_num_queues(unsigned fixed_queues) From patchwork Wed Feb 12 21:32:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B63D1C021A5 for ; Wed, 12 Feb 2025 21:35:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKN2-0003u6-LU; Wed, 12 Feb 2025 16:34:12 -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 1tiKMu-0003kf-1E for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:06 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMs-0000YC-E1 for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:03 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38f22fe8762so71242f8f.2 for ; Wed, 12 Feb 2025 13:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396040; x=1740000840; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sGz7ndjNtFhvcqsdb3cBe+6raTEmZAEhsP/1+wNKBtU=; b=zM4mqLMk2RzXVtrvZXcEi4UDQF5PXyH+YTJzFcIS0cErE66Y5Gz9pdKnBwHyqoM7KB +P9JajUirNFKTDmG071Aw/s4NCHeNaMhRAUC3YNbMSo8Mc6qg/ASMfPRkIlEzgVFFjGH 8UTlAKBAUHZhjQ6iA9jf1SvYTt16xAhvyFU2GTffkYcIHF6a/2vfyP2aZQjq9Iem5C6C d0woltJT8f+FEWZjlpF6S6yEz1TxxoFd2yOMbCTVcQx2OwOvVSV1j6scp8it9wtn5FWR JWNUjIiyEzK+nsFg3gQhtSNMpaLFARvbKYNYC+BKNkPEZlzU31Sy1KtSesmGt1qsp7oB b07w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396040; x=1740000840; 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=sGz7ndjNtFhvcqsdb3cBe+6raTEmZAEhsP/1+wNKBtU=; b=UOZo2AeWjWsC+X727+4M5ZgYX1nQZsY/2DRv9k88s0q/QOjmhpobQ9Wpkr0oO80lB8 yZYAdPjNpjcxW5hLvrjfti06YPcsN2NG8K+ecwmq4o5Rit+g1u1bantOHzb03wTpmSSf 4Gmt/zG5kEZT0ceUscLrtAP3UnILwNO6lJA0w63iG0gtgQZVyJgk3W/TuqkrTPYBNLbm W5m0KZin1Kxblb6UnLUggytXlMwgXQAyWB8I0YLVLdd9rZXVGfDp1Ep3uPkfyxG+jMl6 0kKXTvybXNP5VHHbprmUNb1YNPTkkUbJ8hjie0Twzgc4Ru4SsExznXtlO686U4kp28Gv nnCw== X-Gm-Message-State: AOJu0Yywp06oVtu1LhIeyRLNi49DHo5KUs0cUl8+b5hF5p8CX+mHkETf gG3AferWEDY6aZbKilWO7znjDFmiN6fquqp/T95vJ4KlcFuybKmCcLsrL4NEq1qDNdmYRm2CQlt EEBA= X-Gm-Gg: ASbGncuFNJrYZaf3aWEnOPBR1UItPX9Oot8XDePCZC62H5ZRHCCEJOBLNVHgUdGfVXy ehaqAeEMmgqWGbMLpCZrMH2TZ+i8lBIrbPebEDS6KhcJv8sHPhu6IZ6HGC2EAn4het9qGXd8c6u hXbSPOeoWdt9bUuCa+4uDhqtAKNlmKauxsWlAltUQFn6UMrrQr1XLeXeg3bWSgz38umfiOkZdOZ XFaI7nlkImmc5+JZ9SGIWYk+jtCwpDWUNWt8jNEILUUqoNOLPHns0x/uFPFPJmtGJUWnhyRzoAY k9jHhupSi8LOp5WlRNtDI5WIg6IMs5aX+bBflBlKT0vpiizr+xd5/f7uhM9JklFirA== X-Google-Smtp-Source: AGHT+IGrlqe4ceJGm+2bzwi8vlAOGqHM3iBT8ZOCyRqRvxWveUUtITBxDWg+lqD/zpa/hKW2PMZ6gw== X-Received: by 2002:a5d:598d:0:b0:38d:cf33:31d6 with SMTP id ffacd0b85a97d-38dea3c30d5mr4651328f8f.3.1739396040467; Wed, 12 Feb 2025 13:34:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259d5ee2sm23054f8f.80.2025.02.12.13.33.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 13/19] hw/virtio/virtio-pci: Assert before registering QOM types Date: Wed, 12 Feb 2025 22:32:43 +0100 Message-ID: <20250212213249.45574-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 15383570c91..ad1d164421d 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2496,6 +2496,9 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) }, }; + assert(t->base_name || !t->non_transitional_name); + assert(t->base_name || !t->transitional_name); + if (!base_type_info.name) { base_type_info.name = base_name; base_type_info.class_init = virtio_pci_generic_class_init; @@ -2503,9 +2506,6 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) generic_type_info.parent = base_name; generic_type_info.class_init = virtio_pci_base_class_init; generic_type_info.class_data = t; - - assert(!t->non_transitional_name); - assert(!t->transitional_name); } else { base_type_info.class_init = virtio_pci_base_class_init; base_type_info.class_data = t; From patchwork Wed Feb 12 21:32:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21F42C02198 for ; Wed, 12 Feb 2025 21:37:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKN7-0004C3-3O; Wed, 12 Feb 2025 16:34:17 -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 1tiKMz-0003rH-NB for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:11 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKMx-0000YS-Qx for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:09 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43956e3863eso1887285e9.2 for ; Wed, 12 Feb 2025 13:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396045; x=1740000845; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xO6SV4w4GEb/p1wdkem/NKWYVecHNr9NrkbEfMoLTPg=; b=WUn6rzUwepyyYHBsIIqaamu7YHpdS3EiGlZIt6HXU/WoqcjNBO9TQnipxF6V3DMN4e 1i/FFSvDhyxUF+bbSz1Vz6bOZrbx3tIaLm1DIy54z9ob+s2zwMptODPGKYKJmmtyiT7/ AoNUfkLDEYCzhUW9EU6tHW8bO4bYPz/oZ84m0hwhS6oCo662hj/raD4QpRn2P59VpR12 EC0KpnFQJy492cN9dWiT07o72HdSac6k14e1d+IiYiin/v2xz9mjXEctYMK9jITxj53L praqgdZODpyktK/d1wq/d0gDgc7eufsxBYftPjVsalZ54Clfavs9UDJU5bKvCPamw9jM aDyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396045; x=1740000845; 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=xO6SV4w4GEb/p1wdkem/NKWYVecHNr9NrkbEfMoLTPg=; b=Rb2aLN1hmdgY2aCtwL85Cw5J78nizCwqGkVsLrz2D3GpSd1+2PzrzzTci4xNwLcQEo d3tXWyx2mNqeWleG1XC2euqVGzI2nMxsnt6eUDt9D/Hd6uA0QbEGeKpmSGmHrwM4N8iX EcYdWRDY59NpNMb0I5D0C9jcvI0/9Hkrvue9C4cEi6dnGiAROgvfQbhQFoD6ap5aoxgY KOXchPMSCFkIvY2ji8uVoeBFgJdGiHmsuh9wQBy18mt84SIuoMipq9Co29isWE72S1tB AFWjMr+GP2qWIVguLDAv+S80D+TxhN4YzfFxmgeHuGUCk+Xv9b1p58BNt/202Fh8BbgW P6Qw== X-Gm-Message-State: AOJu0YwFp9XztGOQV5m/0Fv6vCFuO4ZHo2REV9BrfX6zXf25HApllTf7 1JYa4/Hvk5rkuRDDnLdXwwtfLQCEfldS955ORGHroMyRVDmV159AKk+xGJ7U+oultzinRLLzCkb mYgY= X-Gm-Gg: ASbGncuupjvBgkDMw7nz0fI7+foT244QoA0EGz37vN0XH5w/I1N1v+tBZ8ZF5QZvvJG EQsIgSqcWXTXilm/d1ivg8dYb66AqDBfbgF4kDNi1Ld935wknjcMU1efRzYxCTXpg9Ek+izMFFI IFypH9fuQvNrRcnxTOhNjA5sdTWKvaBYU1yS5M4xmjnfSDqKzMSbmt3AxRYqaBOTJ4QSrK5HzpQ GHyJgM5c74QsIvoEdZS5o/18dteaT+objdeqBpHBWIzRxwzQiIWTKTCzv48rxe106u8WTpL74OF 1PaZqmcJW2kdiAJweNjiAWVC/MnU8jM9pf/jZhf7aIOD145OaXtVKjX9+yZw+yA9NA== X-Google-Smtp-Source: AGHT+IEgr1TDCBQZessHN5VdXt2BpdOh4fzJnnNahs9Vc+A2p86E15JT+bbNmqp1MrXvOHL51IRcGQ== X-Received: by 2002:a05:600c:3b9a:b0:439:33dd:48ea with SMTP id 5b1f17b1804b1-4395815f6f3mr46065155e9.2.1739396045229; Wed, 12 Feb 2025 13:34:05 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a058930sm31109815e9.17.2025.02.12.13.34.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 14/19] hw/virtio/virtio-pci: Do not access base_type_info.name directly Date: Wed, 12 Feb 2025 22:32:44 +0100 Message-ID: <20250212213249.45574-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org base_type_info.name is initialized to t->base_name, check that directly. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index ad1d164421d..9512590c936 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2476,7 +2476,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) ? g_strconcat(t->generic_name, "-base-type", NULL) : NULL; TypeInfo base_type_info = { - .name = t->base_name, + .name = t->base_name ?: base_name, .parent = t->parent ? t->parent : TYPE_VIRTIO_PCI, .instance_size = t->instance_size, .instance_init = t->instance_init, @@ -2487,7 +2487,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) }; TypeInfo generic_type_info = { .name = t->generic_name, - .parent = base_type_info.name, + .parent = t->base_name, .class_init = virtio_pci_generic_class_init, .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, @@ -2499,8 +2499,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) assert(t->base_name || !t->non_transitional_name); assert(t->base_name || !t->transitional_name); - if (!base_type_info.name) { - base_type_info.name = base_name; + if (!t->base_name) { base_type_info.class_init = virtio_pci_generic_class_init; generic_type_info.parent = base_name; @@ -2519,7 +2518,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) if (t->non_transitional_name) { const TypeInfo non_transitional_type_info = { .name = t->non_transitional_name, - .parent = base_type_info.name, + .parent = t->base_name ?: base_name, .instance_init = virtio_pci_non_transitional_instance_init, .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, @@ -2533,7 +2532,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) if (t->transitional_name) { const TypeInfo transitional_type_info = { .name = t->transitional_name, - .parent = base_type_info.name, + .parent = t->base_name ?: base_name, .instance_init = virtio_pci_transitional_instance_init, .interfaces = (const InterfaceInfo[]) { /* From patchwork Wed Feb 12 21:32:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC4E5C02198 for ; Wed, 12 Feb 2025 21:35:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNA-0004ZJ-9d; Wed, 12 Feb 2025 16:34:20 -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 1tiKN4-000408-2l for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:14 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKN1-0000Yj-U8 for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:13 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so74831f8f.2 for ; Wed, 12 Feb 2025 13:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396050; x=1740000850; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HwHmoUxqvyoHDNzHHszg1KhqHnkiNXqZBs1FtjR02c8=; b=aTSccO4POZTmRx+LI2CmRyReR0hXojkvJPaIGETRxZARI9Mc2OaxfGpnfSxqLVwzyZ 4fGPce24IAcM7w2Mfe03BVRzwsdnbZU68aZMT29xM21cxerFBhYd3whubC5qdkA22E08 cDCjVCJU5aNJE6CGdkdSah1rHga4GhR5eM9LjQAX9JgdBlOeZDunbCaIk843FvcNFx3u hKSnW0DgF0PZGzXro1RgV7WrHmOHyzUg7C50HlgvpjE+5rXD7bZ1ZLPTUeCS/7P6L4Hm b0INrLqEEtdc3fmOcuqDkulTzmpMWzxAbW02dcPR4Gj2hqDU8q6HkDegEvAwzZiUw24s FldA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396050; x=1740000850; 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=HwHmoUxqvyoHDNzHHszg1KhqHnkiNXqZBs1FtjR02c8=; b=UzbiiQKmflJPCxC5zHvQNqdWYBA0ZHWo6l6e/yoweGusHBJ6KyBu16g1on7ULGJxEX /MhsNqMhfuK/G28SGjiP2p4KVGlJWt8uKNZSzMvPGefBKgSQu+QoiQ5NQjiWX9nefl09 x3V6FTLh0u3D4nU1ILFhMGJ11rpzbqeusm4LFCztHUfzEn3SkmJEQC6DsqwL2gXqoaji 2Wvlj9sDb13zPPGwzGBDoqK80cS7fVLUOWfbkgcYdj73/aNn/GmxM4AGlvg3f+f7KXkS LZksvegyflK4HWPcho7Dhow8o69nP1LYgO7eo5QRjnzqw8NJqe2LMJ3dvUPpc7P5ATSZ bZIQ== X-Gm-Message-State: AOJu0YwPH9y05T/kRsya5NK/GSiIAMCjbPrVqe44nDpWEqpqerv/nZJV PSiE4uWXPnlc2E5CARRye5xZqQ65MfSX2s1w56tvp+7zf4crFFcemu3QiUlwZoo6n9+fqgEK8eo NEKQ= X-Gm-Gg: ASbGncutLw+jzuOEfOWynrrEQVxCEThmL2uJKSI+ijwj5UwwFcuiyTgNha41NRwfTJl M1oEzNULxofTRPNsLnCsi2HIyqBHFSIU6moyVxZX+vbCagaDg5uYsVHiI468HWnPc3KetS2WyIu mqm4F0fJEdatgv1PovKoSgyVy1qyZBre4IttQRyR86TNPA51/sv70mZfXd0HSmdOvtm9/Zw30XH TfbJITWTMlhVcL1B7qLxJIYZVR0zIyOMk9JPvCsOUJamYB3wsbuLk+PZmLECC55JMEm1nd44YS6 s3bgJ42A/z6KB1doJGqTXgTt4Mspg2eJrZ2TB4JyaTI5ppoBpH5/4GFJy1FPaGwdVQ== X-Google-Smtp-Source: AGHT+IGb7051VZGFw+gqy7rP2wyXbr7J1lpTvq69q8D4w15LiPmGS+Dn+qFtFw4ZncxuDKm51L/QMQ== X-Received: by 2002:adf:e60e:0:b0:38b:f4dc:4483 with SMTP id ffacd0b85a97d-38dea28c1e0mr3422437f8f.29.1739396049853; Wed, 12 Feb 2025 13:34:09 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258b4491sm49523f8f.7.2025.02.12.13.34.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 15/19] hw/virtio/virtio-pci: Constify base_type_info Date: Wed, 12 Feb 2025 22:32:45 +0100 Message-ID: <20250212213249.45574-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 9512590c936..a33d1b2cbcf 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2475,13 +2475,16 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) g_autofree char *base_name = single_generic_device ? g_strconcat(t->generic_name, "-base-type", NULL) : NULL; - TypeInfo base_type_info = { + const TypeInfo base_type_info = { .name = t->base_name ?: base_name, .parent = t->parent ? t->parent : TYPE_VIRTIO_PCI, .instance_size = t->instance_size, .instance_init = t->instance_init, .instance_finalize = t->instance_finalize, .class_size = t->class_size, + .class_init = t->base_name ? virtio_pci_base_class_init + : virtio_pci_generic_class_init, + .class_data = t->base_name ? t : NULL, .abstract = true, .interfaces = t->interfaces, }; @@ -2499,18 +2502,14 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) assert(t->base_name || !t->non_transitional_name); assert(t->base_name || !t->transitional_name); - if (!t->base_name) { - base_type_info.class_init = virtio_pci_generic_class_init; + type_register_static(&base_type_info); + if (!t->base_name) { generic_type_info.parent = base_name; generic_type_info.class_init = virtio_pci_base_class_init; generic_type_info.class_data = t; - } else { - base_type_info.class_init = virtio_pci_base_class_init; - base_type_info.class_data = t; } - type_register_static(&base_type_info); if (generic_type_info.name) { type_register_static(&generic_type_info); } From patchwork Wed Feb 12 21:32:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA49AC021A4 for ; Wed, 12 Feb 2025 21:34:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNC-0004n6-T8; Wed, 12 Feb 2025 16:34:24 -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 1tiKN8-0004R0-O5 for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:18 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKN6-0000Yy-Sz for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:18 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38dd93a4e8eso120095f8f.1 for ; Wed, 12 Feb 2025 13:34:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396055; x=1740000855; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XUmnlPPLPQjrTTXNDitdBPrUpGSeikKZ8+CtY1G8/RY=; b=zMpDGn59dPp+WkeBmH/xCxoGiQ4Y27K+l23PCjOaZg+09rmenRl/v3zLp6ecsO2xYc 4yP4DxC5ylnEWURUvqNONJFd9drBbMetm+ynEkorP9BzVSQrHumWtlawRM845O5RtYm+ DD+VViTq/5H2olmcYgjhhCd4aG0qHmZ9OPynuJ+lmkieGeR9/0bNKnaXnSkNBSQFV5ZD RKuEAMLAVK2ftyk9XhlN7AWsV4sZoF5dUBBWZpdiBXeXPl+c01PaENqCF95VD5I4sq0Q k2aYAOqndRhF4kxoSZl+cSVFxMmCTeqTRTFbHyESc6Y9UWmVl/0NhP0Y1pC15Yo9Gyxx eNOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396055; x=1740000855; 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=XUmnlPPLPQjrTTXNDitdBPrUpGSeikKZ8+CtY1G8/RY=; b=Dtm6XYufFX87jecTzN+XgjIngyjdPsGb5AmYB08JgDPL/8SOr36EkOFvFFOrjHjhP7 hMV0/u9lVVmf0NiggG+eSF30ysiw1o6pKQwlAm9DWMKmhbo/GGm38LAqlUi6Ph5mAYLH ULABevQxpJjvJHwtDLFK7VjxuwVwpnXoeXsLsfbyAuuterkKJWuzInOwDih72jprFeHn rUeKXIZZqmaARhL7uguvb4YxXTXJvNphD37WVJVW9AQ/Pw+j1O8KzGvLEQ59mcV0ryAB Sdezo1EBVQ1Cr/wp/weXtL1CyKb7ddpuXPClo8mdqIe76/MydYue+pdXlSncQhcdPeE2 HpfQ== X-Gm-Message-State: AOJu0YxYLA03cZr71L8HVGa3Ek+XRmzXWXUJdIJ1w852cLFF/QDLjyLC zCxSwuEcy4UH/p+Jz58QVmMYIWQ5RfVRf7w0Os1xciVVg6ixlzzSLITggdp5R0KKdlPFHVNkR7w +j90= X-Gm-Gg: ASbGncvp8t2TvjsUc9YeqOboFNuT2edrC6DtDsj7GL9Z+WEujh1A1jYcdwjzeRgGiIc zP9OTp+hMTM2mLJ1MuBUqqeKH+3q5CsnerSoklEqAdawFwRocMVTIxPJfLt5rzDF+ctHu2+8LN0 d2QFVqo1yyhQrhgEF3RHTBEoNWhGr+eBSlVXxxck3+czBOwEGgur809Zgx46shCyi6+ckKoPB8w 9HP+1Q842oPsvbSGsWpSi+XtfDp+D70Gau/qG2N6jT0drE6dkxT2g/uDPoqSQPeb0RHwi4EGVhO twNdtYbpoEwPcwlbmzLNLjDA5KyU1dNzIZGlkJj2yzZJDmMtarSNwaIUAAUWe9NjLw== X-Google-Smtp-Source: AGHT+IE1eVloI516Vo1RTBENLFd+naT4Rg4ZF0SLKA1fu9aX2v46qN48qGbY4Qycye0914rN9CkERA== X-Received: by 2002:a05:6000:18a6:b0:38d:d299:7097 with SMTP id ffacd0b85a97d-38f244da177mr899339f8f.5.1739396055077; Wed, 12 Feb 2025 13:34:15 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259f8115sm14785f8f.92.2025.02.12.13.34.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 16/19] hw/virtio/virtio-pci: Constify generic_type_info Date: Wed, 12 Feb 2025 22:32:46 +0100 Message-ID: <20250212213249.45574-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index a33d1b2cbcf..6f0e1772669 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2488,10 +2488,12 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .abstract = true, .interfaces = t->interfaces, }; - TypeInfo generic_type_info = { + const TypeInfo generic_type_info = { .name = t->generic_name, - .parent = t->base_name, - .class_init = virtio_pci_generic_class_init, + .parent = t->base_name ?: base_name, + .class_init = t->base_name ? virtio_pci_generic_class_init + : virtio_pci_base_class_init, + .class_data = t->base_name ? NULL : t, .interfaces = (const InterfaceInfo[]) { { INTERFACE_PCIE_DEVICE }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, @@ -2504,13 +2506,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) type_register_static(&base_type_info); - if (!t->base_name) { - generic_type_info.parent = base_name; - generic_type_info.class_init = virtio_pci_base_class_init; - generic_type_info.class_data = t; - } - - if (generic_type_info.name) { + if (t->generic_name) { type_register_static(&generic_type_info); } From patchwork Wed Feb 12 21:32:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABE3EC02198 for ; Wed, 12 Feb 2025 21:35:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNG-00058E-So; Wed, 12 Feb 2025 16:34:27 -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 1tiKND-0004se-Pv for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:24 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKNC-0000Zi-9O for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso2195365e9.1 for ; Wed, 12 Feb 2025 13:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396060; x=1740000860; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=YfIj8rwM399z1uK855bV+qJDRi+1SpaVlSr16qLYDrewAdegp0GidellzbfSF6Qa2Z Dz7WFTeKYgDMaQQtCr5lJUMrs5JX8gwAy1xh04/uLtDhAIy401UszLjjgQDFiJU+xwdQ b7BImy/kqG0+Y6wHq+Yz1JqGAV7VD1cH9MX8pzr+uLySYUcnnZ9xgL1e1YacNj+eryKz ikjVoKbVMDNnhauwPj0GiLktdeQDcMl1d4VHzRDroEW76kb2ECtHt0XqVFrWTU/LC6Be x23F31qjMfe4+YTFpucA1cvwc7CZuk3BUw63HTn3rMxQZDuz9D3Xo0HR3qQ+uCAGmjya MCcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396060; x=1740000860; 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=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=ayb8s8yJHuSZnONb0YMwG2SWoeStsq1RNqBEy2SUn+BypO5usO3g3+e1Oh48o1O4SB cKNCQwdN3VX4uOc20JJq/g0EvyeVyyfEFEqyYc27mpLIk5O7w9pZ5TCJ/ttxFLowUU7Q rzFFCcttx3tlPdDQT3l3V05znBi6KxlibCF6GwyoXOtu9gb4AxUB3u196mNoHGqlf0/+ dM2lG21pLCecNrSvyeBfmnWxq6rwvrTUq2TBxa7uMnWyXNWm6RPdiQ9Fe8Pv6OTmCvBf GnXvXELakP5XFM0hn5sdAdHZkcRiJ/ZXc5UgVmkfwPgkL5epmLi1V9pYnYXPssC8fov8 ElGQ== X-Gm-Message-State: AOJu0YwLrKhzCxWuf40lVfZ8kpuxD4y5kCdXJU9umoXz6YG1X3T2WcA6 ePAJogTwpDVzulNc9GPbLOCjacg0bzBe2gRI/TPk0rqQDq7w8H4FQCECBAfNNhqNW7LuOtn2a13 NlMg= X-Gm-Gg: ASbGncuwKyjo7y5B3iBnIwUSSmXv7W30YaKctUsQBaAsBRKeP3996poUfhFlqIYFb2U Sj9bn+h5op9Ot7hHx6goQMIqXIlmHWiK4jBN8CNErPw/Qvt9U7BS90QYhtnvuBllagvKVvaxw3k 3iHKaL+lTWYinw7o2cQCurVbYvSs+d56aJd55dH4BriHzMVC63WqweFNVa2L3XRE5Q1V44Uq2cl l+aARCLmXBbuqhdrrTppWIEKasig92HA2xLGd4yh7txPUX4BPJV1vrq131d24xSZwiZlu628ELd JDk/XoJzh7uAZiI6xDswJ1CMv+1+GQVxfJGsr4EibDezZTAFPTbeB/qjhnRh1zem8Q== X-Google-Smtp-Source: AGHT+IGotS/3O+wmWktJ3ePo6qnkPb9/U65PSkIDob5JtKNMlNKiqGE7pwYsoUqmKRm9Zuyd9Z+05Q== X-Received: by 2002:a05:600c:1e0f:b0:434:f586:7520 with SMTP id 5b1f17b1804b1-43960185f0amr11972505e9.6.1739396060389; Wed, 12 Feb 2025 13:34:20 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259d5e9esm20117f8f.61.2025.02.12.13.34.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 17/19] hw/virtio/virtio-pci: Reduce generic_type_info scope Date: Wed, 12 Feb 2025 22:32:47 +0100 Message-ID: <20250212213249.45574-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-pci.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 6f0e1772669..99724deb3d9 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2488,18 +2488,6 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .abstract = true, .interfaces = t->interfaces, }; - const TypeInfo generic_type_info = { - .name = t->generic_name, - .parent = t->base_name ?: base_name, - .class_init = t->base_name ? virtio_pci_generic_class_init - : virtio_pci_base_class_init, - .class_data = t->base_name ? NULL : t, - .interfaces = (const InterfaceInfo[]) { - { INTERFACE_PCIE_DEVICE }, - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { } - }, - }; assert(t->base_name || !t->non_transitional_name); assert(t->base_name || !t->transitional_name); @@ -2507,6 +2495,19 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) type_register_static(&base_type_info); if (t->generic_name) { + const TypeInfo generic_type_info = { + .name = t->generic_name, + .parent = t->base_name ?: base_name, + .class_init = t->base_name ? virtio_pci_generic_class_init + : virtio_pci_base_class_init, + .class_data = t->base_name ? NULL : t, + .interfaces = (const InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { } + }, + }; + type_register_static(&generic_type_info); } From patchwork Wed Feb 12 21:32:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08B6EC02198 for ; Wed, 12 Feb 2025 21:35:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNM-0005Sg-9n; Wed, 12 Feb 2025 16:34:32 -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 1tiKNI-0005Gx-Sj for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:28 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKNG-0000aS-Nf for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:28 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38dc6d55ebaso898172f8f.1 for ; Wed, 12 Feb 2025 13:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396065; x=1740000865; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gWUMYVWKZSu2OSfc0MXilpdxQiaoa1PiI/aXL88osMc=; b=uWkkOoE+a06xCCFBx+DO8hToI3NbwyEkMzuvm8qWqz12Hxkz5nIXKoMeiL/ylpIUL5 L5r/G4MMUV8aK5M1wzvbUd6cq/fpYKMd5yKgN9ZeHpDTSNshBgvIeDzmkANAHHw/XHKp +M8cmkztv59bpv1H40x3C0XUkgt3IshW9t6YxZwBWDaIQ56Ufjz8Lur+2RMMRG5cii/S oPi++1/GJFNX5v8pSfuiD2OzL9H9RLzaDPPSXyzCBZ2zcxxT6mcnv1cU1M21j/VyzO5z M+0D+lnV2XNzYaYkfm3LeCRh+7poXJAFMQq/8GH+ndqZxlAIg3zgSfxJBhEWEw+wt2/M XrLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396065; x=1740000865; 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=gWUMYVWKZSu2OSfc0MXilpdxQiaoa1PiI/aXL88osMc=; b=lwRINCF3SYnMT7C1nfl+oxhbX31SnufnfXLtTZ5fgn+d3SokciutXpcpaPq8ogqvis ED6UvGuy2a9Dgg0ikuPrnEyrZ76pqJWH5UfU6MHT4mydEfcOZKGTl0zDas/poje7O7uM MWAZmtU1KlCZxVBh4Hnlm/XfjYym5Yb6Yp7ubpqeNzgb/dB6cyYbROk6lSB0mfUQzFHm KYBtAbG+jOTDmy5uDfxcvfe5AAF+1ZOz2sCM4stf8p5NVFgcn52v4yzAA4IaF2+8Unqw UXqKnTyscw0dJpLYTe21CB4FK1GbD14g7pcMpGmXwJbHN45b47jCqhZhTKGVFl6Z2DWN e4Mg== X-Gm-Message-State: AOJu0YymQ7dVk7GlKeaN+wyNbfiiGB9TTjkKLsZanKjj7+eBFo95wX8n BS4z8+kKRJZEg4jcrGvi6AWyZxXPZ3fb8VY/p1KV3/TzVlQptyRPsYzvC9RG3KPH4UwmVgcO6E8 mD+M= X-Gm-Gg: ASbGncukOLHEtrgtsY/v26p+fbDsybdaWR7txB7mpgu7ANg6O9RDUE1Z5kJDc2VFCqE 6G92migahl4fuN1INVTgMxxkgXtRwamsIVRYLr3SYCHZmzudJibiSo1cyqxTwlm51ofBQ1OxjUP +gOOck40D4qTSZnKj7raYR9WVhMcTV4SlXkM0w7jz7CBs6x6zXEeql7D9AFr7g5vCRB10d0SnIr GgK/Rynm/S28mKBcrBpsKXyIZk/eopfLfwM9RrPVPA0gj0tGuPzy3QgvLsJtF13lgB6cOZcg1v0 IHbkMm5O/05iZpPxJM6lRTHdqzrfoRMuKMX1DFgJiheA18uqD2HM8l183dTnFoN8nw== X-Google-Smtp-Source: AGHT+IER81hBzlIvzMsEvHZz2n7YPOmC7B3RIPMUkIO4YO6lK/ZfxkOOdSvTecLfPq0Fh8tKtyDozw== X-Received: by 2002:a05:6000:144b:b0:38d:b028:d906 with SMTP id ffacd0b85a97d-38f24f90c32mr287319f8f.21.1739396064911; Wed, 12 Feb 2025 13:34:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259fe1efsm20089f8f.97.2025.02.12.13.34.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 18/19] hw: Constify various TypeInfo and associated structures Date: Wed, 12 Feb 2025 22:32:48 +0100 Message-ID: <20250212213249.45574-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Constify various TypeInfo structures. When they are generated from an array, also constify the array. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 12 ++++++------ hw/rtc/m48t59-isa.c | 22 +++++++++++----------- hw/rtc/m48t59.c | 22 +++++++++++----------- hw/scsi/megasas.c | 16 ++++++++-------- hw/usb/hcd-ehci-pci.c | 20 ++++++++++---------- hw/usb/hcd-uhci.c | 20 ++++++++++---------- hw/usb/vt82c686-uhci-pci.c | 6 +++--- 7 files changed, 59 insertions(+), 59 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index cba4999e6d0..4436c2ce0cc 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1766,12 +1766,12 @@ static void e1000_register_types(void) type_register_static(&e1000_base_info); for (i = 0; i < ARRAY_SIZE(e1000_devices); i++) { const E1000Info *info = &e1000_devices[i]; - TypeInfo type_info = {}; - - type_info.name = info->name; - type_info.parent = TYPE_E1000_BASE; - type_info.class_data = info; - type_info.class_init = e1000_class_init; + const TypeInfo type_info = { + .name = info->name, + .parent = TYPE_E1000_BASE, + .class_data = info, + .class_init = e1000_class_init, + }; type_register_static(&type_info); } diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index 9e2f6563a0a..152208d931e 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -51,7 +51,7 @@ struct M48txxISADeviceClass { M48txxInfo info; }; -static M48txxInfo m48txx_isa_info[] = { +static const M48txxInfo m48txx_isa_info[] = { { .bus_name = "isa-m48t59", .model = 59, @@ -148,18 +148,18 @@ static const TypeInfo m48txx_isa_type_info = { static void m48t59_isa_register_types(void) { - TypeInfo isa_type_info = { - .parent = TYPE_M48TXX_ISA, - .class_size = sizeof(M48txxISADeviceClass), - .class_init = m48txx_isa_concrete_class_init, - }; - int i; - type_register_static(&m48txx_isa_type_info); - for (i = 0; i < ARRAY_SIZE(m48txx_isa_info); i++) { - isa_type_info.name = m48txx_isa_info[i].bus_name; - isa_type_info.class_data = &m48txx_isa_info[i]; + for (unsigned i = 0; i < ARRAY_SIZE(m48txx_isa_info); i++) { + const M48txxInfo *info = &m48txx_isa_info[i]; + const TypeInfo isa_type_info = { + .name = info->bus_name, + .parent = TYPE_M48TXX_ISA, + .class_size = sizeof(M48txxISADeviceClass), + .class_init = m48txx_isa_concrete_class_init, + .class_data = info, + }; + type_register_static(&isa_type_info); } } diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index 68be2dad6f3..967331401a7 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -66,7 +66,7 @@ struct M48txxSysBusDeviceClass { M48txxInfo info; }; -static M48txxInfo m48txx_sysbus_info[] = { +static const M48txxInfo m48txx_sysbus_info[] = { { .bus_name = "sysbus-m48t02", .model = 2, @@ -666,19 +666,19 @@ static const TypeInfo m48txx_sysbus_type_info = { static void m48t59_register_types(void) { - TypeInfo sysbus_type_info = { - .parent = TYPE_M48TXX_SYS_BUS, - .class_size = sizeof(M48txxSysBusDeviceClass), - .class_init = m48txx_sysbus_concrete_class_init, - }; - int i; - type_register_static(&nvram_info); type_register_static(&m48txx_sysbus_type_info); - for (i = 0; i < ARRAY_SIZE(m48txx_sysbus_info); i++) { - sysbus_type_info.name = m48txx_sysbus_info[i].bus_name; - sysbus_type_info.class_data = &m48txx_sysbus_info[i]; + for (unsigned i = 0; i < ARRAY_SIZE(m48txx_sysbus_info); i++) { + const M48txxInfo *info = &m48txx_sysbus_info[i]; + const TypeInfo sysbus_type_info = { + .name = info->bus_name, + .parent = TYPE_M48TXX_SYS_BUS, + .class_size = sizeof(M48txxSysBusDeviceClass), + .class_init = m48txx_sysbus_concrete_class_init, + .class_data = info, + }; + type_register_static(&sysbus_type_info); } } diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 03cd837b44f..ccd87fb0604 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2490,7 +2490,7 @@ typedef struct MegasasInfo { const InterfaceInfo *interfaces; } MegasasInfo; -static struct MegasasInfo megasas_devices[] = { +static const struct MegasasInfo megasas_devices[] = { { .name = TYPE_MEGASAS_GEN1, .desc = "LSI MegaRAID SAS 1078", @@ -2569,13 +2569,13 @@ static void megasas_register_types(void) type_register_static(&megasas_info); for (i = 0; i < ARRAY_SIZE(megasas_devices); i++) { const MegasasInfo *info = &megasas_devices[i]; - TypeInfo type_info = {}; - - type_info.name = info->name; - type_info.parent = TYPE_MEGASAS_BASE; - type_info.class_data = info; - type_info.class_init = megasas_class_init; - type_info.interfaces = info->interfaces; + const TypeInfo type_info = { + .name = info->name, + .parent = TYPE_MEGASAS_BASE, + .class_data = info, + .class_init = megasas_class_init, + .interfaces = info->interfaces, + }; type_register_static(&type_info); } diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 38ad3406b32..5a96c15c67c 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -193,7 +193,7 @@ static void ehci_data_class_init(ObjectClass *klass, const void *data) } } -static struct EHCIPCIInfo ehci_pci_info[] = { +static const struct EHCIPCIInfo ehci_pci_info[] = { { .name = "usb-ehci", .vendor_id = PCI_VENDOR_ID_INTEL, @@ -216,17 +216,17 @@ static struct EHCIPCIInfo ehci_pci_info[] = { static void ehci_pci_register_types(void) { - TypeInfo ehci_type_info = { - .parent = TYPE_PCI_EHCI, - .class_init = ehci_data_class_init, - }; - int i; - type_register_static(&ehci_pci_type_info); - for (i = 0; i < ARRAY_SIZE(ehci_pci_info); i++) { - ehci_type_info.name = ehci_pci_info[i].name; - ehci_type_info.class_data = ehci_pci_info + i; + for (unsigned i = 0; i < ARRAY_SIZE(ehci_pci_info); i++) { + const EHCIPCIInfo *info = &ehci_pci_info[i]; + const TypeInfo ehci_type_info = { + .name = info->name, + .parent = TYPE_PCI_EHCI, + .class_data = info, + .class_init = ehci_data_class_init, + }; + type_register_static(&ehci_type_info); } } diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 4822c704f69..9c671f53684 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1309,7 +1309,7 @@ void uhci_data_class_init(ObjectClass *klass, const void *data) u->info = *info; } -static UHCIInfo uhci_info[] = { +static const UHCIInfo uhci_info[] = { { .name = TYPE_PIIX3_USB_UHCI, .vendor_id = PCI_VENDOR_ID_INTEL, @@ -1371,17 +1371,17 @@ static UHCIInfo uhci_info[] = { static void uhci_register_types(void) { - TypeInfo uhci_type_info = { - .parent = TYPE_UHCI, - .class_init = uhci_data_class_init, - }; - int i; - type_register_static(&uhci_pci_type_info); - for (i = 0; i < ARRAY_SIZE(uhci_info); i++) { - uhci_type_info.name = uhci_info[i].name; - uhci_type_info.class_data = uhci_info + i; + for (unsigned i = 0; i < ARRAY_SIZE(uhci_info); i++) { + const UHCIInfo *info = &uhci_info[i]; + const TypeInfo uhci_type_info = { + .name = info->name, + .parent = TYPE_UHCI, + .class_data = info, + .class_init = uhci_data_class_init, + }; + type_register_static(&uhci_type_info); } } diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c index 61628061722..cd5ca9c8850 100644 --- a/hw/usb/vt82c686-uhci-pci.c +++ b/hw/usb/vt82c686-uhci-pci.c @@ -26,7 +26,7 @@ static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp) s->irq = qemu_allocate_irq(uhci_isa_set_irq, s, 0); } -static UHCIInfo uhci_info[] = { +static const UHCIInfo uhci_info[] = { { .name = TYPE_VT82C686B_USB_UHCI, .vendor_id = PCI_VENDOR_ID_VIA, @@ -37,14 +37,14 @@ static UHCIInfo uhci_info[] = { .unplug = true, /* Reason: only works as USB function of VT82xx superio chips */ .notuser = true, - } + }, }; static const TypeInfo vt82c686b_usb_uhci_type_info = { .parent = TYPE_UHCI, .name = TYPE_VT82C686B_USB_UHCI, .class_init = uhci_data_class_init, - .class_data = uhci_info, + .class_data = &uhci_info[0], }; static void vt82c686b_usb_uhci_register_types(void) From patchwork Wed Feb 12 21:32:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13972453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42B28C021A0 for ; Wed, 12 Feb 2025 21:35:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNQ-0005qT-OT; Wed, 12 Feb 2025 16:34:36 -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 1tiKNO-0005fB-7X for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:34 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKNL-0000as-HT for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:33 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-439554db49dso2144735e9.1 for ; Wed, 12 Feb 2025 13:34:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396069; x=1740000869; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AiKngVfPjgICo61bJ6KOaQ3JYL9QFGgGpEIcPT8GY7I=; b=kqUIPD2T6J/fHNorYBIO/Ek0VhimvegC3WwLDmD10tqkiNMjoaWrGlFtDt2YZHtiZc fcqVl7VX0+8My9u+CfqVjwQlt4OXBr0CkGWCh7si/ynnFQPgoBtVCArNCYGu7hc/bk4w UUOFsxOUI6Sx2oX8gklMSTqtQBETTb/86q4MhDAHfm7lnt0pM+M2otEBifsPkwmYhjCR AKQVL34xkMZrCUBh7oiKEXLExPyY51omuuFZ52SUrgFqxLvbUiK3nVUgD8+rTkZo0r2z sKnDftpqNUVTbTVDhiQlI+0UGmVrF6eCjx4DaBxzBQ01CDx4kcf6HY+y5jy7jD07KyX3 YU9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396069; x=1740000869; 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=AiKngVfPjgICo61bJ6KOaQ3JYL9QFGgGpEIcPT8GY7I=; b=weNrO6N36OawJu8IEFRqV6NQzIEu8nqHBYwgX8AizWFbC3tmKftW1bYmriVuYoyWhG Q6HA4v26Bu6A417Djy0GXi7IovD6bujo8VyAGt1UFvkGi8srGBsqLI+dp1c5YwEVsmph rmsAOXijm9zia0O4IHpddUe5J76ruE4wkOdLMsaM+aoO21qko/RRMRukGrN15bNVce0P wE8Bl7RFLdo1SoNYBXIx7KtVLnW5bkNATs6OsatA2sC6ddPAcceNoG0EGFXp7fTOZ2OW GQcCKX2DYa+29EsIwlf8d7WybmzSUiZcturlb48mAJDwvIVgdGcC+jbWZiN0DIvAVcVG pD9g== X-Gm-Message-State: AOJu0Yxk3phqKPILnWnLhIFLAOSGXH+EHHbEQJqw21C9csCo7lOIkqAK C8HwtAvsbuuFwgEhVAJ6Monw9F4pcp2xGIAKw/MUUgFPtV7WJWehIBMDYPdta+BpDP2PqjoneKv byCE= X-Gm-Gg: ASbGnctu1c7TNXiObl95nrt4FnqahqoBJa6703ShgIMi9BQgSklXirfKbEBCN8NwRo/ Il88QzRf9HPUAhMFDOJuFHLt26uPHgi2b/V24WV7tUNZBRmfj5scuOw6kgzYE9pTtVPchmciLq/ a5f7DcZYV1aDl5lRYzhp7vWv9KTpfSwtf7fPW6/b1kd+eZnS3HR4Rhn2ODw3U8cU6Lc1aatYBT6 oNCrvJpTKQhhoPxka0xl7908Yyt/WRRfeUJv8O3Pzk/lSiNPQyFr9qbjqBQEYgk+ENWUcUL1eB1 bfRKgykK4gNBfCNaUMYq83ciqUKpzjLKr/yQsKMkNa4Wg2/fN01rqoR8vh399jea8g== X-Google-Smtp-Source: AGHT+IFuC4/cNISXdOz1oIRCPIv9IXWacPeLZcD5Ss6BqOLS17CfEMQbz67Hd4q1gUhBA7DZx0StHw== X-Received: by 2002:a05:600c:4710:b0:439:3e9e:929a with SMTP id 5b1f17b1804b1-439581b1d5cmr45940235e9.24.1739396069461; Wed, 12 Feb 2025 13:34:29 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395a06d1f2sm30611705e9.18.2025.02.12.13.34.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 19/19] qom: Require TypeInfo::class_data points to const data Date: Wed, 12 Feb 2025 22:32:49 +0100 Message-ID: <20250212213249.45574-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org All TypeInfo::class_data point to const data. Enforce that in the structure, so future class_data stays in .rodata. Signed-off-by: Philippe Mathieu-Daudé --- include/qom/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qom/object.h b/include/qom/object.h index 1d5b0337242..31adc2ef174 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -488,7 +488,7 @@ struct TypeInfo void (*class_init)(ObjectClass *klass, const void *data); void (*class_base_init)(ObjectClass *klass, const void *data); - const void *class_data; + const void *const class_data; const InterfaceInfo *interfaces; };