[PATCH 1/2] sched: Remove macro of NS_TO_JIFFIES in kernel/sched/sched.h.

From: Dongsheng Yang
Date: Tue May 06 2014 - 05:52:15 EST


As there is already a implementation in linux/jiffies.h to convert
a nsec to jiffies, so we can use it here rather than reimplement
it in sched.h.

Signed-off-by: Dongsheng Yang <yangds.fnst@xxxxxxxxxxxxxx>
---
kernel/sched/fair.c | 2 +-
kernel/sched/sched.h | 6 +-----
2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 43232b8..448ac443 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7636,7 +7636,7 @@ static unsigned int get_rr_interval_fair(struct rq *rq, struct task_struct *task
* idle runqueue:
*/
if (rq->cfs.load.weight)
- rr_interval = NS_TO_JIFFIES(sched_slice(cfs_rq_of(se), se));
+ rr_interval = nsecs_to_jiffies(sched_slice(cfs_rq_of(se), se));

return rr_interval;
}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 3563c81..bbc7e07 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -8,6 +8,7 @@
#include <linux/stop_machine.h>
#include <linux/tick.h>
#include <linux/slab.h>
+#include <linux/jiffies.h>

#include "cpupri.h"
#include "cpudeadline.h"
@@ -24,11 +25,6 @@ extern long calc_load_fold_active(struct rq *this_rq);
extern void update_cpu_load_active(struct rq *this_rq);

/*
- * Helpers for converting nanosecond timing to jiffy resolution
- */
-#define NS_TO_JIFFIES(TIME) ((unsigned long)(TIME) / (NSEC_PER_SEC / HZ))
-
-/*
* Increase resolution of nice-level calculations for 64-bit architectures.
* The extra resolution improves shares distribution and load balancing of
* low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup
--
1.8.2.1

--
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/