Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Aug 2026 22:14:59 +0000
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2ae8976a3f6a - main - ocs_fc: return correct error code from ocs_hw_set_persistent_topology()
Message-ID:  <6a7658e3.27bfb.1d5229ad@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by glebius:

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

commit 2ae8976a3f6a7e4deb1905326145f5c2575264f4
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-08-07 20:46:22 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
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;
 		}
 	}
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a7658e3.27bfb.1d5229ad>