Skip to content

Commit 7b41a23

Browse files
committed
power: supply: core: fix static checker warning
static checker complains, that the block already breaks if IS_ERR(np) and thus the extra !IS_ERR(np) check in the while condition is superfluous. Avoid the extra check by using while(true) instead. This should not change the runtime behavior at all and I expect the binary to be more or less the same for an optimizing compiler. Fixes: f368f87 ("power: supply: core: convert to fwnnode") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-pm/[email protected]/ Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/20250707-fix-psy-static-checker-warning-v1-1-42d555c2b68a@collabora.com Signed-off-by: Sebastian Reichel <[email protected]>
1 parent f9335bb commit 7b41a23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/power/supply/power_supply_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static int __power_supply_populate_supplied_from(struct power_supply *epsy,
212212
break;
213213
}
214214
fwnode_handle_put(np);
215-
} while (!IS_ERR(np));
215+
} while (true);
216216

217217
return 0;
218218
}

0 commit comments

Comments
 (0)