aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/tools
diff options
context:
space:
mode:
authorCong Ding <dinggnu@gmail.com>2012-12-09 03:21:04 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2012-12-10 13:31:24 -0500
commit28a793892296ca3367193c7a7de1714f80049fd0 (patch)
treea9b304222f9224d9618949931358bacc16751770 /arch/x86/tools
parent29c574c0aba8dc0736e19eb9b24aad28cc5c9098 (diff)
x86: Fix the error of using "const" in gen-insn-attr-x86.awk
The original version code causes following sparse warnings: arch/x86/lib/inat-tables.c:1080:25: warning: duplicate const arch/x86/lib/inat-tables.c:1095:25: warning: duplicate const arch/x86/lib/inat-tables.c:1118:25: warning: duplicate const for the variables inat_escape_tables, inat_group_tables, and inat_avx_tables in the code generated by gen-insn-attr-x86.awk. The author Masami Hiramutsu says here is to make both the value pointed by the pointers and the pointers itself read-only, so we move the "const" to be after the "*". Signed-off-by: Cong Ding <dinggnu@gmail.com> Link: http://lkml.kernel.org/r/20121209082103.GA9181@gmail.com Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/tools')
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index ddcf39b1a18d..e6773dc8ac41 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -356,7 +356,7 @@ END {
356 exit 1 356 exit 1
357 # print escape opcode map's array 357 # print escape opcode map's array
358 print "/* Escape opcode map array */" 358 print "/* Escape opcode map array */"
359 print "const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1]" \ 359 print "const insn_attr_t * const inat_escape_tables[INAT_ESC_MAX + 1]" \
360 "[INAT_LSTPFX_MAX + 1] = {" 360 "[INAT_LSTPFX_MAX + 1] = {"
361 for (i = 0; i < geid; i++) 361 for (i = 0; i < geid; i++)
362 for (j = 0; j < max_lprefix; j++) 362 for (j = 0; j < max_lprefix; j++)
@@ -365,7 +365,7 @@ END {
365 print "};\n" 365 print "};\n"
366 # print group opcode map's array 366 # print group opcode map's array
367 print "/* Group opcode map array */" 367 print "/* Group opcode map array */"
368 print "const insn_attr_t const *inat_group_tables[INAT_GRP_MAX + 1]"\ 368 print "const insn_attr_t * const inat_group_tables[INAT_GRP_MAX + 1]"\
369 "[INAT_LSTPFX_MAX + 1] = {" 369 "[INAT_LSTPFX_MAX + 1] = {"
370 for (i = 0; i < ggid; i++) 370 for (i = 0; i < ggid; i++)
371 for (j = 0; j < max_lprefix; j++) 371 for (j = 0; j < max_lprefix; j++)
@@ -374,7 +374,7 @@ END {
374 print "};\n" 374 print "};\n"
375 # print AVX opcode map's array 375 # print AVX opcode map's array
376 print "/* AVX opcode map array */" 376 print "/* AVX opcode map array */"
377 print "const insn_attr_t const *inat_avx_tables[X86_VEX_M_MAX + 1]"\ 377 print "const insn_attr_t * const inat_avx_tables[X86_VEX_M_MAX + 1]"\
378 "[INAT_LSTPFX_MAX + 1] = {" 378 "[INAT_LSTPFX_MAX + 1] = {"
379 for (i = 0; i < gaid; i++) 379 for (i = 0; i < gaid; i++)
380 for (j = 0; j < max_lprefix; j++) 380 for (j = 0; j < max_lprefix; j++)