Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3734f785 authored by Bernhard Walle's avatar Bernhard Walle Committed by Greg Kroah-Hartman
Browse files

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: default avatarBernhard Walle <bernhard@bwalle.de>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ef77d83f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;