Skip to content

Commit

Permalink
sched: Replace zero-length array with flexible-array
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zhuguangqing authored and Ingo Molnar committed Oct 14, 2020
1 parent 2646fb0 commit eba9f08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ struct sched_group_capacity {
int id;
#endif

unsigned long cpumask[0]; /* Balance mask */
unsigned long cpumask[]; /* Balance mask */
};

struct sched_group {
Expand Down

0 comments on commit eba9f08

Please sign in to comment.