[openib-general] [PATCH] kDAPL: cleanup dat/ a bit more

Tom Duffy tduffy at sun.com
Wed Jun 1 11:23:44 PDT 2005


This patch cleans up dat/ a bit, removing unneeded parenthesis,
gratuitous comments, and a few whitespace cleanups.  Please apply.

Signed-off-by: Tom Duffy <tduffy at sun.com>

 api.c        |  684 ++++++++++++++++++-----------------------------------------
 core.c       |   24 --
 dictionary.c |   90 +------
 dr.c         |   67 -----
 dr.h         |    6
 5 files changed, 242 insertions(+), 629 deletions(-)

Index: linux-kernel-new/dat/dictionary.c
===================================================================
--- linux-kernel-new/dat/dictionary.c	(revision 2518)
+++ linux-kernel-new/dat/dictionary.c	(working copy)
@@ -33,28 +33,11 @@
 
 #include "dictionary.h"
 
-/*********************************************************************
- *                                                                   *
- * Function Declarations                                             *
- *                                                                   *
- *********************************************************************/
-
 static u32 dat_dictionary_key_dup(const struct dat_provider_info *old_key,
 				  struct dat_provider_info *new_key);
 
-static boolean_t
-dat_dictionary_key_is_equal(const struct dat_provider_info *key_a,
-			    const struct dat_provider_info *key_b);
-
-/*********************************************************************
- *                                                                   *
- * External Functions                                                *
- *                                                                   *
- *********************************************************************/
-
-/***********************************************************************
- * Function: dat_dictionary_destroy
- ***********************************************************************/
+static boolean_t dat_dict_key_is_equal(const struct dat_provider_info *key_a,
+				       const struct dat_provider_info *key_b);
 
 void dat_dictionary_destroy(struct dat_dictionary *dictionary)
 {
@@ -71,10 +54,6 @@ void dat_dictionary_destroy(struct dat_d
 	}
 }
 
-/***********************************************************************
- * Function: dat_dictionary_size
- ***********************************************************************/
-
 u32 dat_dictionary_size(const struct dat_dictionary *dictionary, int *size)
 {
 	BUG_ON(NULL == dictionary);
@@ -85,10 +64,6 @@ u32 dat_dictionary_size(const struct dat
 	return DAT_SUCCESS;
 }
 
-/***********************************************************************
- * Function: dat_dictionary_entry_create
- ***********************************************************************/
-
 u32 dat_dictionary_entry_create(struct dat_dictionary_entry **p_entry)
 {
 	struct dat_dictionary_entry *entry;
@@ -105,23 +80,15 @@ u32 dat_dictionary_entry_create(struct d
 
 	*p_entry = entry;
 
-      bail:
+bail:
 	return status;
 }
 
-/***********************************************************************
- * Function: dat_dictionary_entry_destroy
- ***********************************************************************/
-
 void dat_dictionary_entry_destroy(const struct dat_dictionary_entry *entry)
 {
 	kfree(entry);
 }
 
-/***********************************************************************
- * Function: dat_dictionary_insert
- ***********************************************************************/
-
 u32 dat_dictionary_insert(struct dat_dictionary *dictionary,
 			  const struct dat_provider_info *key,
 			  struct dat_dictionary_entry *entry, void *data)
@@ -148,14 +115,10 @@ u32 dat_dictionary_insert(struct dat_dic
 
 	dictionary->size++;
 
-      bail:
+bail:
 	return status;
 }
 
-/***********************************************************************
- * Function: dat_dictionary_search
- ***********************************************************************/
-
 u32 dat_dictionary_search(struct dat_dictionary *dictionary,
 			  const struct dat_provider_info *key, void **p_data)
 {
@@ -168,7 +131,7 @@ u32 dat_dictionary_search(struct dat_dic
 	status = DAT_ERROR(DAT_PROVIDER_NOT_FOUND, DAT_NAME_NOT_REGISTERED);
 
 	list_for_each_entry(cur_entry, &dictionary->list, list) {
-		if (TRUE == dat_dictionary_key_is_equal(&cur_entry->key, key)) {
+		if (TRUE == dat_dict_key_is_equal(&cur_entry->key, key)) {
 			if (NULL != p_data)
 				*p_data = cur_entry->data;
 			
@@ -177,14 +140,10 @@ u32 dat_dictionary_search(struct dat_dic
 		}
 	}
 
-      bail:
+bail:
 	return status;
 }
 
-/***********************************************************************
- * Function: dat_dictionary_enumerate
- ***********************************************************************/
-
 u32 dat_dictionary_enumerate(struct dat_dictionary *dictionary, void *array[],
 			     int array_size)
 {
@@ -206,14 +165,10 @@ u32 dat_dictionary_enumerate(struct dat_
 	list_for_each_entry(cur_entry, &dictionary->list, list)
 		array[i++] = cur_entry->data;
 
-      bail:
+bail:
 	return status;
 }
 
-/***********************************************************************
- * Function: dat_dictionary_remove
- ***********************************************************************/
-
 u32 dat_dictionary_remove(struct dat_dictionary *dictionary,
 			  const struct dat_provider_info *key,
 			  struct dat_dictionary_entry **p_entry, void **p_data)
@@ -231,7 +186,7 @@ u32 dat_dictionary_remove(struct dat_dic
 	list_for_each_safe(cur_list, next_list, &dictionary->list) {
 		cur_entry = list_entry(cur_list, struct dat_dictionary_entry,
 				       list);
-		if (TRUE == dat_dictionary_key_is_equal(&cur_entry->key, key)) {
+		if (TRUE == dat_dict_key_is_equal(&cur_entry->key, key)) {
 			if (NULL != p_data)
 				*p_data = cur_entry->data;
                         
@@ -246,22 +201,12 @@ u32 dat_dictionary_remove(struct dat_dic
 		}
 	}
 	
-      bail:
+bail:
 	return status;
 }
 
-/*********************************************************************
- *                                                                   *
- * Internal Function Definitions                                     *
- *                                                                   *
- *********************************************************************/
-
-/***********************************************************************
- * Function: dat_dictionary_key_create
- ***********************************************************************/
-
-u32 dat_dictionary_key_dup(const struct dat_provider_info *old_key,
-			   struct dat_provider_info *new_key)
+static u32 dat_dictionary_key_dup(const struct dat_provider_info *old_key,
+				  struct dat_provider_info *new_key)
 {
 	BUG_ON(NULL == old_key);
 	BUG_ON(NULL == new_key);
@@ -274,12 +219,8 @@ u32 dat_dictionary_key_dup(const struct 
 	return DAT_SUCCESS;
 }
 
-/***********************************************************************
- * Function: dat_dictionary_key_is_equal
- ***********************************************************************/
-
-boolean_t dat_dictionary_key_is_equal(const struct dat_provider_info *key_a,
-				      const struct dat_provider_info *key_b)
+static boolean_t dat_dict_key_is_equal(const struct dat_provider_info *key_a,
+				       const struct dat_provider_info *key_b)
 {
         BUG_ON(NULL == key_a);
         BUG_ON(NULL == key_b);
@@ -288,9 +229,8 @@ boolean_t dat_dictionary_key_is_equal(co
 	    (!strncmp(key_a->ia_name, key_b->ia_name, strlen(key_a->ia_name)))
 	    && (key_a->dat_version_major == key_b->dat_version_major)
 	    && (key_a->dat_version_minor == key_b->dat_version_minor)
-	    && (key_a->is_thread_safe == key_b->is_thread_safe)) {
+	    && (key_a->is_thread_safe == key_b->is_thread_safe))
 		return TRUE;
-	} else {
+	else
 		return FALSE;
-	}
 }
Index: linux-kernel-new/dat/dr.c
===================================================================
--- linux-kernel-new/dat/dr.c	(revision 2518)
+++ linux-kernel-new/dat/dr.c	(working copy)
@@ -35,47 +35,21 @@
 #include "dictionary.h"
 #include "dr.h"
 
-/*********************************************************************
- *                                                                   *
- * Strucutres                                                        *
- *                                                                   *
- *********************************************************************/
-
 struct dat_dr_entry {
 	int ref_count;
 	struct dat_provider_info info;
 	DAT_IA_OPEN_FUNC ia_open_func;
 };
 
-/*********************************************************************
- *                                                                   *
- * Global Variables                                                  *
- *                                                                   *
- *********************************************************************/
-
 static spinlock_t g_dr_lock = SPIN_LOCK_UNLOCKED;
 static struct dat_dictionary g_dr_dictionary = 
 	DAT_DICTIONARY_INIT(g_dr_dictionary);
 
-/*********************************************************************
- *                                                                   *
- * External Functions                                                *
- *                                                                   *
- *********************************************************************/
-
-/************************************************************************
- * Function: dat_dr_fini
- ************************************************************************/
-
 void dat_dr_fini(void)
 {
 	dat_dictionary_destroy(&g_dr_dictionary);
 }
 
-/************************************************************************
- * Function: dat_dr_insert
- ************************************************************************/
-
 u32 dat_dr_insert(const struct dat_provider_info *info,
 		  const DAT_IA_OPEN_FUNC ia_open_func)
 {
@@ -107,7 +81,7 @@ u32 dat_dr_insert(const struct dat_provi
 
 	spin_unlock_irqrestore(&g_dr_lock, flags);
 
-      bail:
+bail:
 	if (DAT_SUCCESS != status) {
 		if (NULL != data)
 			kfree(data);
@@ -119,10 +93,6 @@ u32 dat_dr_insert(const struct dat_provi
 	return status;
 }
 
-/************************************************************************
- * Function: dat_dr_remove
- ************************************************************************/
-
 u32 dat_dr_remove(const struct dat_provider_info *info)
 {
 	struct dat_dr_entry *data;
@@ -150,7 +120,7 @@ u32 dat_dr_remove(const struct dat_provi
         
 	kfree(data);
 
-      bail:
+bail:
 	spin_unlock_irqrestore(&g_dr_lock, flags);
 
 	if (NULL != dict_entry)
@@ -159,10 +129,6 @@ u32 dat_dr_remove(const struct dat_provi
 	return status;
 }
 
-/************************************************************************
- * Function: dat_dr_provider_open
- ************************************************************************/
-
 u32 dat_dr_provider_open(const struct dat_provider_info *info,
 		                DAT_IA_OPEN_FUNC *p_ia_open_func)
 {
@@ -184,10 +150,6 @@ u32 dat_dr_provider_open(const struct da
 	return status;
 }
 
-/************************************************************************
- * Function: dat_dr_provider_close
- ************************************************************************/
-
 u32 dat_dr_provider_close(const struct dat_provider_info *info)
 {
 	struct dat_dr_entry *data;
@@ -206,19 +168,11 @@ u32 dat_dr_provider_close(const struct d
 	return status;
 }
 
-/************************************************************************
- * Function: dat_dr_size
- ************************************************************************/
-
 u32 dat_dr_size(int *size)
 {
 	return dat_dictionary_size(&g_dr_dictionary, size);
 }
 
-/***********************************************************************
- * Function: dat_dr_list
- ***********************************************************************/
-
 u32 dat_dr_list(int max_to_return, int *entries_returned,
 		struct dat_provider_info *(dat_provider_list[]))
 {
@@ -227,9 +181,11 @@ u32 dat_dr_list(int max_to_return, int *
 	unsigned long flags;
 	u32 status = DAT_SUCCESS;
 
-	/* The dictionary size may increase between the call to      */
-	/* dat_dictionary_size() and dat_dictionary_enumerate().     */
-	/* Therefore we loop until a successful enumeration is made. */        
+	/*
+	 * The dictionary size may increase between the call to
+	 * dat_dictionary_size() and dat_dictionary_enumerate().
+	 * Therefore we loop until a successful enumeration is made.
+	 */        
 	*entries_returned = 0;
 	for (;;) {
 		status = dat_dictionary_size(&g_dr_dictionary, &array_size);
@@ -256,9 +212,9 @@ u32 dat_dr_list(int max_to_return, int *
 
 		spin_unlock_irqrestore(&g_dr_lock, flags);
 
-		if (DAT_SUCCESS == status) {
+		if (DAT_SUCCESS == status)
 			break;
-		} else {
+		else {
 			kfree(array);
 			array = NULL;
 			continue;
@@ -277,10 +233,9 @@ u32 dat_dr_list(int max_to_return, int *
 
 	*entries_returned = i;
         
-      bail:
-	if (NULL != array) {
+bail:
+	if (NULL != array)
 		kfree(array);
-	}
 
 	return status;
 }
Index: linux-kernel-new/dat/core.c
===================================================================
--- linux-kernel-new/dat/core.c	(revision 2518)
+++ linux-kernel-new/dat/core.c	(working copy)
@@ -38,26 +38,10 @@ MODULE_LICENSE("Dual BSD/GPL");
 MODULE_DESCRIPTION("Direct Access Transport (DAT) API");
 MODULE_AUTHOR("James Lentini");
 
-/*********************************************************************
- *                                                                   *
- * Global Variables                                                  *
- *                                                                   *
- *********************************************************************/
-
 static DAT_DBG_MASK g_dbg_mask = DAT_DBG_TYPE_ERROR;
 module_param_named(dbg_mask, g_dbg_mask, int, 0644);
 MODULE_PARM_DESC(dbg_mask, "Bitmask to enable debug message types.");
 
-/*********************************************************************
- *                                                                   *
- * Function Definitions                                              *
- *                                                                   *
- *********************************************************************/
-
-/***********************************************************************
- * Function: dat_dbg_print
- ***********************************************************************/
-
 void dat_dbg_print(DAT_DBG_TYPE type, const char *fmt, ...)
 {
 	static char buf[1024];
@@ -72,10 +56,6 @@ void dat_dbg_print(DAT_DBG_TYPE type, co
 	}
 }
 
-/***********************************************************************
- * Function: dat_init
- ***********************************************************************/
-
 static int __init dat_init(void)
 {
 	dat_dbg_print(DAT_DBG_TYPE_GENERIC, "registry started\n");
@@ -84,10 +64,6 @@ static int __init dat_init(void)
 
 module_init(dat_init);
 
-/***********************************************************************
- * Function: dat_fini
- ***********************************************************************/
-
 static void __exit dat_fini(void)
 {
 	dat_dr_fini();
Index: linux-kernel-new/dat/api.c
===================================================================
--- linux-kernel-new/dat/api.c	(revision 2518)
+++ linux-kernel-new/dat/api.c	(working copy)
@@ -34,547 +34,321 @@
 #include "core.h"
 #include "dr.h"
 
-/*********************************************************************
- *                                                                   *
- * Internal Function Definitions                                     *
- *                                                                   *
- *********************************************************************/
-
-/***********************************************************************
- * Function: dat_strerror_major
- ***********************************************************************/
-
 static u32 dat_strerror_major(u32 value, const char **message)
 {
 	switch (DAT_GET_TYPE(value)) {
 	case DAT_SUCCESS:
-		{
-			*message = "DAT_SUCCESS";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_SUCCESS";
+		return DAT_SUCCESS;
 	case DAT_ABORT:
-		{
-			*message = "DAT_ABORT";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_ABORT";
+		return DAT_SUCCESS;
 	case DAT_CONN_QUAL_IN_USE:
-		{
-			*message = "DAT_CONN_QUAL_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_CONN_QUAL_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INSUFFICIENT_RESOURCES:
-		{
-			*message = "DAT_INSUFFICIENT_RESOURCES";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INSUFFICIENT_RESOURCES";
+		return DAT_SUCCESS;
 	case DAT_INTERNAL_ERROR:
-		{
-			*message = "DAT_INTERNAL_ERROR";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INTERNAL_ERROR";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE:
-		{
-			*message = "DAT_INVALID_HANDLE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_PARAMETER:
-		{
-			*message = "DAT_INVALID_PARAMETER";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_PARAMETER";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE:
-		{
-			*message = "DAT_INVALID_STATE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE";
+		return DAT_SUCCESS;
 	case DAT_LENGTH_ERROR:
-		{
-			*message = "DAT_LENGTH_ERROR";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_LENGTH_ERROR";
+		return DAT_SUCCESS;
 	case DAT_MODEL_NOT_SUPPORTED:
-		{
-			*message = "DAT_MODEL_NOT_SUPPORTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_MODEL_NOT_SUPPORTED";
+		return DAT_SUCCESS;
 	case DAT_PROVIDER_NOT_FOUND:
-		{
-			*message = "DAT_PROVIDER_NOT_FOUND";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROVIDER_NOT_FOUND";
+		return DAT_SUCCESS;
 	case DAT_PRIVILEGES_VIOLATION:
-		{
-			*message = "DAT_PRIVILEGES_VIOLATION";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PRIVILEGES_VIOLATION";
+		return DAT_SUCCESS;
 	case DAT_PROTECTION_VIOLATION:
-		{
-			*message = "DAT_PROTECTION_VIOLATION";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROTECTION_VIOLATION";
+		return DAT_SUCCESS;
 	case DAT_QUEUE_EMPTY:
-		{
-			*message = "DAT_QUEUE_EMPTY";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_QUEUE_EMPTY";
+		return DAT_SUCCESS;
 	case DAT_QUEUE_FULL:
-		{
-			*message = "DAT_QUEUE_FULL";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_QUEUE_FULL";
+		return DAT_SUCCESS;
 	case DAT_TIMEOUT_EXPIRED:
-		{
-			*message = "DAT_TIMEOUT_EXPIRED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_TIMEOUT_EXPIRED";
+		return DAT_SUCCESS;
 	case DAT_PROVIDER_ALREADY_REGISTERED:
-		{
-			*message = "DAT_PROVIDER_ALREADY_REGISTERED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROVIDER_ALREADY_REGISTERED";
+		return DAT_SUCCESS;
 	case DAT_PROVIDER_IN_USE:
-		{
-			*message = "DAT_PROVIDER_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROVIDER_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ADDRESS:
-		{
-			*message = "DAT_INVALID_ADDRESS";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ADDRESS";
+		return DAT_SUCCESS;
 	case DAT_INTERRUPTED_CALL:
-		{
-			*message = "DAT_INTERRUPTED_CALL";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INTERRUPTED_CALL";
+		return DAT_SUCCESS;
 	case DAT_NOT_IMPLEMENTED:
-		{
-			*message = "DAT_NOT_IMPLEMENTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_NOT_IMPLEMENTED";
+		return DAT_SUCCESS;
 	default:
-		{
-			*message = "unknown error";
-			return DAT_INVALID_PARAMETER;
-		}
+		*message = "unknown error";
+		return DAT_INVALID_PARAMETER;
 	}
 }
 
-/***********************************************************************
- * Function: dat_strerror_minor
- ***********************************************************************/
 static u32 dat_strerror_minor(u32 value, const char **message)
 {
 	switch (DAT_GET_SUBTYPE(value)) {
-
 	case DAT_NO_SUBTYPE:
-		{
-			*message = "";
-			return DAT_SUCCESS;
-		}
+		*message = "";
+		return DAT_SUCCESS;
 	case DAT_SUB_INTERRUPTED:
-		{
-			*message = "DAT_SUB_INTERRUPTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_SUB_INTERRUPTED";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_MEMORY:
-		{
-			*message = "DAT_RESOURCE_MEMORY";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_MEMORY";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_DEVICE:
-		{
-			*message = "DAT_RESOURCE_DEVICE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_DEVICE";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_TEP:
-		{
-			*message = "DAT_RESOURCE_TEP";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_TEP";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_TEVD:
-		{
-			*message = "DAT_RESOURCE_TEVD";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_TEVD";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_PROTECTION_DOMAIN:
-		{
-			*message = "DAT_RESOURCE_PROTECTION_DOMAIN";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_PROTECTION_DOMAIN";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_MEMORY_REGION:
-		{
-			*message = "DAT_RESOURCE_MEMORY_REGION";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_MEMORY_REGION";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_ERROR_HANDLER:
-		{
-			*message = "DAT_RESOURCE_ERROR_HANDLER";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_ERROR_HANDLER";
+		return DAT_SUCCESS;
 	case DAT_RESOURCE_CREDITS:
-		{
-			*message = "DAT_RESOURCE_CREDITS";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_RESOURCE_CREDITS";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_IA:
-		{
-			*message = "DAT_INVALID_HANDLE_IA";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_IA";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_EP:
-		{
-			*message = "DAT_INVALID_HANDLE_EP";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_EP";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_LMR:
-		{
-			*message = "DAT_INVALID_HANDLE_LMR";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_LMR";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_RMR:
-		{
-			*message = "DAT_INVALID_HANDLE_RMR";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_RMR";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_PZ:
-		{
-			*message = "DAT_INVALID_HANDLE_PZ";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_PZ";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_PSP:
-		{
-			*message = "DAT_INVALID_HANDLE_PSP";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_PSP";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_RSP:
-		{
-			*message = "DAT_INVALID_HANDLE_RSP";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_RSP";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_CR:
-		{
-			*message = "DAT_INVALID_HANDLE_CR";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_CR";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_CNO:
-		{
-			*message = "DAT_INVALID_HANDLE_CNO";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_CNO";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_EVD_CR:
-		{
-			*message = "DAT_INVALID_HANDLE_EVD_CR";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_EVD_CR";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_EVD_REQUEST:
-		{
-			*message = "DAT_INVALID_HANDLE_EVD_REQUEST";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_EVD_REQUEST";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_EVD_RECV:
-		{
-			*message = "DAT_INVALID_HANDLE_EVD_RECV";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_EVD_RECV";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_EVD_CONN:
-		{
-			*message = "DAT_INVALID_HANDLE_EVD_CONN";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_EVD_CONN";
+		return DAT_SUCCESS;
 	case DAT_INVALID_HANDLE_EVD_ASYNC:
-		{
-			*message = "DAT_INVALID_HANDLE_EVD_ASYNC";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_HANDLE_EVD_ASYNC";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG1:
-		{
-			*message = "DAT_INVALID_ARG1";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG1";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG2:
-		{
-			*message = "DAT_INVALID_ARG2";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG2";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG3:
-		{
-			*message = "DAT_INVALID_ARG3";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG3";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG4:
-		{
-			*message = "DAT_INVALID_ARG4";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG4";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG5:
-		{
-			*message = "DAT_INVALID_ARG5";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG5";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG6:
-		{
-			*message = "DAT_INVALID_ARG6";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG6";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG7:
-		{
-			*message = "DAT_INVALID_ARG7";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG7";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG8:
-		{
-			*message = "DAT_INVALID_ARG8";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG8";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG9:
-		{
-			*message = "DAT_INVALID_ARG9";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG9";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ARG10:
-		{
-			*message = "DAT_INVALID_ARG10";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ARG10";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_UNCONNECTED:
-		{
-			*message = "DAT_INVALID_STATE_EP_UNCONNECTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_UNCONNECTED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_ACTCONNPENDING:
-		{
-			*message = "DAT_INVALID_STATE_EP_ACTCONNPENDING";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_ACTCONNPENDING";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_PASSCONNPENDING:
-		{
-			*message = "DAT_INVALID_STATE_EP_PASSCONNPENDING";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_PASSCONNPENDING";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_TENTCONNPENDING:
-		{
-			*message = "DAT_INVALID_STATE_EP_TENTCONNPENDING";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_TENTCONNPENDING";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_CONNECTED:
-		{
-			*message = "DAT_INVALID_STATE_EP_CONNECTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_CONNECTED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_DISCONNECTED:
-		{
-			*message = "DAT_INVALID_STATE_EP_DISCONNECTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_DISCONNECTED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_RESERVED:
-		{
-			*message = "DAT_INVALID_STATE_EP_RESERVED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_RESERVED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_COMPLPENDING:
-		{
-			*message = "DAT_INVALID_STATE_EP_COMPLPENDING";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_COMPLPENDING";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_DISCPENDING:
-		{
-			*message = "DAT_INVALID_STATE_EP_DISCPENDING";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_DISCPENDING";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_PROVIDERCONTROL:
-		{
-			*message = "DAT_INVALID_STATE_EP_PROVIDERCONTROL";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_PROVIDERCONTROL";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EP_NOTREADY:
-		{
-			*message = "DAT_INVALID_STATE_EP_NOTREADY";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EP_NOTREADY";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_CNO_IN_USE:
-		{
-			*message = "DAT_INVALID_STATE_CNO_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_CNO_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_CNO_DEAD:
-		{
-			*message = "DAT_INVALID_STATE_CNO_DEAD";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_CNO_DEAD";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_OPEN:
-		{
-			*message = "DAT_INVALID_STATE_EVD_OPEN";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_OPEN";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_ENABLED:
-		{
-			*message = "DAT_INVALID_STATE_EVD_ENABLED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_ENABLED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_DISABLED:
-		{
-			*message = "DAT_INVALID_STATE_EVD_DISABLED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_DISABLED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_WAITABLE:
-		{
-			*message = "DAT_INVALID_STATE_EVD_WAITABLE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_WAITABLE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_UNWAITABLE:
-		{
-			*message = "DAT_INVALID_STATE_EVD_UNWAITABLE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_UNWAITABLE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_IN_USE:
-		{
-			*message = "DAT_INVALID_STATE_EVD_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_CONFIG_NOTIFY:
-		{
-			*message = "DAT_INVALID_STATE_EVD_CONFIG_NOTIFY";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_CONFIG_NOTIFY";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_CONFIG_SOLICITED:
-		{
-			*message = "DAT_INVALID_STATE_EVD_CONFIG_SOLICITED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_CONFIG_SOLICITED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD:
-		{
-			*message = "DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_WAITER:
-		{
-			*message = "DAT_INVALID_STATE_EVD_WAITER";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_WAITER";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_EVD_ASYNC:
-		{
-			*message = "DAT_INVALID_STATE_EVD_ASYNC";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_EVD_ASYNC";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_IA_IN_USE:
-		{
-			*message = "DAT_INVALID_STATE_IA_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_IA_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_LMR_IN_USE:
-		{
-			*message = "DAT_INVALID_STATE_LMR_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_LMR_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_LMR_FREE:
-		{
-			*message = "DAT_INVALID_STATE_LMR_FREE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_LMR_FREE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_PZ_IN_USE:
-		{
-			*message = "DAT_INVALID_STATE_PZ_IN_USE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_PZ_IN_USE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_STATE_PZ_FREE:
-		{
-			*message = "DAT_INVALID_STATE_PZ_FREE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_STATE_PZ_FREE";
+		return DAT_SUCCESS;
 	case DAT_PRIVILEGES_READ:
-		{
-			*message = "DAT_PRIVILEGES_READ";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PRIVILEGES_READ";
+		return DAT_SUCCESS;
 	case DAT_PRIVILEGES_WRITE:
-		{
-			*message = "DAT_PRIVILEGES_WRITE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PRIVILEGES_WRITE";
+		return DAT_SUCCESS;
 	case DAT_PRIVILEGES_RDMA_READ:
-		{
-			*message = "DAT_PRIVILEGES_RDMA_READ";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PRIVILEGES_RDMA_READ";
+		return DAT_SUCCESS;
 	case DAT_PRIVILEGES_RDMA_WRITE:
-		{
-			*message = "DAT_PRIVILEGES_RDMA_WRITE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PRIVILEGES_RDMA_WRITE";
+		return DAT_SUCCESS;
 	case DAT_PROTECTION_READ:
-		{
-			*message = "DAT_PROTECTION_READ";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROTECTION_READ";
+		return DAT_SUCCESS;
 	case DAT_PROTECTION_WRITE:
-		{
-			*message = "DAT_PROTECTION_WRITE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROTECTION_WRITE";
+		return DAT_SUCCESS;
 	case DAT_PROTECTION_RDMA_READ:
-		{
-			*message = "DAT_PROTECTION_RDMA_READ";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROTECTION_RDMA_READ";
+		return DAT_SUCCESS;
 	case DAT_PROTECTION_RDMA_WRITE:
-		{
-			*message = "DAT_PROTECTION_RDMA_WRITE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_PROTECTION_RDMA_WRITE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ADDRESS_UNSUPPORTED:
-		{
-			*message = "DAT_INVALID_ADDRESS_UNSUPPORTED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ADDRESS_UNSUPPORTED";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ADDRESS_UNREACHABLE:
-		{
-			*message = "DAT_INVALID_ADDRESS_UNREACHABLE";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ADDRESS_UNREACHABLE";
+		return DAT_SUCCESS;
 	case DAT_INVALID_ADDRESS_MALFORMED:
-		{
-			*message = "DAT_INVALID_ADDRESS_MALFORMED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_INVALID_ADDRESS_MALFORMED";
+		return DAT_SUCCESS;
 	case DAT_NAME_NOT_REGISTERED:
-		{
-			*message = "DAT_NAME_NOT_REGISTERED";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_NAME_NOT_REGISTERED";
+		return DAT_SUCCESS;
 	case DAT_MAJOR_NOT_FOUND:
-		{
-			*message = "DAT_MAJOR_NOT_FOUND";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_MAJOR_NOT_FOUND";
+		return DAT_SUCCESS;
 	case DAT_MINOR_NOT_FOUND:
-		{
-			*message = "DAT_MINOR_NOT_FOUND";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_MINOR_NOT_FOUND";
+		return DAT_SUCCESS;
 	case DAT_THREAD_SAFETY_NOT_FOUND:
-		{
-			*message = "DAT_THREAD_SAFETY_NOT_FOUND";
-			return DAT_SUCCESS;
-		}
+		*message = "DAT_THREAD_SAFETY_NOT_FOUND";
+		return DAT_SUCCESS;
 	default:
-		{
-			*message = "unknown minor error";
-			return DAT_INVALID_PARAMETER;
-		}
+		*message = "unknown minor error";
+		return DAT_INVALID_PARAMETER;
 	}
 }
 
-/*********************************************************************
- *                                                                   *
- * External Function Definitions                                     *
- *                                                                   *
- *********************************************************************/
-
-/***********************************************************************
- * Function: dat_ia_openv
- ***********************************************************************/
-
 u32 dat_ia_openv(const char *name, int async_event_qlen,
 		 DAT_EVD_HANDLE *async_event_handle, DAT_IA_HANDLE *ia_handle,
 		 u32 dat_major, u32 dat_minor, boolean_t thread_safety)
@@ -589,15 +363,13 @@ u32 dat_ia_openv(const char *name, int a
 		      __func__, name, async_event_qlen, dat_major, dat_minor, 
                       thread_safety);
 
-	if (DAT_IS_BAD_POINTER(name)) {
+	if (DAT_IS_BAD_POINTER(name))
 		return DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1);
-	}
 
 	len = strlen(name);
 
-	if (DAT_NAME_MAX_LENGTH < len) {
+	if (DAT_NAME_MAX_LENGTH < len)
 		return DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1);
-	}
 
 	strncpy(info.ia_name, name, len);
 	info.ia_name[len] = '\0';
@@ -615,16 +387,12 @@ u32 dat_ia_openv(const char *name, int a
 		return status;
 	}
 
-        return ia_open_func(
-            name, async_event_qlen, async_event_handle, ia_handle);
+        return ia_open_func(name, async_event_qlen, async_event_handle,	
+			    ia_handle);
 }
 
 EXPORT_SYMBOL(dat_ia_openv);
 
-/***********************************************************************
- * Function: dat_ia_close
- ***********************************************************************/
-
 u32 dat_ia_close(DAT_IA_HANDLE ia_handle, enum dat_close_flags flags)
 {
 	struct dat_provider *provider;
@@ -638,15 +406,15 @@ u32 dat_ia_close(DAT_IA_HANDLE ia_handle
 	provider = DAT_HANDLE_TO_PROVIDER(ia_handle);
 	ia_name = provider->device_name;
 
-	if (DAT_SUCCESS != (status = dat_ia_query(
-                                ia_handle, NULL, NULL, &provider_attr))) {
+	if (DAT_SUCCESS != (status = dat_ia_query(ia_handle, NULL, NULL,
+						  &provider_attr)))
 		dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
 			      "dat_ia_query for IA %s failed\n", ia_name);
-	} else if (DAT_SUCCESS != 
-                   (status = provider->ia_close_func(ia_handle, flags))) {
+	else if (DAT_SUCCESS != (status = provider->ia_close_func(ia_handle,
+								  flags)))
 		dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
 			      "close function for IA %s failed\n", ia_name);
-	} else {
+	else {
 		struct dat_provider_info info;
 		size_t len;
 
@@ -662,12 +430,11 @@ u32 dat_ia_close(DAT_IA_HANDLE ia_handle
 		info.is_thread_safe = provider_attr.is_thread_safe;
 
 		status = dat_dr_provider_close(&info);
-		if (DAT_SUCCESS != status) {
+		if (DAT_SUCCESS != status)
 			dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
 				      "dynamic registry unable to close "
                                       "provider for IA %s\n", 
                                       ia_name);
-		}
 	}
 
 	return status;
@@ -675,10 +442,6 @@ u32 dat_ia_close(DAT_IA_HANDLE ia_handle
 
 EXPORT_SYMBOL(dat_ia_close);
 
-/***********************************************************************
- * Function: dat_strerror
- ***********************************************************************/
-
 u32 dat_strerror(u32 value, const char **major_message,
 		 const char **minor_message)
 {
@@ -695,23 +458,17 @@ u32 dat_strerror(u32 value, const char *
 	 * implementation does not follow the suggested implementation.
 	 */
 
-	if (DAT_SUCCESS != dat_strerror_major(value, major_message)) {
+	if (DAT_SUCCESS != dat_strerror_major(value, major_message))
 		return DAT_INVALID_PARAMETER;
-	} else if (minor_message != NULL) {
-		if (DAT_SUCCESS != dat_strerror_minor(value, minor_message)) {
+	else if (minor_message != NULL)
+		if (DAT_SUCCESS != dat_strerror_minor(value, minor_message))
 			return DAT_INVALID_PARAMETER;
-		}
-	}
 
 	return DAT_SUCCESS;
 }
 
 EXPORT_SYMBOL(dat_strerror);
 
-/***********************************************************************
- * Function: dat_registry_add_provider
- ***********************************************************************/
-
 u32 dat_registry_add_provider(const struct dat_provider *provider,
 			      const struct dat_provider_info *provider_info)
 {
@@ -733,10 +490,6 @@ u32 dat_registry_add_provider(const stru
 
 EXPORT_SYMBOL(dat_registry_remove_provider);
 
-/***********************************************************************
- * Function: dat_registry_remove_provider
- ***********************************************************************/
-
 u32 dat_registry_remove_provider(const struct dat_provider *provider,
 				 const struct dat_provider_info *provider_info)
 {
@@ -751,10 +504,6 @@ u32 dat_registry_remove_provider(const s
 
 EXPORT_SYMBOL(dat_registry_add_provider);
 
-/***********************************************************************
- *  Function: dat_registry_list_providers
- ***********************************************************************/
-
 u32 dat_registry_list_providers(int max_to_return, int *entries_returned,
 				struct dat_provider_info *(dat_provider_list[]))
 {
@@ -779,10 +528,9 @@ u32 dat_registry_list_providers(int max_
 		 */
 		(void)dat_dr_size(entries_returned);
 		return DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1);
-	} else {
+	} else
 		status = dat_dr_list(max_to_return, entries_returned,
                                      dat_provider_list);
-	}
 	return status;
 }
 
Index: linux-kernel-new/dat/dr.h
===================================================================
--- linux-kernel-new/dat/dr.h	(revision 2518)
+++ linux-kernel-new/dat/dr.h	(working copy)
@@ -36,12 +36,6 @@
 
 #include <dat.h>
 
-/*********************************************************************
- *                                                                   *
- * Function Declarations                                             *
- *                                                                   *
- *********************************************************************/
-
 extern void dat_dr_fini(void);
 
 extern u32 dat_dr_insert(const struct dat_provider_info *info,




More information about the general mailing list