From: Greg KH <gregkh@linuxfoundation.org>
To: Bernhard Walle <bernhard@bwalle.de>
Cc: christoph.mair@gmail.com, arnd@arndb.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc: bmp085: Handle jiffies overflow correctly
Date: Fri, 24 Feb 2012 14:18:07 -0800 [thread overview]
Message-ID: <20120224221807.GA20680@kroah.com> (raw)
In-Reply-To: <1329672481-19583-1-git-send-email-bernhard@bwalle.de>
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@bwalle.de>
> Acked-by: Arnd Bergmann <arnd@arndb.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
next prev parent reply other threads:[~2012-02-24 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-19 17:28 Bernhard Walle
2012-02-20 12:10 ` Arnd Bergmann
2012-02-24 22:18 ` Greg KH [this message]
2012-02-25 9:28 ` [PATCH] misc: bmp085: Use unsigned long to store jiffies Bernhard Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120224221807.GA20680@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=bernhard@bwalle.de \
--cc=christoph.mair@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome