setup.sh: remove usless '= "0"' part from if statements
Bash interprets everything after command as additional function arguments. To not confuse user just remove this part and replace by '!'. Change-Id: I44228003a1f96324271e726df4f5033f3258523c Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/442976 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447143 Tested-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
898bad7d0c
commit
d3dbb9c7cf
@ -75,16 +75,15 @@ function check_for_driver {
|
|||||||
function pci_can_bind() {
|
function pci_can_bind() {
|
||||||
if [[ ${#PCI_WHITELIST[@]} == 0 ]]; then
|
if [[ ${#PCI_WHITELIST[@]} == 0 ]]; then
|
||||||
#no whitelist specified, bind all devices
|
#no whitelist specified, bind all devices
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in ${PCI_WHITELIST[@]}
|
for i in ${PCI_WHITELIST[@]}; do
|
||||||
do
|
|
||||||
if [ "$i" == "$1" ] ; then
|
if [ "$i" == "$1" ] ; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
return 0
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function linux_bind_driver() {
|
function linux_bind_driver() {
|
||||||
@ -182,7 +181,7 @@ function configure_linux_pci {
|
|||||||
for bdf in $(iter_pci_class_code 01 08 02); do
|
for bdf in $(iter_pci_class_code 01 08 02); do
|
||||||
blkname=''
|
blkname=''
|
||||||
get_nvme_name_from_bdf "$bdf" blkname
|
get_nvme_name_from_bdf "$bdf" blkname
|
||||||
if pci_can_bind $bdf == "0" ; then
|
if ! pci_can_bind $bdf; then
|
||||||
echo "Skipping un-whitelisted NVMe controller $blkname ($bdf)"
|
echo "Skipping un-whitelisted NVMe controller $blkname ($bdf)"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -206,7 +205,7 @@ function configure_linux_pci {
|
|||||||
|
|
||||||
for dev_id in `cat $TMP`; do
|
for dev_id in `cat $TMP`; do
|
||||||
for bdf in $(iter_pci_dev_id 8086 $dev_id); do
|
for bdf in $(iter_pci_dev_id 8086 $dev_id); do
|
||||||
if pci_can_bind $bdf == "0" ; then
|
if ! pci_can_bind $bdf; then
|
||||||
echo "Skipping un-whitelisted I/OAT device at $bdf"
|
echo "Skipping un-whitelisted I/OAT device at $bdf"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -224,7 +223,7 @@ function configure_linux_pci {
|
|||||||
|
|
||||||
for dev_id in `cat $TMP`; do
|
for dev_id in `cat $TMP`; do
|
||||||
for bdf in $(iter_pci_dev_id 1af4 $dev_id); do
|
for bdf in $(iter_pci_dev_id 1af4 $dev_id); do
|
||||||
if pci_can_bind $bdf == "0" ; then
|
if ! pci_can_bind $bdf; then
|
||||||
echo "Skipping un-whitelisted Virtio device at $bdf"
|
echo "Skipping un-whitelisted Virtio device at $bdf"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -362,7 +361,7 @@ function reset_linux_pci {
|
|||||||
driver_loaded=$?
|
driver_loaded=$?
|
||||||
set -e
|
set -e
|
||||||
for bdf in $(iter_pci_class_code 01 08 02); do
|
for bdf in $(iter_pci_class_code 01 08 02); do
|
||||||
if pci_can_bind $bdf == "0" ; then
|
if ! pci_can_bind $bdf; then
|
||||||
echo "Skipping un-whitelisted NVMe controller $blkname ($bdf)"
|
echo "Skipping un-whitelisted NVMe controller $blkname ($bdf)"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -385,7 +384,7 @@ function reset_linux_pci {
|
|||||||
set -e
|
set -e
|
||||||
for dev_id in `cat $TMP`; do
|
for dev_id in `cat $TMP`; do
|
||||||
for bdf in $(iter_pci_dev_id 8086 $dev_id); do
|
for bdf in $(iter_pci_dev_id 8086 $dev_id); do
|
||||||
if pci_can_bind $bdf == "0" ; then
|
if ! pci_can_bind $bdf; then
|
||||||
echo "Skipping un-whitelisted I/OAT device at $bdf"
|
echo "Skipping un-whitelisted I/OAT device at $bdf"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@ -411,7 +410,7 @@ function reset_linux_pci {
|
|||||||
modprobe virtio-pci || true
|
modprobe virtio-pci || true
|
||||||
for dev_id in `cat $TMP`; do
|
for dev_id in `cat $TMP`; do
|
||||||
for bdf in $(iter_pci_dev_id 1af4 $dev_id); do
|
for bdf in $(iter_pci_dev_id 1af4 $dev_id); do
|
||||||
if pci_can_bind $bdf == "0" ; then
|
if ! pci_can_bind $bdf; then
|
||||||
echo "Skipping un-whitelisted Virtio device at $bdf"
|
echo "Skipping un-whitelisted Virtio device at $bdf"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user