[sched.h 2/8] nuke CT_TO_SECS() and CT_TO_USECS()

From: William Lee Irwin III
Date: Fri Sep 24 2004 - 21:55:35 EST


On Fri, Sep 24, 2004 at 07:49:17PM -0700, William Lee Irwin III wrote:
> Remove itimer_next and itimer_ticks; they are nowhere defined and
> referenced nowhere else.

CT_TO_SECS() and CT_TO_USECS() are used where jiffies_to_timeval()
should be; this patch teaches their sole caller to use that instead and
by so doing removes them from the kernel entirely.


Index: mm3-2.6.9-rc2/arch/mips/kernel/irixelf.c
===================================================================
--- mm3-2.6.9-rc2.orig/arch/mips/kernel/irixelf.c 2004-09-12 22:33:39.000000000 -0700
+++ mm3-2.6.9-rc2/arch/mips/kernel/irixelf.c 2004-09-24 18:45:21.055503104 -0700
@@ -29,6 +29,7 @@
#include <linux/personality.h>
#include <linux/elfcore.h>
#include <linux/smp_lock.h>
+#include <linux/jiffies.h>

#include <asm/uaccess.h>
#include <asm/mipsregs.h>
@@ -1131,14 +1132,10 @@
psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid;
psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current);
psinfo.pr_sid = prstatus.pr_sid = current->signal->session;
- prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime);
- prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime);
- prstatus.pr_stime.tv_sec = CT_TO_SECS(current->stime);
- prstatus.pr_stime.tv_usec = CT_TO_USECS(current->stime);
- prstatus.pr_cutime.tv_sec = CT_TO_SECS(current->cutime);
- prstatus.pr_cutime.tv_usec = CT_TO_USECS(current->cutime);
- prstatus.pr_cstime.tv_sec = CT_TO_SECS(current->cstime);
- prstatus.pr_cstime.tv_usec = CT_TO_USECS(current->cstime);
+ jiffies_to_timeval(current->utime, &prstatus.pr_utime);
+ jiffies_to_timeval(current->stime, &prstatus.pr_stime);
+ jiffies_to_timeval(current->cutime, &prstatus.pr_cutime);
+ jiffies_to_timeval(current->cstime, &prstatus.pr_cstime);
if (sizeof(elf_gregset_t) != sizeof(struct pt_regs)) {
printk("sizeof(elf_gregset_t) (%d) != sizeof(struct pt_regs) "
"(%d)\n", sizeof(elf_gregset_t), sizeof(struct pt_regs));
Index: mm3-2.6.9-rc2/include/linux/sched.h
===================================================================
--- mm3-2.6.9-rc2.orig/include/linux/sched.h 2004-09-24 18:38:02.935107528 -0700
+++ mm3-2.6.9-rc2/include/linux/sched.h 2004-09-24 18:45:29.052287408 -0700
@@ -85,9 +85,6 @@
load += n*(FIXED_1-exp); \
load >>= FSHIFT;

-#define CT_TO_SECS(x) ((x) / HZ)
-#define CT_TO_USECS(x) (((x) % HZ) * 1000000/HZ)
-
extern int nr_threads;
extern int last_pid;
DECLARE_PER_CPU(unsigned long, process_counts);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/