Message ID | 20170623194435.8094-1-christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> Christophe JAILLET <christophe.jaillet@wanadoo.fr> hat am 23. Juni 2017 um 21:44 geschrieben: > > > 'tz' is a valid pointer at this point, so calling PTR_ERR on it is > pointless. > This 'err = PTR_ERR(tz)' looks like a cut'n'paste from a few lines above. > So remove it. 'err' is already the error we want to report. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Thanks, but Dan Carpenter already send a fix for this.
On Fri, Jun 23, 2017 at 10:25:45PM +0200, Stefan Wahren wrote: > > > Christophe JAILLET <christophe.jaillet@wanadoo.fr> hat am 23. Juni 2017 um 21:44 geschrieben: > > > > > > 'tz' is a valid pointer at this point, so calling PTR_ERR on it is > > pointless. > > This 'err = PTR_ERR(tz)' looks like a cut'n'paste from a few lines above. > > So remove it. 'err' is already the error we want to report. > > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > > Thanks, but Dan Carpenter already send a fix for this. Yeah, and I applied Dan's version as it was coming first in my queue. Sorry.
diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c index 0ecf80890c84..e6863c841662 100644 --- a/drivers/thermal/broadcom/bcm2835_thermal.c +++ b/drivers/thermal/broadcom/bcm2835_thermal.c @@ -245,7 +245,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) */ err = tz->ops->get_trip_temp(tz, 0, &trip_temp); if (err < 0) { - err = PTR_ERR(tz); dev_err(&pdev->dev, "Not able to read trip_temp: %d\n", err);
'tz' is a valid pointer at this point, so calling PTR_ERR on it is pointless. This 'err = PTR_ERR(tz)' looks like a cut'n'paste from a few lines above. So remove it. 'err' is already the error we want to report. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- v2: fix empty subject --- drivers/thermal/broadcom/bcm2835_thermal.c | 1 - 1 file changed, 1 deletion(-)