* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-25 15:22 ` [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs Jonathan Cameron via
@ 2023-09-27 19:13 ` Fan Ni
2023-09-28 12:22 ` Jonathan Cameron via
2023-10-03 13:28 ` Michael S. Tsirkin
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Fan Ni @ 2023-09-27 19:13 UTC (permalink / raw)
To: Jonathan Cameron
Cc: qemu-devel, Markus Armbruster, Michael S . Tsirkin,
linuxarm@huawei.com
On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote:
> Rename the version not burried in the macro to cap_h.
The change looks good to me. Just one minor thing. why "version" get
involved here?
Fan
>
> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-27 19:13 ` Fan Ni
@ 2023-09-28 12:22 ` Jonathan Cameron via
2023-09-29 7:50 ` Markus Armbruster
0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Cameron via @ 2023-09-28 12:22 UTC (permalink / raw)
To: Fan Ni
Cc: qemu-devel, Markus Armbruster, Michael S . Tsirkin,
linuxarm@huawei.com
On Wed, 27 Sep 2023 19:13:35 +0000
Fan Ni <fan.ni@samsung.com> wrote:
> On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote:
>
> > Rename the version not burried in the macro to cap_h.
> The change looks good to me. Just one minor thing. why "version" get
> involved here?
>
Used in the sense of two copies of something with slightly differences
given if it were straight code without a macro, we'd have just
have used the copy being changed here for all of the calls.
With hindsight, not the best word to choose given the many other meanings!
Jonathan
> Fan
> >
> > 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
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-28 12:22 ` Jonathan Cameron via
@ 2023-09-29 7:50 ` Markus Armbruster
2023-10-03 17:20 ` Fan Ni
0 siblings, 1 reply; 8+ messages in thread
From: Markus Armbruster @ 2023-09-29 7:50 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Fan Ni, qemu-devel, Michael S . Tsirkin, linuxarm@huawei.com
Jonathan Cameron <Jonathan.Cameron@Huawei.com> writes:
> On Wed, 27 Sep 2023 19:13:35 +0000
> Fan Ni <fan.ni@samsung.com> wrote:
>
>> On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote:
>>
>> > Rename the version not burried in the macro to cap_h.
>> The change looks good to me. Just one minor thing. why "version" get
>> involved here?
>>
>
> Used in the sense of two copies of something with slightly differences
> given if it were straight code without a macro, we'd have just
> have used the copy being changed here for all of the calls.
> With hindsight, not the best word to choose given the many other meanings!
Fan, good enough to get your R-by?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-29 7:50 ` Markus Armbruster
@ 2023-10-03 17:20 ` Fan Ni
0 siblings, 0 replies; 8+ messages in thread
From: Fan Ni @ 2023-10-03 17:20 UTC (permalink / raw)
To: Markus Armbruster
Cc: Jonathan Cameron, qemu-devel, Michael S . Tsirkin,
linuxarm@huawei.com
On Fri, Sep 29, 2023 at 09:50:16AM +0200, Markus Armbruster wrote:
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> writes:
>
> > On Wed, 27 Sep 2023 19:13:35 +0000
> > Fan Ni <fan.ni@samsung.com> wrote:
> >
> >> On Mon, Sep 25, 2023 at 04:22:58PM +0100, Jonathan Cameron wrote:
> >>
> >> > Rename the version not burried in the macro to cap_h.
> >> The change looks good to me. Just one minor thing. why "version" get
> >> involved here?
> >>
> >
> > Used in the sense of two copies of something with slightly differences
> > given if it were straight code without a macro, we'd have just
> > have used the copy being changed here for all of the calls.
> > With hindsight, not the best word to choose given the many other meanings!
>
> Fan, good enough to get your R-by?
>
Yes.
Fan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-25 15:22 ` [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs Jonathan Cameron via
2023-09-27 19:13 ` Fan Ni
@ 2023-10-03 13:28 ` Michael S. Tsirkin
2023-10-03 17:21 ` Fan Ni
2023-10-04 10:32 ` Markus Armbruster
3 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2023-10-03 13:28 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: qemu-devel, Markus Armbruster, Fan Ni, linuxarm
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>
> ---
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
pls merge with the rest of local shadowing things.
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-25 15:22 ` [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs Jonathan Cameron via
2023-09-27 19:13 ` Fan Ni
2023-10-03 13:28 ` Michael S. Tsirkin
@ 2023-10-03 17:21 ` Fan Ni
2023-10-04 10:32 ` Markus Armbruster
3 siblings, 0 replies; 8+ messages in thread
From: Fan Ni @ 2023-10-03 17:21 UTC (permalink / raw)
To: Jonathan Cameron
Cc: qemu-devel, Markus Armbruster, Michael S . Tsirkin,
linuxarm@huawei.com
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>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs
2023-09-25 15:22 ` [PATCH] hw/cxl: Fix local variable shadowing of cap_hdrs Jonathan Cameron via
` (2 preceding siblings ...)
2023-10-03 17:21 ` Fan Ni
@ 2023-10-04 10:32 ` Markus Armbruster
3 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2023-10-04 10:32 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: qemu-devel, Michael S . Tsirkin, Fan Ni, linuxarm
Jonathan Cameron <Jonathan.Cameron@huawei.com> writes:
> Rename the version not burried in the macro to cap_h.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Queued, thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread