All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/i2c/chips/* : timer_after
@ 2005-02-24  9:52 Christophe Lucas
  2005-02-24 10:13 ` Alexey Dobriyan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christophe Lucas @ 2005-02-24  9:52 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

Hi kj folks,

I think this patch have already posted, but kj TODO have been recently
updated, and this entry already is here, so:

description:
From kj/TODO:
4.
Some drivers do:
if ((jiffies - data->last_updated > HZ * 2) ||
            (jiffies < data->last_updated))
Should be:
#include <linux/jiffies.h>
if (time_after(jiffies, data->last_updated + HZ * 2))

Have a patch for drivers/i2c/chips/*.

Signed-off-by: Christophe Lucas <c.lucas@ifrance.com>


[-- Attachment #2: patch-linux-2.6.11-rc4-jiffies.diff --]
[-- Type: text/plain, Size: 4832 bytes --]

diff -urpN -X /work/users/dontdiff linux-2.6.11-rc4-vanilla/drivers/i2c/chips/adm1025.c linux-2.6.11-rc4/drivers/i2c/chips/adm1025.c
--- linux-2.6.11-rc4-vanilla/drivers/i2c/chips/adm1025.c	2004-12-24 22:33:47.000000000 +0100
+++ linux-2.6.11-rc4/drivers/i2c/chips/adm1025.c	2005-02-24 09:30:35.000000000 +0100
@@ -46,6 +46,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -512,8 +513,7 @@ static struct adm1025_data *adm1025_upda
 
 	down(&data->update_lock);
 
-	if ((jiffies - data->last_updated > HZ * 2) ||
-	    (jiffies < data->last_updated) ||
+	if (time_after(jiffies, data->last_updated + HZ * 2) || 
 	    !data->valid) {
 		int i;
 
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc4-vanilla/drivers/i2c/chips/lm83.c linux-2.6.11-rc4/drivers/i2c/chips/lm83.c
--- linux-2.6.11-rc4-vanilla/drivers/i2c/chips/lm83.c	2004-12-24 22:34:32.000000000 +0100
+++ linux-2.6.11-rc4/drivers/i2c/chips/lm83.c	2005-02-24 09:27:07.000000000 +0100
@@ -31,6 +31,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 
@@ -369,8 +370,7 @@ static struct lm83_data *lm83_update_dev
 
 	down(&data->update_lock);
 
-	if ((jiffies - data->last_updated > HZ * 2) ||
-	    (jiffies < data->last_updated) ||
+	if (time_after(jiffies, data->last_updated + HZ * 2) || 
 	    !data->valid) {
 		int nr;
 
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc4-vanilla/drivers/i2c/chips/lm90.c linux-2.6.11-rc4/drivers/i2c/chips/lm90.c
--- linux-2.6.11-rc4-vanilla/drivers/i2c/chips/lm90.c	2005-02-24 09:34:22.000000000 +0100
+++ linux-2.6.11-rc4/drivers/i2c/chips/lm90.c	2005-02-24 09:26:55.000000000 +0100
@@ -66,6 +66,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 
@@ -495,8 +496,7 @@ static struct lm90_data *lm90_update_dev
 
 	down(&data->update_lock);
 
-	if ((jiffies - data->last_updated > HZ * 2) ||
-	    (jiffies < data->last_updated) ||
+	if ( time_after(jiffies, data->last_updated + HZ * 2) || 
 	    !data->valid) {
 		u8 oldh, newh;
 
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc4-vanilla/drivers/i2c/chips/max1619.c linux-2.6.11-rc4/drivers/i2c/chips/max1619.c
--- linux-2.6.11-rc4-vanilla/drivers/i2c/chips/max1619.c	2004-12-24 22:35:25.000000000 +0100
+++ linux-2.6.11-rc4/drivers/i2c/chips/max1619.c	2005-02-24 09:27:54.000000000 +0100
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 
@@ -331,8 +332,7 @@ static struct max1619_data *max1619_upda
 
 	down(&data->update_lock);
 
-	if ((jiffies - data->last_updated > HZ * 2) ||
-	    (jiffies < data->last_updated) ||
+	if (time_after(jiffies, data->last_updated + HZ * 2) ||
 	    !data->valid) {
 		
 		dev_dbg(&client->dev, "Updating max1619 data.\n");
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc4-vanilla/drivers/i2c/chips/pc87360.c linux-2.6.11-rc4/drivers/i2c/chips/pc87360.c
--- linux-2.6.11-rc4-vanilla/drivers/i2c/chips/pc87360.c	2005-02-24 09:34:22.000000000 +0100
+++ linux-2.6.11-rc4/drivers/i2c/chips/pc87360.c	2005-02-24 09:29:04.000000000 +0100
@@ -37,6 +37,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 #include <linux/i2c-vid.h>
@@ -1174,8 +1175,7 @@ static struct pc87360_data *pc87360_upda
 
 	down(&data->update_lock);
 
-	if ((jiffies - data->last_updated > HZ * 2)
-	 || (jiffies < data->last_updated) || !data->valid) {
+	if (time_after(jiffies, data->last_updated + HZ * 2) || !data->valid) {
 		dev_dbg(&client->dev, "Data update\n");
 
 		/* Fans */
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc4-vanilla/drivers/i2c/chips/w83l785ts.c linux-2.6.11-rc4/drivers/i2c/chips/w83l785ts.c
--- linux-2.6.11-rc4-vanilla/drivers/i2c/chips/w83l785ts.c	2004-12-24 22:34:26.000000000 +0100
+++ linux-2.6.11-rc4/drivers/i2c/chips/w83l785ts.c	2005-02-24 09:30:17.000000000 +0100
@@ -35,6 +35,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 
@@ -301,9 +302,7 @@ static struct w83l785ts_data *w83l785ts_
 
 	down(&data->update_lock);
 
-	if (!data->valid
-	 || (jiffies - data->last_updated > HZ * 2)
-	 || (jiffies < data->last_updated)) {
+	if (!data->valid || time_after(jiffies, data->last_updated + HZ * 2)) {
 		dev_dbg(&client->dev, "Updating w83l785ts data.\n");
 		data->temp = w83l785ts_read_value(client,
 			     W83L785TS_REG_TEMP, data->temp);

[-- Attachment #3: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-24 19:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-24  9:52 [KJ] [PATCH] drivers/i2c/chips/* : timer_after Christophe Lucas
2005-02-24 10:13 ` Alexey Dobriyan
2005-02-24 10:45 ` Christophe Lucas
2005-02-24 16:06 ` Randy.Dunlap
2005-02-24 19:08 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.