Skip to contentSkip to conversation

target/xtensa: make xtensa_modules static on import

PATCH In review Max Filippov 2 participants 2 messages Mar 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: make xtensa_modules static on import

xtensa_modules variable defined in each xtensa-modules.c.inc is only used locally by the including file. Make it static.

---
 target/xtensa/import_core.sh | 1 +
 1 file changed, 1 insertion(+)
target/xtensa/import_core.sh +1 -0
index f3404039cc20..53d3c4d099bb 100755
@@ -35,6 +35,7 @@ tar -xf "$OVERLAY" -O binutils/xtensa-modules.c | \
         -e '/^#include "ansidecl.h"/d' \
         -e '/^Slot_[a-zA-Z0-9_]\+_decode (const xtensa_insnbuf insn)/,/^}/s/^  return 0;$/  return XTENSA_UNDEFINED;/' \
         -e 's/#include <xtensa-isa.h>/#include "xtensa-isa.h"/' \
+        -e 's/^\(xtensa_isa_internal xtensa_modules\)/static \1/' \
     > "$TARGET"/xtensa-modules.c.inc
 
 cat <<EOF > "${TARGET}.c"
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Max Filippov

xtensa_modules variable defined in each xtensa-modules.c.inc is only used locally by the including file. Make it static.

Quoted 1 line
Quoted 17 lines
---
 target/xtensa/import_core.sh | 1 +
 1 file changed, 1 insertion(+)
target/xtensa/import_core.sh +1 -0
index f3404039cc20..53d3c4d099bb 100755
@@ -35,6 +35,7 @@ tar -xf "$OVERLAY" -O binutils/xtensa-modules.c | \
         -e '/^#include "ansidecl.h"/d' \
         -e '/^Slot_[a-zA-Z0-9_]\+_decode (const xtensa_insnbuf insn)/,/^}/s/^  return 0;$/  return XTENSA_UNDEFINED;/' \
         -e 's/#include <xtensa-isa.h>/#include "xtensa-isa.h"/' \
+        -e 's/^\(xtensa_isa_internal xtensa_modules\)/static \1/' \
     > "$TARGET"/xtensa-modules.c.inc
 
 cat <<EOF > "${TARGET}.c"