[ofa-general] [PATCH 5/6] opensm: remove unused osm_ucast_mgr_read_guid_file()

Sasha Khapyorsky sashak at voltaire.com
Wed Mar 26 17:27:16 PDT 2008


Finally remove osm_ucast_mgr_read_guid_file() function which is unused
anymore.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/include/opensm/osm_ucast_mgr.h |   37 +-----------------
 opensm/opensm/osm_ucast_mgr.c         |   68 +--------------------------------
 2 files changed, 2 insertions(+), 103 deletions(-)

diff --git a/opensm/include/opensm/osm_ucast_mgr.h b/opensm/include/opensm/osm_ucast_mgr.h
index 2acab49..0317c93 100644
--- a/opensm/include/opensm/osm_ucast_mgr.h
+++ b/opensm/include/opensm/osm_ucast_mgr.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
  * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  *
@@ -278,41 +278,6 @@ void osm_ucast_mgr_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr);
 *	Unicast Manager
 *********/
 
-/****f* OpenSM: Unicast Manager/osm_ucast_mgr_read_guid_file
-* NAME
-*	osm_ucast_mgr_read_guid_file
-*
-* DESCRIPTION
-*	Read guid list from file.
-*
-* SYNOPSIS
-*/
-cl_status_t
-osm_ucast_mgr_read_guid_file(IN osm_ucast_mgr_t * const p_mgr,
-			     IN const char *guid_file_name,
-			     IN cl_list_t * p_list);
-/*
-* PARAMETERS
-*	p_mgr
-*		[in] Pointer to an osm_ucast_mgr_t object.
-*
-*	guid_file_name
-*		[in] Name of the file to read.
-*
-*	p_list
-*		[in] Pointer to the list that will be filled with guids.
-*
-* RETURN VALUES
-*	IB_SUCCESS if the file was read successfully.
-*
-* NOTES
-*	This function reads guids from a file and inserts them
-*	into a list.
-*
-* SEE ALSO
-*	Unicast Manager
-*********/
-
 /****f* OpenSM: Unicast Manager/osm_ucast_mgr_process
 * NAME
 *	osm_ucast_mgr_process
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index 46a4f09..938db84 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
  * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
  *
@@ -659,72 +659,6 @@ static int ucast_mgr_setup_all_switches(osm_subn_t * p_subn)
 
 /**********************************************************************
  **********************************************************************/
-cl_status_t
-osm_ucast_mgr_read_guid_file(IN osm_ucast_mgr_t * const p_mgr,
-			     IN const char *guid_file_name,
-			     IN cl_list_t * p_list)
-{
-	cl_status_t status = IB_SUCCESS;
-	FILE *guid_file;
-	char line[MAX_GUID_FILE_LINE_LENGTH];
-	char *endptr;
-	uint64_t *p_guid;
-
-	OSM_LOG_ENTER(p_mgr->p_log);
-
-	guid_file = fopen(guid_file_name, "r");
-	if (guid_file == NULL) {
-		OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 3A13: "
-			"Failed to open guid list file (%s)\n", guid_file_name);
-		status = IB_NOT_FOUND;
-		goto Exit;
-	}
-
-	while (fgets(line, sizeof(line), guid_file)) {
-		if (strcspn(line, " ,;.") != strlen(line)) {
-			OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 3A14: "
-				"Poorly formatted guid in file (%s): %s\n",
-				guid_file_name, line);
-			status = IB_NOT_FOUND;
-			break;
-		}
-
-		/* Skip empty lines anywhere in the file - only one
-		   char means the null termination */
-		if (strlen(line) <= 1)
-			continue;
-
-		p_guid = malloc(sizeof(uint64_t));
-		if (!p_guid) {
-			status = IB_ERROR;
-			goto Exit;
-		}
-
-		*p_guid = strtoull(line, &endptr, 16);
-
-		/* check that the string is a number */
-		if (!(*p_guid) && (*endptr != '\0')) {
-			OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 3A15: "
-				"Poorly formatted guid in file (%s): %s\n",
-				guid_file_name, line);
-			status = IB_NOT_FOUND;
-			free(p_guid);
-			break;
-		}
-
-		/* store the parsed guid */
-		cl_list_insert_tail(p_list, p_guid);
-	}
-
-Exit:
-	if (guid_file)
-		fclose(guid_file);
-	OSM_LOG_EXIT(p_mgr->p_log);
-	return (status);
-}
-
-/**********************************************************************
- **********************************************************************/
 osm_signal_t osm_ucast_mgr_process(IN osm_ucast_mgr_t * const p_mgr)
 {
 	osm_opensm_t *p_osm;
-- 
1.5.4.1.122.gaa8d




More information about the general mailing list