Skip to content

Commit ce2f5fe

Browse files
Nicholas Mc GuireIngo Molnar
authored andcommitted
sched/core: Remove unnecessary down/up conversion
'rt_period_us' is automatically type converted from u64 to long and then cast back to u64 - this down/up conversion is unnecessary and can be removed to improve readability. This will also help us not truncate 'rt_period_us' to 32 bits on 32-bit kernels, should we ever have so large values. (unlikely, not the least due to procfs.) Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@alien8.de> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1430643116-24049-1-git-send-email-hofrat@osadl.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent e7cc417 commit ce2f5fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7738,11 +7738,11 @@ static long sched_group_rt_runtime(struct task_group *tg)
77387738
return rt_runtime_us;
77397739
}
77407740

7741-
static int sched_group_set_rt_period(struct task_group *tg, long rt_period_us)
7741+
static int sched_group_set_rt_period(struct task_group *tg, u64 rt_period_us)
77427742
{
77437743
u64 rt_runtime, rt_period;
77447744

7745-
rt_period = (u64)rt_period_us * NSEC_PER_USEC;
7745+
rt_period = rt_period_us * NSEC_PER_USEC;
77467746
rt_runtime = tg->rt_bandwidth.rt_runtime;
77477747

77487748
return tg_set_rt_bandwidth(tg, rt_period, rt_runtime);

0 commit comments

Comments
 (0)