[PATCH 03/17] genksyms: reduce type_qualifier directly to decl_specifier

Masahiro Yamada posted 17 patches 11 months, 1 week ago
[PATCH 03/17] genksyms: reduce type_qualifier directly to decl_specifier
Posted by Masahiro Yamada 11 months, 1 week ago
A type_qualifier (const, volatile, etc.) is not a type_specifier.

According to K&R [1], a type-qualifier should be directly reduced to
a declaration-specifier.

  <declaration-specifier> ::= <storage-class-specifier>
                            | <type-specifier>
                            | <type-qualifier>

[1]: https://cs.wmich.edu/~gupta/teaching/cs4850/sumII06/The%20syntax%20of%20C%20in%20Backus-Naur%20form.htm

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/genksyms/parse.y | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index 8f62b9f0d99c..20cb3db7f149 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -211,6 +211,7 @@ decl_specifier:
 		  $$ = $1;
 		}
 	| type_specifier
+	| type_qualifier
 	;
 
 storage_class_specifier:
@@ -223,7 +224,6 @@ storage_class_specifier:
 
 type_specifier:
 	simple_type_specifier
-	| type_qualifier
 	| TYPEOF_KEYW '(' parameter_declaration ')'
 	| TYPEOF_PHRASE
 
-- 
2.43.0