aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jiang <[email protected]>2024-04-03 08:47:12 -0700
committerDave Jiang <[email protected]>2024-04-05 08:15:50 -0700
commit648dae58a830ecceea3b1bebf68432435980f137 (patch)
treed83117e7f5c6caafc90895795f1276031cad95ce
parentf7c52345ccc96343c0a05bdea3121c8ac7b67d5f (diff)
cxl: Remove checking of iter in cxl_endpoint_get_perf_coordinates()
The while() loop in cxl_endpoint_get_perf_coordinates() checks to see if 'iter' is valid as part of the condition breaking out of the loop. is_cxl_root() will stop the loop before the next iteration could go NULL. Remove the iter check. The presence of the iter or removing the iter does not impact the behavior of the code. This is a code clean up and not a bug fix. Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Davidlohr Bueso <[email protected]> Reviewed-by: Dan Williams <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dave Jiang <[email protected]>
-rw-r--r--drivers/cxl/core/port.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 2b0cab556072..6cbde50a742b 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -2197,7 +2197,7 @@ int cxl_endpoint_get_perf_coordinates(struct cxl_port *port,
* port each iteration. If the parent is cxl root then there is
* nothing to gather.
*/
- while (iter && !is_cxl_root(to_cxl_port(iter->dev.parent))) {
+ while (!is_cxl_root(to_cxl_port(iter->dev.parent))) {
cxl_coordinates_combine(&c, &c, &dport->sw_coord);
c.write_latency += dport->link_latency;
c.read_latency += dport->link_latency;