Skip to content

Commit eba9f08

Browse files
zhuguangqingingomolnar
authored andcommitted
sched: Replace zero-length array with flexible-array
In the following commit: 04f5c36: ("sched/fair: Replace zero-length array with flexible-array") a zero-length array cpumask[0] has been replaced with cpumask[]. But there is still a cpumask[0] in 'struct sched_group_capacity' which was missed. The point of using [] instead of [0] is that with [] the compiler will generate a build warning if it isn't the last member of a struct. [ mingo: Rewrote the changelog. ] Signed-off-by: zhuguangqing <zhuguangqing@xiaomi.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20201014140220.11384-1-zhuguangqing83@gmail.com
1 parent 2646fb0 commit eba9f08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/sched/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ struct sched_group_capacity {
14711471
int id;
14721472
#endif
14731473

1474-
unsigned long cpumask[0]; /* Balance mask */
1474+
unsigned long cpumask[]; /* Balance mask */
14751475
};
14761476

14771477
struct sched_group {

0 commit comments

Comments
 (0)