All helper functions in common/rc have underscore prefix except unload_module(). Add the prefix to it. Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> --- common/multipath-over-rdma | 4 ++-- common/rc | 2 +- tests/nvmeof-mp/rc | 12 ++++++------ tests/srp/rc | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index c1c2e7c..fb820d6 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -428,11 +428,11 @@ stop_soft_rdma() { echo "$i ..." rdma link del "${i}" || echo "Failed to remove ${i}" done - if ! unload_module rdma_rxe 10; then + if ! _unload_module rdma_rxe 10; then echo "Unloading rdma_rxe failed" return 1 fi - if ! unload_module siw 10; then + if ! _unload_module siw 10; then echo "Unloading siw failed" return 1 fi diff --git a/common/rc b/common/rc index be69a4d..738a32f 100644 --- a/common/rc +++ b/common/rc @@ -385,7 +385,7 @@ _uptime_s() { } # Arguments: module to unload ($1) and retry count ($2). -unload_module() { +_unload_module() { local i m=$1 rc=${2:-1} [ ! -e "/sys/module/$m" ] && return 0 diff --git a/tests/nvmeof-mp/rc b/tests/nvmeof-mp/rc index ed27b5c..4238a4c 100755 --- a/tests/nvmeof-mp/rc +++ b/tests/nvmeof-mp/rc @@ -162,12 +162,12 @@ start_nvme_client() { } stop_nvme_client() { - unload_module nvme-rdma || return $? - unload_module nvme-fabrics || return $? + _unload_module nvme-rdma || return $? + _unload_module nvme-fabrics || return $? # Ignore nvme and nvme-core unload errors - this test may be run on a # system equipped with one or more NVMe SSDs. - unload_module nvme >&/dev/null - unload_module nvme-core >&/dev/null + _unload_module nvme >&/dev/null + _unload_module nvme-core >&/dev/null return 0 } @@ -267,8 +267,8 @@ stop_nvme_target() { rmdir "$d" done ) - unload_module nvmet_rdma && - unload_module nvmet && + _unload_module nvmet_rdma && + _unload_module nvmet && _exit_null_blk } diff --git a/tests/srp/rc b/tests/srp/rc index 23f87e4..55b535a 100755 --- a/tests/srp/rc +++ b/tests/srp/rc @@ -325,14 +325,14 @@ stop_srp_ini() { log_out for ((i=40;i>=0;i--)); do remove_mpath_devs || return $? - unload_module ib_srp >/dev/null 2>&1 && break + _unload_module ib_srp >/dev/null 2>&1 && break sleep 1 done if [ -e /sys/module/ib_srp ]; then echo "Error: unloading kernel module ib_srp failed" return 1 fi - unload_module scsi_transport_srp || return $? + _unload_module scsi_transport_srp || return $? } # Associate the LIO device with name $1/$2 with file $3 and SCSI serial $4. @@ -491,7 +491,7 @@ start_lio_srpt() { if modinfo ib_srpt | grep -q '^parm:[[:blank:]]*rdma_cm_port:'; then opts+=("rdma_cm_port=${srp_rdma_cm_port}") fi - unload_module ib_srpt + _unload_module ib_srpt modprobe ib_srpt "${opts[@]}" || return $? i=0 for r in "${vdev_path[@]}"; do @@ -553,7 +553,7 @@ stop_lio_srpt() { target_core_file target_core_stgt target_core_user \ target_core_mod do - unload_module $m 10 || return $? + _unload_module $m 10 || return $? done } -- 2.37.1