/* Compensation code taken from BME280 datasheet, Section 4.2.3 "Compensation formula".  */
static void bme280_compensate_temp(struct bme280_data *data, int32_t adc_temp)
/* Compensation code taken from BME280 datasheet, Section 4.2.3 "Compensation formula".  */
static void bme280_compensate_temp(struct bme280_data *data, int32_t adc_temp)
{
	int32_t var1, var2;
	var1 = (((adc_temp >> 3) - ((int32_t)data->dig_t1 << 1)) *
		((int32_t)data->dig_t2)) >> 11;
	var2 = (((((adc_temp >> 4) - ((int32_t)data->dig_t1)) *
		  ((adc_temp >> 4) - ((int32_t)data->dig_t1))) >> 12) *
		((int32_t)data->dig_t3)) >> 14;
	data->t_fine = var1 + var2;
	data->comp_temp = (data->t_fine * 5 + 128) >> 8;
}