diff options
author | Huang Ying <[email protected]> | 2024-06-18 16:46:39 +0800 |
---|---|---|
committer | Dave Jiang <[email protected]> | 2024-07-02 12:52:26 -0700 |
commit | f3d70720e92c24c22e0e63c2588636edba33eb1a (patch) | |
tree | 52d5597bfb51f14c173f75a5217375c99a0dd997 | |
parent | 643e8e3e65290fdfe507bb23fa524c77e1345af3 (diff) |
cxl/region: Simplify cxl_region_nid()
The node ID of the region can be gotten via resource start address
directly. This simplifies the implementation of cxl_region_nid().
Signed-off-by: Huang Ying <[email protected]>
Suggested-by: Alison Schofield <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Bharata B Rao <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Vishal Verma <[email protected]>
Cc: Ira Weiny <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Dave Jiang <[email protected]>
-rw-r--r-- | drivers/cxl/core/region.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index dc15ceba7ab7..32473fddce03 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -2309,15 +2309,13 @@ static bool cxl_region_update_coordinates(struct cxl_region *cxlr, int nid) static int cxl_region_nid(struct cxl_region *cxlr) { struct cxl_region_params *p = &cxlr->params; - struct cxl_endpoint_decoder *cxled; - struct cxl_decoder *cxld; + struct resource *res; guard(rwsem_read)(&cxl_region_rwsem); - cxled = p->targets[0]; - if (!cxled) + res = p->res; + if (!res) return NUMA_NO_NODE; - cxld = &cxled->cxld; - return phys_to_target_node(cxld->hpa_range.start); + return phys_to_target_node(res->start); } static int cxl_region_perf_attrs_callback(struct notifier_block *nb, |