Skip to contentSkip to conversation

power: supply: rk817: remove redundant null check on node

PATCH New Colin Ian King 1 participant 1 message Mar 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: rk817: remove redundant null check on node

The pointer null is being null checked immediately after it has been assigned at the start of the function and not changed afterwards. The subsequent null check on node is redudant and can be removed.

---
 drivers/power/supply/rk817_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/rk817_charger.c +1 -1
index 945c7720c4ae..1251022eb052 100644
@@ -1088,7 +1088,7 @@ static int rk817_charger_probe(struct platform_device *pdev)
 	rk817_bat_calib_vol(charger);
 
 	pscfg.drv_data = charger;
-	pscfg.fwnode = node ? &node->fwnode : NULL;
+	pscfg.fwnode = &node->fwnode;
 
 	/*
 	 * Get sample resistor value. Note only values of 10000 or 20000
Signature · 1 line
2.49.0