Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched: Clean up and standardize #if/#else/#endif markers in sched/rt.c

- Use the standard #ifdef marker format for larger blocks,
where appropriate:

#if CONFIG_FOO
...
#else /* !CONFIG_FOO: */
...
#endif /* !CONFIG_FOO */

- Fix whitespace noise and other inconsistencies.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20250528080924.2273858-15-mingo@kernel.org

+27 -27
+27 -27
kernel/sched/rt.c
··· 63 63 return 0; 64 64 } 65 65 late_initcall(sched_rt_sysctl_init); 66 - #endif 66 + #endif /* CONFIG_SYSCTL */ 67 67 68 68 void init_rt_rq(struct rt_rq *rt_rq) 69 69 { ··· 294 294 return 0; 295 295 } 296 296 297 - #else /* CONFIG_RT_GROUP_SCHED */ 297 + #else /* !CONFIG_RT_GROUP_SCHED: */ 298 298 299 299 #define rt_entity_is_task(rt_se) (1) 300 300 ··· 330 330 { 331 331 return 1; 332 332 } 333 - #endif /* CONFIG_RT_GROUP_SCHED */ 333 + #endif /* !CONFIG_RT_GROUP_SCHED */ 334 334 335 335 #ifdef CONFIG_SMP 336 336 ··· 433 433 } 434 434 } 435 435 436 - #else 436 + #else /* !CONFIG_SMP: */ 437 437 438 438 static inline void enqueue_pushable_task(struct rq *rq, struct task_struct *p) 439 439 { ··· 446 446 static inline void rt_queue_push_tasks(struct rq *rq) 447 447 { 448 448 } 449 - #endif /* CONFIG_SMP */ 449 + #endif /* !CONFIG_SMP */ 450 450 451 451 static void enqueue_top_rt_rq(struct rt_rq *rt_rq); 452 452 static void dequeue_top_rt_rq(struct rt_rq *rt_rq, unsigned int count); ··· 488 488 489 489 return cpu_cap >= min(min_cap, max_cap); 490 490 } 491 - #else 491 + #else /* !CONFIG_UCLAMP_TASK: */ 492 492 static inline bool rt_task_fits_capacity(struct task_struct *p, int cpu) 493 493 { 494 494 return true; 495 495 } 496 - #endif 496 + #endif /* !CONFIG_UCLAMP_TASK */ 497 497 498 498 #ifdef CONFIG_RT_GROUP_SCHED 499 499 ··· 801 801 raw_spin_lock(&rt_rq->rt_runtime_lock); 802 802 } 803 803 } 804 - #else /* !CONFIG_SMP */ 804 + #else /* !CONFIG_SMP: */ 805 805 static inline void balance_runtime(struct rt_rq *rt_rq) {} 806 - #endif /* CONFIG_SMP */ 806 + #endif /* !CONFIG_SMP */ 807 807 808 808 static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun) 809 809 { ··· 933 933 return 0; 934 934 } 935 935 936 - #else /* !CONFIG_RT_GROUP_SCHED */ 936 + #else /* !CONFIG_RT_GROUP_SCHED: */ 937 937 938 938 typedef struct rt_rq *rt_rq_iter_t; 939 939 ··· 985 985 static void __disable_runtime(struct rq *rq) { } 986 986 #endif 987 987 988 - #endif /* CONFIG_RT_GROUP_SCHED */ 988 + #endif /* !CONFIG_RT_GROUP_SCHED */ 989 989 990 990 static inline int rt_se_prio(struct sched_rt_entity *rt_se) 991 991 { ··· 1036 1036 do_start_rt_bandwidth(sched_rt_bandwidth(rt_rq)); 1037 1037 } 1038 1038 } 1039 - #endif 1039 + #endif /* CONFIG_RT_GROUP_SCHED */ 1040 1040 } 1041 1041 1042 1042 static void ··· 1110 1110 cpupri_set(&rq->rd->cpupri, rq->cpu, rt_rq->highest_prio.curr); 1111 1111 } 1112 1112 1113 - #else /* CONFIG_SMP */ 1113 + #else /* !CONFIG_SMP: */ 1114 1114 1115 1115 static inline 1116 1116 void inc_rt_prio_smp(struct rt_rq *rt_rq, int prio, int prev_prio) {} 1117 1117 static inline 1118 1118 void dec_rt_prio_smp(struct rt_rq *rt_rq, int prio, int prev_prio) {} 1119 1119 1120 - #endif /* CONFIG_SMP */ 1120 + #endif /* !CONFIG_SMP */ 1121 1121 1122 1122 #if defined CONFIG_SMP || defined CONFIG_RT_GROUP_SCHED 1123 1123 static void ··· 1158 1158 dec_rt_prio_smp(rt_rq, prio, prev_prio); 1159 1159 } 1160 1160 1161 - #else 1161 + #else /* !(CONFIG_SMP || CONFIG_RT_GROUP_SCHED): */ 1162 1162 1163 1163 static inline void inc_rt_prio(struct rt_rq *rt_rq, int prio) {} 1164 1164 static inline void dec_rt_prio(struct rt_rq *rt_rq, int prio) {} 1165 1165 1166 - #endif /* CONFIG_SMP || CONFIG_RT_GROUP_SCHED */ 1166 + #endif /* !(CONFIG_SMP || CONFIG_RT_GROUP_SCHED) */ 1167 1167 1168 1168 #ifdef CONFIG_RT_GROUP_SCHED 1169 1169 ··· 1185 1185 WARN_ON(!rt_rq->rt_nr_running && rt_rq->rt_nr_boosted); 1186 1186 } 1187 1187 1188 - #else /* CONFIG_RT_GROUP_SCHED */ 1188 + #else /* !CONFIG_RT_GROUP_SCHED: */ 1189 1189 1190 1190 static void 1191 1191 inc_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) ··· 1195 1195 static inline 1196 1196 void dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) {} 1197 1197 1198 - #endif /* CONFIG_RT_GROUP_SCHED */ 1198 + #endif /* !CONFIG_RT_GROUP_SCHED */ 1199 1199 1200 1200 static inline 1201 1201 unsigned int rt_se_nr_running(struct sched_rt_entity *rt_se) ··· 1685 1685 */ 1686 1686 if (p->prio == donor->prio && !test_tsk_need_resched(rq->curr)) 1687 1687 check_preempt_equal_prio(rq, p); 1688 - #endif 1688 + #endif /* CONFIG_SMP */ 1689 1689 } 1690 1690 1691 1691 static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool first) ··· 2512 2512 */ 2513 2513 if (p->prio > rq->rt.highest_prio.curr) 2514 2514 resched_curr(rq); 2515 - #else 2515 + #else /* !CONFIG_SMP: */ 2516 2516 /* For UP simply resched on drop of prio */ 2517 2517 if (oldprio < p->prio) 2518 2518 resched_curr(rq); 2519 - #endif /* CONFIG_SMP */ 2519 + #endif /* !CONFIG_SMP */ 2520 2520 } else { 2521 2521 /* 2522 2522 * This task is not running, but if it is ··· 2552 2552 } 2553 2553 } 2554 2554 } 2555 - #else 2555 + #else /* !CONFIG_POSIX_TIMERS: */ 2556 2556 static inline void watchdog(struct rq *rq, struct task_struct *p) { } 2557 - #endif 2557 + #endif /* !CONFIG_POSIX_TIMERS */ 2558 2558 2559 2559 /* 2560 2560 * scheduler tick hitting a task of our scheduling class. ··· 2623 2623 2624 2624 return rt_rq_throttled(rt_rq); 2625 2625 } 2626 - #endif 2626 + #endif /* CONFIG_SCHED_CORE */ 2627 2627 2628 2628 DEFINE_SCHED_CLASS(rt) = { 2629 2629 ··· 2646 2646 .task_woken = task_woken_rt, 2647 2647 .switched_from = switched_from_rt, 2648 2648 .find_lock_rq = find_lock_lowest_rq, 2649 - #endif 2649 + #endif /* !CONFIG_SMP */ 2650 2650 2651 2651 .task_tick = task_tick_rt, 2652 2652 ··· 2890 2890 return 1; 2891 2891 } 2892 2892 2893 - #else /* !CONFIG_RT_GROUP_SCHED */ 2893 + #else /* !CONFIG_RT_GROUP_SCHED: */ 2894 2894 2895 2895 #ifdef CONFIG_SYSCTL 2896 2896 static int sched_rt_global_constraints(void) ··· 2898 2898 return 0; 2899 2899 } 2900 2900 #endif /* CONFIG_SYSCTL */ 2901 - #endif /* CONFIG_RT_GROUP_SCHED */ 2901 + #endif /* !CONFIG_RT_GROUP_SCHED */ 2902 2902 2903 2903 #ifdef CONFIG_SYSCTL 2904 2904 static int sched_rt_global_validate(void)