drivers: sensor: tsic_xx6: fix implicit sign extension
This commit explicitly type-casts data_bits to uint64_t in order to fix implicit sign extension warning Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit is contained in:
parent
493296ee2e
commit
0fd662febc
1 changed files with 2 additions and 1 deletions
|
@ -161,7 +161,8 @@ static void tsic_xx6_get_value(const struct tsic_xx6_config *config, struct tsic
|
|||
int64_t tmp;
|
||||
|
||||
/* Apply the datasheet formula scaled to micro celcius */
|
||||
tmp = data_bits * (config->higher_temperature_limit - config->lower_temperature_limit);
|
||||
tmp = (int64_t)data_bits *
|
||||
(config->higher_temperature_limit - config->lower_temperature_limit);
|
||||
tmp = tmp * 1000000 / (BIT(config->data_bits) - 1);
|
||||
tmp += (int64_t)config->lower_temperature_limit * 1000000;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue