check_format: Fixes for shellcheck's SC2030 directive
SC2030: Modification of var is local (to subshell caused by pipeline)
This directive is raised since the for loop (or rather its contents)
is piped through to another process. In this context it's not harmful
since we are interested only in sending the stdout but since we operate
on variables that happen to be local to the process that handles the
loop shellcheck sees that as a potential issue. To make it happy
remove the pipe and sort pci addresses prior running the loop.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8501 (master)
(cherry picked from commit 8c176db2ca
)
Change-Id: I835c5ac1da9012129c5d01d62880307f70caab1b
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9834
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
93b2a5420a
commit
199f14e3fd
@ -579,7 +579,9 @@ function status_linux() {
|
||||
printf '\n%-8s %-15s %-6s %-6s %-7s %-16s %-10s %s\n' \
|
||||
"Type" "BDF" "Vendor" "Device" "NUMA" "Driver" "Device" "Block devices" >&2
|
||||
|
||||
for bdf in "${!all_devices_d[@]}"; do
|
||||
sorted_bdfs=($(printf '%s\n' "${!all_devices_d[@]}" | sort))
|
||||
|
||||
for bdf in "${sorted_bdfs[@]}"; do
|
||||
driver=${drivers_d["$bdf"]}
|
||||
if [ "$numa_nodes" = "0" ]; then
|
||||
node="-"
|
||||
@ -611,7 +613,7 @@ function status_linux() {
|
||||
printf '%-8s %-15s %-6s %-6s %-7s %-16s %-10s %s\n' \
|
||||
"$desc" "$bdf" "${pci_ids_vendor["$bdf"]#0x}" "${pci_ids_device["$bdf"]#0x}" \
|
||||
"$node" "${driver:--}" "${name:-}" "${blknames[*]:--}"
|
||||
done | sort -bk2,2
|
||||
done
|
||||
}
|
||||
|
||||
function status_freebsd() {
|
||||
|
Loading…
Reference in New Issue
Block a user