Skip to contentSkip to conversation

pda_power: remove unneeded assignment

PATCH In review Dan Carpenter 2 participants 2 messages Aug 23, 2010 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pda_power: remove unneeded assignment

We never use the "ret" value from this assignment, and also PTR_ERR(NULL) is zero. I looked at it and this driver is designed to accept a NULL value for "ac_draw". So there isn't a bug in the original code and we can just remove this confusing assignment.

drivers/power/pda_power.c +0 -1
index 69f8aa3..63a6a4d 100644
@@ -279,7 +279,6 @@ static int pda_power_probe(struct platform_device *pdev)
 	if (IS_ERR(ac_draw)) {
 		dev_dbg(dev, "couldn't get ac_draw regulator\n");
 		ac_draw = NULL;
-		ret = PTR_ERR(ac_draw);
 	}
 
 	if (pdata->is_ac_online) {
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

We never use the "ret" value from this assignment, and also PTR_ERR(NULL) is zero. I looked at it and this driver is designed to accept a NULL value for "ac_draw". So there isn't a bug in the original code and we can just remove this confusing assignment.

Looks reasonable.

Quoted 17 lines
drivers/power/pda_power.c +0 -2
index 69f8aa3..63a6a4d 100644
@@ -279,7 +279,6 @@ static int pda_power_probe(struct platform_device *pdev)
 	if (IS_ERR(ac_draw)) {
 		dev_dbg(dev, "couldn't get ac_draw regulator\n");
 		ac_draw = NULL;
-		ret = PTR_ERR(ac_draw);
 	}
 
 	if (pdata->is_ac_online) {
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/