sched: Constify function scope static struct sched_param usage

Function-scope statics are discouraged because they are
easily overlooked and can cause subtle bugs/races due to
their global (non-SMP safe) nature.

Linus noticed that we did this for sched_param - at minimum
make the const.

Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: Message-ID: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
Peter Zijlstra 2011-01-07 13:41:40 +01:00 • committed by Ingo Molnar
commit c9b5f501ef
4 changed files with 4 additions and 4 deletions

View file

@ -853,7 +853,7 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb,
cpumask_any(cpu_online_mask));
case CPU_DEAD:
case CPU_DEAD_FROZEN: {
static struct sched_param param = {
static const struct sched_param param = {
.sched_priority = MAX_RT_PRIO-1
};