qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 08/18] hw/arm/fsl-imx8mp: Add PCIe support


From: Peter Maydell
Subject: Re: [PATCH v2 08/18] hw/arm/fsl-imx8mp: Add PCIe support
Date: Mon, 17 Feb 2025 13:40:48 +0000

On Tue, 4 Feb 2025 at 09:21, Bernhard Beschow <shentey@gmail.com> wrote:
>
> Linux checks for the PLLs in the PHY to be locked, so implement a model
> emulating that.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---

> +static const VMStateDescription fsl_imx8m_pcie_phy_vmstate = {
> +    .name = "fsl-imx8m-pcie-phy",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .fields = (const VMStateField[]) {
> +        VMSTATE_UINT8_ARRAY(data, FslImx8mPciePhyState,
> +                            ARRAY_SIZE(((FslImx8mPciePhyState 
> *)NULL)->data)),

Use a defined constant for the number of array elements, please.
We don't do this thing with ARRAY_SIZE of a cast NULL pointer
anywhere else in the codebase.

> +        VMSTATE_END_OF_LIST()
> +    }
> +};
> +
> +static void fsl_imx8m_pcie_phy_class_init(ObjectClass *klass, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(klass);
> +
> +    dc->realize = fsl_imx8m_pcie_phy_realize;
> +    dc->vmsd = &fsl_imx8m_pcie_phy_vmstate;
> +}

This is missing the reset method.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]