From 78c2c2fe59b8c6b7d20e163efde0bfccc679f647 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 8 Jul 2013 14:18:24 +0200 Subject: [PATCH 1/2] hwmon: (lm90) Drop redundant safety on cache lifetime time_after (as opposed to time_after_equal) already ensures that the cache lifetime is at least as much as requested. There is no point in manually adding another jiffy to that value, and this can confuse the reader into wrong interpretation. Signed-off-by: Jean Delvare Cc: Imre Deak --- drivers/hwmon/lm90.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 8eeb141c85ac..cdff74282955 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -470,8 +470,8 @@ static struct lm90_data *lm90_update_device(struct device *dev) mutex_lock(&data->update_lock); - next_update = data->last_updated - + msecs_to_jiffies(data->update_interval) + 1; + next_update = data->last_updated + + msecs_to_jiffies(data->update_interval); if (time_after(jiffies, next_update) || !data->valid) { u8 h, l; u8 alarms; From 5b0620df9c38438ee245a97b8102ed74556e5505 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 8 Jul 2013 14:18:24 +0200 Subject: [PATCH 2/2] hwmon: (lm63) Drop redundant safety on cache lifetime time_after (as opposed to time_after_equal) already ensures that the cache lifetime is at least as much as requested. There is no point in manually adding another jiffy to that value, and this can confuse the reader into wrong interpretation. Signed-off-by: Jean Delvare Cc: Imre Deak --- drivers/hwmon/lm63.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c index f644a2e57599..d0def50ea860 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c @@ -247,9 +247,8 @@ static struct lm63_data *lm63_update_device(struct device *dev) mutex_lock(&data->update_lock); - next_update = data->last_updated - + msecs_to_jiffies(data->update_interval) + 1; - + next_update = data->last_updated + + msecs_to_jiffies(data->update_interval); if (time_after(jiffies, next_update) || !data->valid) { if (data->config & 0x04) { /* tachometer enabled */ /* order matters for fan1_input */