qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] hw/cxl: Fix opaque type interpret wrongly


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/cxl: Fix opaque type interpret wrongly
Date: Fri, 13 Oct 2023 10:52:36 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 13/10/23 03:55, Li Zhijian wrote:
void cxl_component_register_block_init(Object *obj,
                                        CXLComponentState *cxl_cstate,
                                        const char *type)
{
     ComponentRegisters *cregs = &cxl_cstate->crb;
...
     memory_region_init_io(&cregs->cache_mem, obj, &cache_mem_ops, cregs,
                           ".cache_mem", CXL2_COMPONENT_CM_REGION_SIZE);

Obviously, opaque should be pointer to ComponentRegisters.
Fortunately, cregs is the first member of cxl_state, so their values are
the same.

Fixes: 9e58f52d3f8 ("hw/cxl/component: Introduce CXL components (8.1.x, 8.2.5)")
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
  hw/cxl/cxl-component-utils.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

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