[PATCH] x86/insn: make unexported tables static

Ben Dooks posted 1 patch 1 month ago
arch/x86/tools/gen-insn-attr-x86.awk       | 2 +-
tools/arch/x86/tools/gen-insn-attr-x86.awk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH] x86/insn: make unexported tables static
Posted by Ben Dooks 1 month ago
None of the insn_attr_t tables outside of the main arrays
are exported to anything else by name. These are causing
a lot of warnings, so make them static.

Fixes some of the following sparse warnings:
arch/x86/lib/inat-tables.c:233:19: warning: symbol 'inat_escape_table_1' was not declared. Should it be static?
arch/x86/lib/inat-tables.c:457:19: warning: symbol 'inat_escape_table_1_1' was not declared. Should it be static?
arch/x86/lib/inat-tables.c:585:19: warning: symbol 'inat_escape_table_1_2' was not declared. Should it be static?
arch/x86/lib/inat-tables.c:621:19: warning: symbol 'inat_escape_table_1_3' was not declared. Should it be static?
arch/x86/lib/inat-tables.c:659:19: warning: symbol 'inat_escape_table_2' was not declared. Should it be static?
...

Fixes: eb13296cfaf6c6995 ("x86: Instruction decoder API")
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/x86/tools/gen-insn-attr-x86.awk       | 2 +-
 tools/arch/x86/tools/gen-insn-attr-x86.awk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index 7ea1b75e59b7..c4319f170f2b 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -188,7 +188,7 @@ function array_size(arr,   i,c) {
 
 function print_table(tbl,name,fmt,n)
 {
-	print "const insn_attr_t " name " = {"
+	print "static const insn_attr_t " name " = {"
 	for (i = 0; i < n; i++) {
 		id = sprintf(fmt, i)
 		if (tbl[id])
diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
index 7ea1b75e59b7..c4319f170f2b 100644
--- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
@@ -188,7 +188,7 @@ function array_size(arr,   i,c) {
 
 function print_table(tbl,name,fmt,n)
 {
-	print "const insn_attr_t " name " = {"
+	print "static const insn_attr_t " name " = {"
 	for (i = 0; i < n; i++) {
 		id = sprintf(fmt, i)
 		if (tbl[id])
-- 
2.37.2.352.g3c44437643