Skip to content

Commit 648dae5

Browse files
committed
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]>
1 parent f7c5234 commit 648dae5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/core/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ int cxl_endpoint_get_perf_coordinates(struct cxl_port *port,
21972197
* port each iteration. If the parent is cxl root then there is
21982198
* nothing to gather.
21992199
*/
2200-
while (iter && !is_cxl_root(to_cxl_port(iter->dev.parent))) {
2200+
while (!is_cxl_root(to_cxl_port(iter->dev.parent))) {
22012201
cxl_coordinates_combine(&c, &c, &dport->sw_coord);
22022202
c.write_latency += dport->link_latency;
22032203
c.read_latency += dport->link_latency;

0 commit comments

Comments
 (0)