Re: [PATCH v4 1/7] iio: pressure: bmp280: Use bulk read for humidity calibration data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 29, 2024 at 03:06:14PM +0300, Andy Shevchenko wrote:
> On Wed, Aug 28, 2024 at 10:51:21PM +0200, Vasileios Amoiridis wrote:
> > Convert individual reads to a bulk read for the humidity calibration data.
> 
> ...
> 
> > +	calib->H2 = get_unaligned_le16(&data->bme280_humid_cal_buf[H2]);
> > +	calib->H3 = data->bme280_humid_cal_buf[H3];
> > +	tmp_1 = get_unaligned_be16(&data->bme280_humid_cal_buf[H4]);
> > +	tmp_2 = FIELD_GET(BME280_COMP_H4_GET_MASK_UP, tmp_1);
> > +	h4_upper = FIELD_PREP(BME280_COMP_H4_PREP_MASK_UP, tmp_2);
> > +	h4_lower = FIELD_GET(BME280_COMP_H4_MASK_LOW,
> 
> > +			get_unaligned_be16(&data->bme280_humid_cal_buf[H4]));
> 
> Either I don't understand the side effects, or this is the same as tmp_1. No?
> 

Hi Andy,

Thanks again for taking the time to review this!

This is the same as tmp1, and I didn't notice that I should change it.
Thanks for pointing it out.

Cheers,
Vasilis
> > +	calib->H4 = sign_extend32(h4_upper | h4_lower, 11);
> > +	calib->H5 = sign_extend32(FIELD_GET(BME280_COMP_H5_MASK,
> > +			get_unaligned_le16(&data->bme280_humid_cal_buf[H5])), 11);
> > +	calib->H6 = data->bme280_humid_cal_buf[H6];
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux