Skip to contentSkip to conversation

hwmon: (lm63) Drop redundant safety on cache lifetime

PATCH In review Jean Delvare 2 participants 2 messages May 19, 2013 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/hwmon/lm63.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/lm63.c +2 -3
@@ -247,9 +247,8 @@ static struct lm63_data *lm63_update_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 */
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jean Delvare

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.

Quoted 29 lines
Cc Imre Deak <[email protected]>
---
 drivers/hwmon/lm63.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/lm63.c +2 -3
@@ -247,9 +247,8 @@ static struct lm63_data *lm63_update_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 */
Signature · 7 lines
-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors