lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 24 Feb 2012 14:18:07 -0800
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Bernhard Walle <bernhard@...lle.de>
Cc:	christoph.mair@...il.com, arnd@...db.de,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] misc: bmp085: Handle jiffies overflow correctly

On Sun, Feb 19, 2012 at 06:28:01PM +0100, Bernhard Walle wrote:
> By using the time_is_before_jiffies() macro instead of normal
> arithmetic, the jiffies overflow is handled correctly.
> 
> Signed-off-by: Bernhard Walle <bernhard@...lle.de>
> Acked-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/misc/bmp085.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/misc/bmp085.c b/drivers/misc/bmp085.c
> index b29a2be..7cfc598 100644
> --- a/drivers/misc/bmp085.c
> +++ b/drivers/misc/bmp085.c
> @@ -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)) {

This causes a complier warning:
drivers/misc/bmp085.c: In function ‘bmp085_get_pressure’:
drivers/misc/bmp085.c:238:4: warning: comparison of distinct pointer types lacks a cast [enabled by default]

Care to send me a follow-on patch that fixes this?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ