Re: [PATCH v4 03/14] cxl/region: Rename misleading variable name @hpa to @hpa_range
From: Dave Jiang
Date: Wed Nov 12 2025 - 11:23:56 EST
On 11/11/25 7:41 AM, Jonathan Cameron wrote:
> On Mon, 3 Nov 2025 19:47:44 +0100
> Robert Richter <rrichter@xxxxxxx> wrote:
>
>> @hpa is actually a @hpa_range, rename variables accordingly.
>>
>> Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>
>> Signed-off-by: Robert Richter <rrichter@xxxxxxx>
> Passing comment below on readability (unrelated to the change you made)
>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
>
> Dave, I wonder if it is reasonable to queue at least some of Robert's series
> like this one so that people can start basing on top of those and the
> merge conflicts will be less painful in the long run.
We can certainly do that, if the patches can be split out to a different series. Next week is the last week I'll take patches for this cycle.
DJ
>
>> ---
>> drivers/cxl/core/region.c | 30 ++++++++++++++++--------------
>> 1 file changed, 16 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
>> index a780e65532a7..bb889c891cf7 100644
>> --- a/drivers/cxl/core/region.c
>> +++ b/drivers/cxl/core/region.c
>
>> @@ -3577,12 +3578,13 @@ int cxl_add_to_region(struct cxl_endpoint_decoder *cxled)
>> return -ENXIO;
>>
>> /*
>> - * Ensure that if multiple threads race to construct_region() for @hpa
>> - * one does the construction and the others add to that.
>> + * Ensure that if multiple threads race to construct_region()
>> + * for the HPA range one does the construction and the others
>> + * add to that.
>
> Unrelated but a few commas would make this easier to read. Something like:
>
> * Ensure that, if multiple threads race to construct_region()
> * for the HPA range, one does the construction and the others
> * add to that.
>
>> */
>> mutex_lock(&cxlrd->range_lock);
>> struct cxl_region *cxlr __free(put_cxl_region) =
>> - cxl_find_region_by_range(cxlrd, hpa);
>> + cxl_find_region_by_range(cxlrd, hpa_range);
>> if (!cxlr)
>> cxlr = construct_region(cxlrd, cxled);
>> mutex_unlock(&cxlrd->range_lock);
>