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> Change-Id: I835c5ac1da9012129c5d01d62880307f70caab1b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8501 Community-CI: Mellanox Build Bot Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
36f5f0df17
commit
8c176db2ca
@ -581,7 +581,9 @@ function status_linux() {
|
|||||||
printf '\n%-8s %-15s %-6s %-6s %-7s %-16s %-10s %s\n' \
|
printf '\n%-8s %-15s %-6s %-6s %-7s %-16s %-10s %s\n' \
|
||||||
"Type" "BDF" "Vendor" "Device" "NUMA" "Driver" "Device" "Block devices" >&2
|
"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"]}
|
driver=${drivers_d["$bdf"]}
|
||||||
if [ "$numa_nodes" = "0" ]; then
|
if [ "$numa_nodes" = "0" ]; then
|
||||||
node="-"
|
node="-"
|
||||||
@ -613,7 +615,7 @@ function status_linux() {
|
|||||||
printf '%-8s %-15s %-6s %-6s %-7s %-16s %-10s %s\n' \
|
printf '%-8s %-15s %-6s %-6s %-7s %-16s %-10s %s\n' \
|
||||||
"$desc" "$bdf" "${pci_ids_vendor["$bdf"]#0x}" "${pci_ids_device["$bdf"]#0x}" \
|
"$desc" "$bdf" "${pci_ids_vendor["$bdf"]#0x}" "${pci_ids_device["$bdf"]#0x}" \
|
||||||
"$node" "${driver:--}" "${name:-}" "${blknames[*]:--}"
|
"$node" "${driver:--}" "${name:-}" "${blknames[*]:--}"
|
||||||
done | sort -bk2,2
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function status_freebsd() {
|
function status_freebsd() {
|
||||||
|
Loading…
Reference in New Issue
Block a user