Skip to content

Commit 3ae5950

Browse files
geertudlezcano
authored andcommitted
thermal/drivers/rcar_gen3_thermal: Do not shadow rcar_gen3_ths_tj_1
With -Wshadow: drivers/thermal/rcar_gen3_thermal.c: In function ‘rcar_gen3_thermal_probe’: drivers/thermal/rcar_gen3_thermal.c:310:13: warning: declaration of ‘rcar_gen3_ths_tj_1’ shadows a global declaration [-Wshadow] 310 | const int *rcar_gen3_ths_tj_1 = of_device_get_match_data(dev); | ^~~~~~~~~~~~~~~~~~ drivers/thermal/rcar_gen3_thermal.c:246:18: note: shadowed declaration is here 246 | static const int rcar_gen3_ths_tj_1 = 126; | ^~~~~~~~~~~~~~~~~~ To add to the confusion, the local variable has a different type. Fix the shadowing by renaming the local variable to ths_tj_1. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/9ea7e65d0331daba96f9a7925cb3d12d2170efb1.1623076804.git.geert+renesas@glider.be
1 parent 8946187 commit 3ae5950

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
307307
{
308308
struct rcar_gen3_thermal_priv *priv;
309309
struct device *dev = &pdev->dev;
310-
const int *rcar_gen3_ths_tj_1 = of_device_get_match_data(dev);
310+
const int *ths_tj_1 = of_device_get_match_data(dev);
311311
struct resource *res;
312312
struct thermal_zone_device *zone;
313313
int ret, i;
@@ -352,8 +352,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
352352
priv->tscs[i] = tsc;
353353

354354
priv->thermal_init(tsc);
355-
rcar_gen3_thermal_calc_coefs(tsc, ptat, thcodes[i],
356-
*rcar_gen3_ths_tj_1);
355+
rcar_gen3_thermal_calc_coefs(tsc, ptat, thcodes[i], *ths_tj_1);
357356

358357
zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,
359358
&rcar_gen3_tz_of_ops);

0 commit comments

Comments
 (0)