lkml.org 
[lkml]   [2004]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2.6] watch64: generic variable monitoring system
The following fixes watch64 patch previously submitted to follow CodingStyle
guidelines. BK repo is up to date as well

Jeff.

Signed-off-by: Josef "Jeff" Sipek <jeffpc@optonline.net>


--- 1.7/kernel/watch64.c 2004-07-14 16:41:26 -04:00
+++ edited/watch64.c 2004-09-03 16:12:39 -04:00
@@ -110,7 +110,8 @@
return;
}

- printk(KERN_WARNING "watch64: 2003/08/22 Josef 'Jeff' Sipek <jeffpc@optonline.net>\n");
+ printk(KERN_WARNING "watch64: 2003/08/22 Josef 'Jeff' Sipek "
+ "<jeffpc@optonline.net>\n");
printk(KERN_WARNING "watch64: Enabling Watch64 extensions...");

init_timer(&watch64_timer);
@@ -139,19 +140,21 @@
rcu_read_lock();
list_for_each_rcu(entry, &watch64_head) {
watch_struct = list_entry(entry, struct watch64, list);
- if (*watch_struct->ptr != watch_struct->oldval) {
- tmp = *watch_struct->ptr;
- if (tmp > watch_struct->oldval) {
- write_seqlock(&watch_struct->lock);
- watch_struct->total += tmp - watch_struct->oldval;
- write_sequnlock(&watch_struct->lock);
- } else if (tmp < watch_struct->oldval) {
- write_seqlock(&watch_struct->lock);
- watch_struct->total += ((u_int64_t) 1<<BITS_PER_LONG) - watch_struct->oldval + tmp;
- write_sequnlock(&watch_struct->lock);
- }
- watch_struct->oldval = tmp;
+ if (*watch_struct->ptr == watch_struct->oldval)
+ continue;
+
+ tmp = *watch_struct->ptr;
+ if (tmp > watch_struct->oldval) {
+ write_seqlock(&watch_struct->lock);
+ watch_struct->total += tmp - watch_struct->oldval;
+ write_sequnlock(&watch_struct->lock);
+ } else if (tmp < watch_struct->oldval) {
+ write_seqlock(&watch_struct->lock);
+ watch_struct->total += ((u_int64_t) 1<<BITS_PER_LONG)
+ - watch_struct->oldval + tmp;
+ write_sequnlock(&watch_struct->lock);
}
+ watch_struct->oldval = tmp;
}
rcu_read_unlock();

@@ -181,7 +184,8 @@
temp->interval = WATCH64_INTERVAL;
else if (interval<WATCH64_MINIMUM) {
temp->interval = WATCH64_MINIMUM;
- printk("watch64: attempted to add new watch with interval below %d jiffies",WATCH64_MINIMUM);
+ printk("watch64: attempted to add new watch with "
+ "interval below %d jiffies",WATCH64_MINIMUM);
} else
temp->interval = interval;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:2.898 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site