Skip to content

Commit df8b57c

Browse files
Robert Richterdavejiang
authored andcommitted
cxl/region: Rename misleading variable name @HPA to @hpa_range
@HPA is actually a @hpa_range, rename variables accordingly. Reviewed-by: Gregory Price <gourry@gourry.net> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Signed-off-by: Robert Richter <rrichter@amd.com> Link: https://patch.msgid.link/20260114164837.1076338-2-rrichter@amd.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 0692afe commit df8b57c

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

drivers/cxl/core/region.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,9 +3474,9 @@ static int match_decoder_by_range(struct device *dev, const void *data)
34743474
}
34753475

34763476
static struct cxl_decoder *
3477-
cxl_port_find_switch_decoder(struct cxl_port *port, struct range *hpa)
3477+
cxl_port_find_switch_decoder(struct cxl_port *port, struct range *hpa_range)
34783478
{
3479-
struct device *cxld_dev = device_find_child(&port->dev, hpa,
3479+
struct device *cxld_dev = device_find_child(&port->dev, hpa_range,
34803480
match_decoder_by_range);
34813481

34823482
return cxld_dev ? to_cxl_decoder(cxld_dev) : NULL;
@@ -3489,14 +3489,14 @@ cxl_find_root_decoder(struct cxl_endpoint_decoder *cxled)
34893489
struct cxl_port *port = cxled_to_port(cxled);
34903490
struct cxl_root *cxl_root __free(put_cxl_root) = find_cxl_root(port);
34913491
struct cxl_decoder *root, *cxld = &cxled->cxld;
3492-
struct range *hpa = &cxld->hpa_range;
3492+
struct range *hpa_range = &cxld->hpa_range;
34933493

3494-
root = cxl_port_find_switch_decoder(&cxl_root->port, hpa);
3494+
root = cxl_port_find_switch_decoder(&cxl_root->port, hpa_range);
34953495
if (!root) {
34963496
dev_err(cxlmd->dev.parent,
34973497
"%s:%s no CXL window for range %#llx:%#llx\n",
34983498
dev_name(&cxlmd->dev), dev_name(&cxld->dev),
3499-
cxld->hpa_range.start, cxld->hpa_range.end);
3499+
hpa_range->start, hpa_range->end);
35003500
return NULL;
35013501
}
35023502

@@ -3562,7 +3562,7 @@ static int __construct_region(struct cxl_region *cxlr,
35623562
struct cxl_endpoint_decoder *cxled)
35633563
{
35643564
struct cxl_memdev *cxlmd = cxled_to_memdev(cxled);
3565-
struct range *hpa = &cxled->cxld.hpa_range;
3565+
struct range *hpa_range = &cxled->cxld.hpa_range;
35663566
struct cxl_region_params *p;
35673567
struct resource *res;
35683568
int rc;
@@ -3583,7 +3583,7 @@ static int __construct_region(struct cxl_region *cxlr,
35833583
if (!res)
35843584
return -ENOMEM;
35853585

3586-
*res = DEFINE_RES_MEM_NAMED(hpa->start, range_len(hpa),
3586+
*res = DEFINE_RES_MEM_NAMED(hpa_range->start, range_len(hpa_range),
35873587
dev_name(&cxlr->dev));
35883588

35893589
rc = cxl_extended_linear_cache_resize(cxlr, res);
@@ -3666,11 +3666,12 @@ static struct cxl_region *construct_region(struct cxl_root_decoder *cxlrd,
36663666
}
36673667

36683668
static struct cxl_region *
3669-
cxl_find_region_by_range(struct cxl_root_decoder *cxlrd, struct range *hpa)
3669+
cxl_find_region_by_range(struct cxl_root_decoder *cxlrd,
3670+
struct range *hpa_range)
36703671
{
36713672
struct device *region_dev;
36723673

3673-
region_dev = device_find_child(&cxlrd->cxlsd.cxld.dev, hpa,
3674+
region_dev = device_find_child(&cxlrd->cxlsd.cxld.dev, hpa_range,
36743675
match_region_by_range);
36753676
if (!region_dev)
36763677
return NULL;
@@ -3680,7 +3681,7 @@ cxl_find_region_by_range(struct cxl_root_decoder *cxlrd, struct range *hpa)
36803681

36813682
int cxl_add_to_region(struct cxl_endpoint_decoder *cxled)
36823683
{
3683-
struct range *hpa = &cxled->cxld.hpa_range;
3684+
struct range *hpa_range = &cxled->cxld.hpa_range;
36843685
struct cxl_region_params *p;
36853686
bool attach = false;
36863687
int rc;
@@ -3691,12 +3692,13 @@ int cxl_add_to_region(struct cxl_endpoint_decoder *cxled)
36913692
return -ENXIO;
36923693

36933694
/*
3694-
* Ensure that if multiple threads race to construct_region() for @hpa
3695-
* one does the construction and the others add to that.
3695+
* Ensure that, if multiple threads race to construct_region()
3696+
* for the HPA range, one does the construction and the others
3697+
* add to that.
36963698
*/
36973699
mutex_lock(&cxlrd->range_lock);
36983700
struct cxl_region *cxlr __free(put_cxl_region) =
3699-
cxl_find_region_by_range(cxlrd, hpa);
3701+
cxl_find_region_by_range(cxlrd, hpa_range);
37003702
if (!cxlr)
37013703
cxlr = construct_region(cxlrd, cxled);
37023704
mutex_unlock(&cxlrd->range_lock);

0 commit comments

Comments
 (0)