kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] pda_power: remove unneeded assignment
@ 2010-08-23 21:21 Dan Carpenter
  2010-08-23 21:39 ` Daniel Mack
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-08-23 21:21 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: Daniel Mack, linux-kernel, kernel-janitors

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.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index 69f8aa3..63a6a4d 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -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) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] pda_power: remove unneeded assignment
  2010-08-23 21:21 [patch] pda_power: remove unneeded assignment Dan Carpenter
@ 2010-08-23 21:39 ` Daniel Mack
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Mack @ 2010-08-23 21:39 UTC (permalink / raw)
  To: Dan Carpenter, Anton Vorontsov, linux-kernel, kernel-janitors

On Mon, Aug 23, 2010 at 11:21:03PM +0200, Dan Carpenter wrote:
> 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.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Looks reasonable.

Acked-by: Daniel Mack <daniel@caiaq.de>

> diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
> index 69f8aa3..63a6a4d 100644
> --- a/drivers/power/pda_power.c
> +++ b/drivers/power/pda_power.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-23 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 21:21 [patch] pda_power: remove unneeded assignment Dan Carpenter
2010-08-23 21:39 ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).