From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6412996865515436910==" MIME-Version: 1.0 From: Liang, Kan To: kbuild-all@lists.01.org Subject: Re: [peterz-queue:perf/core 26/39] arch/x86/include/asm/perf_event.h:290:19: error: flexible array member in a struct with no named members Date: Mon, 06 Jul 2020 21:08:41 -0400 Message-ID: <0f880910-7082-ecbb-11ba-1b0d05fd49db@linux.intel.com> In-Reply-To: <202007070345.ILUNskpS%lkp@intel.com> List-Id: --===============6412996865515436910== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable >>> arch/x86/include/asm/perf_event.h:290:19: error: flexible array member = in a struct with no named members > 290 | struct lbr_entry lbr[]; /* Variable length */ > | ^~~ > kernel/sched/rt.c:253:6: warning: no previous prototype for 'free_rt_= sched_group' [-Wmissing-prototypes] > 253 | void free_rt_sched_group(struct task_group *tg) { } > | ^~~~~~~~~~~~~~~~~~~ > kernel/sched/rt.c:255:5: warning: no previous prototype for 'alloc_rt= _sched_group' [-Wmissing-prototypes] > 255 | int alloc_rt_sched_group(struct task_group *tg, struct task_g= roup *parent) > | ^~~~~~~~~~~~~~~~~~~~ > kernel/sched/rt.c:668:6: warning: no previous prototype for 'sched_rt= _bandwidth_account' [-Wmissing-prototypes] > 668 | bool sched_rt_bandwidth_account(struct rt_rq *rt_rq) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > = > vim +290 arch/x86/include/asm/perf_event.h > = > 288 = > 289 struct pebs_lbr { > > 290 struct lbr_entry lbr[]; /* Variable length */ > 291 }; > 292 = > The struct pebs_lbr only has one member. To fix the warning, it seems we = have to define the struct as below. diff --git a/arch/x86/include/asm/perf_event.h = b/arch/x86/include/asm/perf_event.h index 2338200..a387e14 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h @@ -283,7 +283,7 @@ struct pebs_xmm { }; struct pebs_lbr { - struct lbr_entry lbr[]; /* Variable length */ + struct lbr_entry lbr[0]; /* Variable length */ }; Thanks, Kan --===============6412996865515436910==--