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

James Lentini jlentini at netapp.com
Thu Jun 2 11:19:21 PDT 2005


I committed everything in revision 2526, except changing the name of 
dat_dictionary_key_is_equal to dat_dict_key_is_equal. I assumed that 
you did this to fit as much of the function declartion on one line as 
possible. I think I achieved the result you wanted by giving the 
parameters shorter names. Let me know if there was something else you 
were after.

james

On Wed, 1 Jun 2005, Tom Duffy wrote:

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



More information about the general mailing list