mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
misc: bmp085: Handle jiffies overflow correctly
By using the time_is_before_jiffies() macro instead of normal arithmetic, the jiffies overflow is handled correctly. Signed-off-by: Bernhard Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
ef77d83fd7
commit
3734f7858f
1 changed files with 2 additions and 1 deletions
|
|
@ -234,7 +234,8 @@ static s32 bmp085_get_pressure(struct bmp085_data *data, int *pressure)
|
|||
int status;
|
||||
|
||||
/* alt least every second force an update of the ambient temperature */
|
||||
if (data->last_temp_measurement + 1*HZ < jiffies) {
|
||||
if (data->last_temp_measurement == 0 ||
|
||||
time_is_before_jiffies(data->last_temp_measurement + 1*HZ)) {
|
||||
status = bmp085_get_temperature(data, NULL);
|
||||
if (status != 0)
|
||||
goto exit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue