5.4 compile error fix: ISO C90 forbids mixed declarations and code

This commit is contained in:
Masahito S 2024-11-21 01:22:46 +09:00 committed by Ksawlii
parent 30aca2aa4e
commit 0769637133

View file

@ -142,14 +142,17 @@ static inline u64 scale_slice(u64 delta, struct sched_entity *se) {
static inline struct task_struct *task_of(struct sched_entity *se); static inline struct task_struct *task_of(struct sched_entity *se);
static void update_burst_score(struct sched_entity *se) { static void update_burst_score(struct sched_entity *se) {
struct task_struct *p;
u8 prio, prev_prio, new_prio;
if (!entity_is_task(se)) return; if (!entity_is_task(se)) return;
struct task_struct *p = task_of(se); p = task_of(se);
u8 prio = p->static_prio - MAX_RT_PRIO; prio = p->static_prio - MAX_RT_PRIO;
u8 prev_prio = min(39, prio + se->burst_score); prev_prio = min(39, prio + se->burst_score);
se->burst_score = se->burst_penalty >> 2; se->burst_score = se->burst_penalty >> 2;
u8 new_prio = min(39, prio + se->burst_score); new_prio = min(39, prio + se->burst_score);
if (new_prio != prev_prio) if (new_prio != prev_prio)
reweight_task(p, new_prio); reweight_task(p, new_prio);
} }