aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/genksyms/parse.y
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2014-04-03 14:46:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 16:20:52 -0700
commitdc53324060f324e8af6867f57bf4891c13c6ef18 (patch)
tree8cad63d6b8b31d945dae80f0c18f1c2cb4ad0949 /scripts/genksyms/parse.y
parentfanotify: move unrelated handling from copy_event_to_user() (diff)
downloadwireguard-linux-dc53324060f324e8af6867f57bf4891c13c6ef18.tar.xz
wireguard-linux-dc53324060f324e8af6867f57bf4891c13c6ef18.zip
genksyms: fix typeof() handling
Recent increased use of typeof() throughout the tree resulted in a number of symbols (25 in a typical distro config of ours) not getting a proper CRC calculated for them anymore, due to the parser in genksyms not coping with several of these uses (interestingly in the majority of [if not all] cases the problem is due to the use of typeof() in code preceding a certain export, not in the declaration/definition of the exported function/object itself; I wasn't able to find a way to address this more general parser shortcoming). The use of parameter_declaration is a little more relaxed than would be ideal (permitting not just a bare type specification, but also one with identifier), but since the same code is being passed through an actual compiler, there's no apparent risk of allowing through any broken code. Otoh using parameter_declaration instead of the ad hoc "decl_specifier_seq '*'" / "decl_specifier_seq" pair allows all types to be handled rather than just plain ones and pointers to plain ones. Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/genksyms/parse.y')
-rw-r--r--scripts/genksyms/parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index 23c39998ad86..b9f4cf202302 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -103,6 +103,7 @@ static void record_compound(struct string_list **keyw,
%token ASM_PHRASE
%token ATTRIBUTE_PHRASE
+%token TYPEOF_PHRASE
%token BRACE_PHRASE
%token BRACKET_PHRASE
%token EXPRESSION_PHRASE
@@ -220,8 +221,8 @@ storage_class_specifier:
type_specifier:
simple_type_specifier
| cvar_qualifier
- | TYPEOF_KEYW '(' decl_specifier_seq '*' ')'
- | TYPEOF_KEYW '(' decl_specifier_seq ')'
+ | TYPEOF_KEYW '(' parameter_declaration ')'
+ | TYPEOF_PHRASE
/* References to s/u/e's defined elsewhere. Rearrange things
so that it is easier to expand the definition fully later. */