Skip to content

Commit 9cd027f

Browse files
Niklas Söderlundsmb49
authored andcommitted
thermal/drivers/rcar_gen3_thermal: Store TSC id as unsigned int
BugLink: https://bugs.launchpad.net/bugs/1949397 [ Upstream commit d3a2328 ] 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] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kelsey Skunberg <[email protected]>
1 parent 2fb3056 commit 9cd027f

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
@@ -83,7 +83,7 @@ struct rcar_gen3_thermal_tsc {
8383
struct thermal_zone_device *zone;
8484
struct equation_coefs coef;
8585
int tj_t;
86-
int id; /* thermal channel id */
86+
unsigned int id; /* thermal channel id */
8787
};
8888

8989
struct rcar_gen3_thermal_priv {
@@ -309,7 +309,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
309309
const int *ths_tj_1 = of_device_get_match_data(dev);
310310
struct resource *res;
311311
struct thermal_zone_device *zone;
312-
int ret, i;
312+
unsigned int i;
313+
int ret;
313314

314315
/* default values if FUSEs are missing */
315316
/* TODO: Read values from hardware on supported platforms */
@@ -375,7 +376,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
375376
if (ret < 0)
376377
goto error_unregister;
377378

378-
dev_info(dev, "TSC%d: Loaded %d trip points\n", i, ret);
379+
dev_info(dev, "TSC%u: Loaded %d trip points\n", i, ret);
379380
}
380381

381382
priv->num_tscs = i;

0 commit comments

Comments
 (0)