Skip to content

Commit d3a2328

Browse files
Niklas Söderlunddlezcano
authored andcommitted
thermal/drivers/rcar_gen3_thermal: Store TSC id as unsigned int
The TSC id and number of TSC ids should be stored as unsigned int as they can't be negative. Fix the datatype of the loop counter 'i' and rcar_gen3_thermal_tsc.id to reflect this. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 47cf09e commit d3a2328

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct rcar_gen3_thermal_tsc {
8484
struct thermal_zone_device *zone;
8585
struct equation_coefs coef;
8686
int tj_t;
87-
int id; /* thermal channel id */
87+
unsigned int id; /* thermal channel id */
8888
};
8989

9090
struct rcar_gen3_thermal_priv {
@@ -398,7 +398,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
398398
const int *ths_tj_1 = of_device_get_match_data(dev);
399399
struct resource *res;
400400
struct thermal_zone_device *zone;
401-
int ret, i;
401+
unsigned int i;
402+
int ret;
402403

403404
/* default values if FUSEs are missing */
404405
/* TODO: Read values from hardware on supported platforms */
@@ -467,7 +468,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
467468
if (ret < 0)
468469
goto error_unregister;
469470

470-
dev_info(dev, "TSC%d: Loaded %d trip points\n", i, ret);
471+
dev_info(dev, "TSC%u: Loaded %d trip points\n", i, ret);
471472
}
472473

473474
priv->num_tscs = i;

0 commit comments

Comments
 (0)