summaryrefslogtreecommitdiffstats
path: root/misc-modules
diff options
context:
space:
mode:
Diffstat (limited to 'misc-modules')
-rw-r--r--misc-modules/jit.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/misc-modules/jit.c b/misc-modules/jit.c
index e9ff856..2216a4b 100644
--- a/misc-modules/jit.c
+++ b/misc-modules/jit.c
@@ -12,7 +12,7 @@
* by O'Reilly & Associates. No warranty is attached;
* we cannot take responsibility for errors or fitness for use.
*
- * $Id: jit.c,v 1.16 2004/09/26 07:02:43 gregkh Exp $
+ * jit.c,v 1.16 2004/09/26 07:02:43 gregkh Exp
*/
#include <linux/module.h>
@@ -61,27 +61,26 @@ int jit_fn_show(struct seq_file *m, void *v)
wait_queue_head_t wait;
long data = (long)m->private;
- init_waitqueue_head (&wait);
+ init_waitqueue_head(&wait);
j0 = jiffies;
j1 = j0 + delay;
switch (data) {
- case JIT_BUSY:
- while (time_before(jiffies, j1))
- cpu_relax();
- break;
- case JIT_SCHED:
- while (time_before(jiffies, j1)) {
- schedule();
- }
- break;
- case JIT_QUEUE:
- wait_event_interruptible_timeout(wait, 0, delay);
- break;
- case JIT_SCHEDTO:
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout (delay);
- break;
+ case JIT_BUSY:
+ while (time_before(jiffies, j1))
+ cpu_relax();
+ break;
+ case JIT_SCHED:
+ while (time_before(jiffies, j1))
+ schedule();
+ break;
+ case JIT_QUEUE:
+ wait_event_interruptible_timeout(wait, 0, delay);
+ break;
+ case JIT_SCHEDTO:
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(delay);
+ break;
}
j1 = jiffies; /* actual value after we delayed */
@@ -188,7 +187,7 @@ int jit_timer_show(struct seq_file *m, void *v)
init_waitqueue_head(&data->wait);
/* write the first lines in the buffer */
- seq_printf(m, " time delta inirq pid cpu command\n");
+ seq_puts(m, " time delta inirq pid cpu command\n");
seq_printf(m, "%9li %3li %i %6i %i %s\n",
j, 0L, in_interrupt() ? 1 : 0,
current->pid, smp_processor_id(), current->comm);
@@ -197,7 +196,7 @@ int jit_timer_show(struct seq_file *m, void *v)
data->prevjiffies = j;
data->m = m;
data->loops = JIT_ASYNC_LOOPS;
-
+
/* register the timer */
data->timer.data = (unsigned long)data;
data->timer.function = jit_timer_fn;
@@ -254,10 +253,10 @@ int jit_tasklet_show(struct seq_file *m, void *v)
if (!data)
return -ENOMEM;
- init_waitqueue_head (&data->wait);
+ init_waitqueue_head(&data->wait);
/* write the first lines in the buffer */
- seq_printf(m, " time delta inirq pid cpu command\n");
+ seq_puts(m, " time delta inirq pid cpu command\n");
seq_printf(m, "%9li %3li %i %6i %i %s\n",
j, 0L, in_interrupt() ? 1 : 0,
current->pid, smp_processor_id(), current->comm);
@@ -266,7 +265,7 @@ int jit_tasklet_show(struct seq_file *m, void *v)
data->prevjiffies = j;
data->m = m;
data->loops = JIT_ASYNC_LOOPS;
-
+
/* register the tasklet */
tasklet_init(&data->tlet, jit_tasklet_fn, (unsigned long)data);
data->hi = hi;
@@ -300,9 +299,10 @@ int __init jit_init(void)
{
proc_create_data("currentime", 0, NULL, &jit_currentime_fops, NULL);
proc_create_data("jitbusy", 0, NULL, &jit_fn_fops, (void *)JIT_BUSY);
- proc_create_data("jitsched",0, NULL, &jit_fn_fops, (void *)JIT_SCHED);
- proc_create_data("jitqueue",0, NULL, &jit_fn_fops, (void *)JIT_QUEUE);
- proc_create_data("jitschedto", 0, NULL, &jit_fn_fops, (void *)JIT_SCHEDTO);
+ proc_create_data("jitsched", 0, NULL, &jit_fn_fops, (void *)JIT_SCHED);
+ proc_create_data("jitqueue", 0, NULL, &jit_fn_fops, (void *)JIT_QUEUE);
+ proc_create_data("jitschedto", 0, NULL, &jit_fn_fops,
+ (void *)JIT_SCHEDTO);
proc_create_data("jitimer", 0, NULL, &jit_timer_fops, NULL);
proc_create_data("jitasklet", 0, NULL, &jit_tasklet_fops, NULL);