From: Liang, Kan <kan.liang@linux.intel.com>
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 [thread overview]
Message-ID: <0f880910-7082-ecbb-11ba-1b0d05fd49db@linux.intel.com> (raw)
In-Reply-To: <202007070345.ILUNskpS%lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]
>>> 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_group *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
next prev parent reply other threads:[~2020-07-07 1:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 19:39 [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 kernel test robot
2020-07-07 1:08 ` Liang, Kan [this message]
2020-07-07 10:24 ` Peter Zijlstra
2020-07-07 13:51 ` Gustavo A. R. Silva
2020-07-07 14:44 ` Peter Zijlstra
2020-07-07 14:55 ` Liang, Kan
2020-07-07 14:50 ` Liang, Kan
2020-07-07 15:05 ` Gustavo A. R. Silva
2020-07-07 15:24 ` Liang, Kan
2020-07-07 17:09 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f880910-7082-ecbb-11ba-1b0d05fd49db@linux.intel.com \
--to=kan.liang@linux.intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.