qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs


From: Fan Ni
Subject: Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
Date: Tue, 3 Oct 2023 17:21:13 +0000

On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote:

> Rename the version not burried in the macro to cap_h.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> 
> I had another instance of this in a series I'll post later today.
> Cleaned that up the same way.
> 
>  hw/cxl/cxl-device-utils.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
> index 517f06d869..bd68328032 100644
> --- a/hw/cxl/cxl-device-utils.c
> +++ b/hw/cxl/cxl-device-utils.c
> @@ -283,13 +283,13 @@ static void memdev_reg_init_common(CXLDeviceState 
> *cxl_dstate) { }
>  
>  void cxl_device_register_init_common(CXLDeviceState *cxl_dstate)
>  {
> -    uint64_t *cap_hdrs = cxl_dstate->caps_reg_state64;
> +    uint64_t *cap_h = cxl_dstate->caps_reg_state64;
>      const int cap_count = 3;
>  
>      /* CXL Device Capabilities Array Register */
> -    ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_ID, 0);
> -    ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_VERSION, 1);
> -    ARRAY_FIELD_DP64(cap_hdrs, CXL_DEV_CAP_ARRAY, CAP_COUNT, cap_count);
> +    ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_ID, 0);
> +    ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_VERSION, 1);
> +    ARRAY_FIELD_DP64(cap_h, CXL_DEV_CAP_ARRAY, CAP_COUNT, cap_count);
>  
>      cxl_device_cap_init(cxl_dstate, DEVICE_STATUS, 1, 2);
>      device_reg_init_common(cxl_dstate);
> -- 
> 2.39.2
> 

Reviewed-by: Fan Ni <fan.ni@samsung.com>



reply via email to

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