[ofw] [OPENSM] update osm_db_files.c & osm_pack.c functions to match .h prototypes
Stan C. Smith
stan.smith at intel.com
Fri Sep 25 09:05:29 PDT 2009
Hello,
The following patches address inconsistancies between header file function prototypes and .c function definitions;
missing 'const' attribute.
Attched is a Linux EOL patch file in case a mailer hacks/reformats the text.
Signed-off-by: Stan Smith (stan.smith at intel.com)
diff --git a/opensm/opensm/osm_db_files.c b/opensm/opensm/osm_db_files.c
index 0c01597..c30f7a8 100644
--- a/opensm/opensm/osm_db_files.c
+++ b/opensm/opensm/osm_db_files.c
@@ -119,7 +119,7 @@ typedef struct osm_db_imp {
/***************************************************************************
***************************************************************************/
-void osm_db_construct(IN osm_db_t * p_db)
+void osm_db_construct(IN osm_db_t * const p_db)
{
memset(p_db, 0, sizeof(osm_db_t));
cl_list_construct(&p_db->domains);
@@ -143,7 +143,7 @@ void osm_db_domain_destroy(IN osm_db_domain_t * p_db_domain)
/***************************************************************************
***************************************************************************/
-void osm_db_destroy(IN osm_db_t * p_db)
+void osm_db_destroy(IN osm_db_t * const p_db)
{
osm_db_domain_t *p_domain;
@@ -157,7 +157,7 @@ void osm_db_destroy(IN osm_db_t * p_db)
/***************************************************************************
***************************************************************************/
-int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log)
+int osm_db_init(IN osm_db_t * const p_db, IN osm_log_t * p_log)
{
osm_db_imp_t *p_db_imp;
struct stat dstat;
@@ -201,7 +201,7 @@ int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log)
/***************************************************************************
***************************************************************************/
-osm_db_domain_t *osm_db_domain_init(IN osm_db_t * p_db, IN char *domain_name)
+osm_db_domain_t *osm_db_domain_init(IN osm_db_t * const p_db, IN char *domain_name)
{
osm_db_domain_t *p_domain;
osm_db_domain_imp_t *p_domain_imp;
@@ -537,7 +537,7 @@ int osm_db_keys(IN osm_db_domain_t * p_domain, OUT cl_list_t * p_key_list)
/***************************************************************************
***************************************************************************/
-char *osm_db_lookup(IN osm_db_domain_t * p_domain, IN char *p_key)
+char *osm_db_lookup(IN osm_db_domain_t * p_domain, IN char * const p_key)
{
osm_db_domain_imp_t *p_domain_imp =
(osm_db_domain_imp_t *) p_domain->p_domain_imp;
@@ -555,7 +555,7 @@ char *osm_db_lookup(IN osm_db_domain_t * p_domain, IN char *p_key)
/***************************************************************************
***************************************************************************/
-int osm_db_update(IN osm_db_domain_t * p_domain, IN char *p_key, IN char *p_val)
+int osm_db_update(IN osm_db_domain_t * p_domain, IN char * const p_key, IN char * const p_val)
{
osm_log_t *p_log = p_domain->p_db->p_log;
osm_db_domain_imp_t *p_domain_imp =
@@ -595,7 +595,7 @@ int osm_db_update(IN osm_db_domain_t * p_domain, IN char *p_key, IN char *p_val)
/***************************************************************************
***************************************************************************/
-int osm_db_delete(IN osm_db_domain_t * p_domain, IN char *p_key)
+int osm_db_delete(IN osm_db_domain_t * p_domain, IN char * const p_key)
{
osm_log_t *p_log = p_domain->p_db->p_log;
osm_db_domain_imp_t *p_domain_imp =
diff --git a/opensm/opensm/osm_db_pack.c b/opensm/opensm/osm_db_pack.c
index 6af2694..3b4b4d7 100644
--- a/opensm/opensm/osm_db_pack.c
+++ b/opensm/opensm/osm_db_pack.c
@@ -83,7 +83,7 @@ static inline int unpack_lids(IN char *p_lid_str, OUT uint16_t * p_min_lid,
return 0;
}
-int osm_db_guid2lid_guids(IN osm_db_domain_t * p_g2l,
+int osm_db_guid2lid_guids(IN osm_db_domain_t * const p_g2l,
OUT cl_qlist_t * p_guid_list)
{
char *p_key;
@@ -109,7 +109,7 @@ int osm_db_guid2lid_guids(IN osm_db_domain_t * p_g2l,
return 0;
}
-int osm_db_guid2lid_get(IN osm_db_domain_t * p_g2l, IN uint64_t guid,
+int osm_db_guid2lid_get(IN osm_db_domain_t * const p_g2l, IN uint64_t guid,
OUT uint16_t * p_min_lid, OUT uint16_t * p_max_lid)
{
char guid_str[20];
@@ -131,7 +131,7 @@ int osm_db_guid2lid_get(IN osm_db_domain_t * p_g2l, IN uint64_t guid,
return 0;
}
-int osm_db_guid2lid_set(IN osm_db_domain_t * p_g2l, IN uint64_t guid,
+int osm_db_guid2lid_set(IN osm_db_domain_t * const p_g2l, IN uint64_t guid,
IN uint16_t min_lid, IN uint16_t max_lid)
{
char guid_str[20];
@@ -143,7 +143,7 @@ int osm_db_guid2lid_set(IN osm_db_domain_t * p_g2l, IN uint64_t guid,
return (osm_db_update(p_g2l, guid_str, lid_str));
}
-int osm_db_guid2lid_delete(IN osm_db_domain_t * p_g2l, IN uint64_t guid)
+int osm_db_guid2lid_delete(IN osm_db_domain_t * const p_g2l, IN uint64_t guid)
{
char guid_str[20];
pack_guid(guid, guid_str);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opensm-patches
Type: application/octet-stream
Size: 4708 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090925/49628b56/attachment.obj>
More information about the ofw
mailing list