[PATCH 2/5] srp_daemon: Move the pkey_index_to_pkey() definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxx>
---
 srp_daemon/srp_daemon.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index 6356e1373f9a..08d1134dca7d 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -793,6 +793,24 @@ static int check_sm_cap(struct umad_resources *umad_res, int *mask_match)
 	return 0;
 }
 
+int pkey_index_to_pkey(struct umad_resources *umad_res, int pkey_index,
+		       uint16_t *pkey)
+{
+	char pkey_file[18], pkey_str[16];
+
+	/* Read pkey */
+	snprintf(pkey_file, sizeof(pkey_file), "pkeys/%d", pkey_index);
+	if (srpd_sys_read_string(umad_res->port_sysfs_path, pkey_file,
+				 pkey_str, sizeof(pkey_str)) < 0)
+		return -1;
+
+	*pkey = strtoul(pkey_str, NULL, 0);
+	if (*pkey)
+		pr_debug("discover Targets for P_key %04x (index %d)\n",
+			 *pkey, pkey_index);
+	return 0;
+}
+
 static int set_class_port_info(struct umad_resources *umad_res, uint16_t dlid)
 {
 	struct srp_ib_user_mad		in_mad, out_mad;
@@ -1071,24 +1089,6 @@ static int get_port_info(struct umad_resources *umad_res, uint16_t dlid,
 	return 0;
 }
 
-int pkey_index_to_pkey(struct umad_resources *umad_res, int pkey_index,
-		       uint16_t *pkey)
-{
-	char pkey_file[18], pkey_str[16];
-
-	/* Read pkey */
-	snprintf(pkey_file, sizeof(pkey_file), "pkeys/%d", pkey_index);
-	if (srpd_sys_read_string(umad_res->port_sysfs_path, pkey_file,
-				 pkey_str, sizeof(pkey_str)) < 0)
-		return -1;
-
-	*pkey = strtoul(pkey_str, NULL, 0);
-	if (*pkey)
-		pr_debug("discover Targets for P_key %04x (index %d)\n",
-			 *pkey, pkey_index);
-	return 0;
-}
-
 static int get_shared_pkeys(struct resources *res,
 			    uint16_t dest_port_lid,
 			    uint16_t *pkeys)
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux