perf beauty arch_errno_names: Fix shellcheck issue about local variables
authorKajol Jain <kjain@linux.ibm.com>
Sun, 9 Jul 2023 18:27:48 +0000 (23:57 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 3 Aug 2023 20:01:26 +0000 (17:01 -0300)
commitf188b2ce65730178f8dc0d105beb759719a12e6c
tree29715d6b39e61030901f5880ec26aef6688b6bff
parent05ef238cd05db7b3b2e596027c403964de1d3919
perf beauty arch_errno_names: Fix shellcheck issue about local variables

Running shellcheck on arch_errno_names.sh generates below warning:

In arch_errno_names.sh line 20:
local arch="$1"
        ^--------^ SC3043 (warning): In POSIX sh, 'local' is undefined.

......

In arch_errno_names.sh line 61:
local arch
        ^--------^ SC3043 (warning): In POSIX sh, 'local' is undefined.

In arch_errno_names.sh line 67:
printf '\t\treturn errno_to_name__%s(err);\n' $(arch_string "$arch")
                                                              ^--------------------^ SC2046 (warning): Quote this to prevent word splitting.

In arch_errno_names.sh line 69:
printf '\treturn errno_to_name__%s(err);\n' $(arch_string "$default")
                                                    ^-----------------------^ SC2046 (warning): Quote this to prevent word splitting.

Fixed the warnings by:
- Fixing shellcheck warnings for local usage, by removing
  local from the variable names
- Adding quotes to avoid word splitting

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
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-15-atrajeev@linux.vnet.ibm.com
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/trace/beauty/arch_errno_names.sh