git: 2ae8976a3f6a - main - ocs_fc: return correct error code from ocs_hw_set_persistent_topology()

Gleb Smirnoff <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7658e3.27bfb.1d5229ad__25270.7078166836$1786140916$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ae8976a3f6a7e4deb1905326145f5c2575264f4

commit 2ae8976a3f6a7e4deb1905326145f5c2575264f4
Author:     Gleb Smirnoff <[email protected]>
AuthorDate: 2026-08-07 20:46:22 +0000
Commit:     Gleb Smirnoff <[email protected]>
CommitDate: 2026-08-07 22:14:53 +0000

    ocs_fc: return correct error code from ocs_hw_set_persistent_topology()
    
    No functional change, as current callers either don't check the return
    value or check it against OCS_HW_RTN_SUCCESS only.
    
    Found with:     clang -Werror=assign-enum
---
 sys/dev/ocs_fc/ocs_hw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c
index 62ef3cd49be3..f4935db8f321 100644
--- a/sys/dev/ocs_fc/ocs_hw.c
+++ b/sys/dev/ocs_fc/ocs_hw.c
@@ -12209,7 +12209,7 @@ ocs_hw_set_persistent_topology(ocs_hw_t *hw, uint32_t topology, uint32_t opts)
 
 	default:
 		ocs_log_err(hw->os, "unsupported topology %#x\n", topology);
-		return -1;
+		return OCS_HW_RTN_ERROR;
 	}
 
 	ocs_sem_init(&request.semaphore, 0, "set_persistent_topo");
@@ -12235,12 +12235,12 @@ ocs_hw_set_persistent_topology(ocs_hw_t *hw, uint32_t topology, uint32_t opts)
 
 		if (ocs_sem_p(&request.semaphore, OCS_SEM_FOREVER)) {
 			ocs_log_err(hw->os, "ocs_sem_p failed\n");
-			return -ENXIO;
+			return OCS_HW_RTN_ERROR;
 		}
 
 		if (request.status) {
 			ocs_log_err(hw->os, "set persistent topology failed; status: %d\n", request.status);
-			return -EFAULT;
+			return OCS_HW_RTN_ERROR;
 		}
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.