mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 00:55:48 -04:00
Running shellcheck on x86_arch_prctl.sh generates below warning:
In ./tools/perf/trace/beauty/x86_arch_prctl.sh line 10:
local idx=$1
^-------^ SC3043 (warning): In POSIX sh, 'local' is undefined.
In ./tools/perf/trace/beauty/x86_arch_prctl.sh line 11:
local prefix=$2
^----------^ SC3043 (warning): In POSIX sh, 'local' is undefined.
In ./tools/perf/trace/beauty/x86_arch_prctl.sh line 12:
local first_entry=$3
^---------------^ SC3043 (warning): In POSIX sh, 'local' is undefined.
Fix this by removing local since these are variables used only in
specific function
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230709182800.53002-21-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
28 lines
851 B
Bash
Executable File
28 lines
851 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
# SPDX-License-Identifier: LGPL-2.1
|
|
|
|
[ $# -eq 1 ] && x86_header_dir=$1 || x86_header_dir=tools/arch/x86/include/uapi/asm/
|
|
|
|
prctl_arch_header=${x86_header_dir}/prctl.h
|
|
|
|
print_range () {
|
|
idx=$1
|
|
prefix=$2
|
|
first_entry=$3
|
|
|
|
printf "#define x86_arch_prctl_codes_%d_offset %s\n" $idx $first_entry
|
|
printf "static const char *x86_arch_prctl_codes_%d[] = {\n" $idx
|
|
regex=`printf '^[[:space:]]*#[[:space:]]*define[[:space:]]+ARCH_([[:alnum:]_]+)[[:space:]]+(%s[[:xdigit:]]+).*' ${prefix}`
|
|
fmt="\t[%#x - ${first_entry}]= \"%s\",\n"
|
|
grep -E -q $regex ${prctl_arch_header} && \
|
|
(grep -E $regex ${prctl_arch_header} | \
|
|
sed -r "s/$regex/\2 \1/g" | \
|
|
xargs printf "$fmt")
|
|
printf "};\n\n"
|
|
}
|
|
|
|
print_range 1 0x1 0x1001
|
|
print_range 2 0x2 0x2001
|
|
print_range 3 0x4 0x4001
|