[openib-general] [PATCH] kDAPL: remove the remaining typedef enums

Tom Duffy tduffy at sun.com
Thu Jun 16 11:35:57 PDT 2005


This patch removes the last remaining typedef enums (minus bool
which /might/ justify it).

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

Index: linux-kernel/dat-provider/dapl_cookie.c
===================================================================
--- linux-kernel/dat-provider/dapl_cookie.c	(revision 2640)
+++ linux-kernel/dat-provider/dapl_cookie.c	(working copy)
@@ -262,7 +262,8 @@ bail:
  *	DAT_INSUFFICIENT_EMPTY
  *
  */
-u32 dapl_dto_cookie_alloc(struct dapl_cookie_buffer *buffer, DAPL_DTO_TYPE type,
+u32 dapl_dto_cookie_alloc(struct dapl_cookie_buffer *buffer,
+			  enum dapl_dto_type type,
 			  DAT_DTO_COOKIE user_cookie, 
 			  struct dapl_cookie **cookie_ptr)
 {
Index: linux-kernel/dat-provider/dapl_openib_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_openib_util.c	(revision 2640)
+++ linux-kernel/dat-provider/dapl_openib_util.c	(working copy)
@@ -523,7 +523,7 @@ u32 dapl_ib_mw_unbind(struct dapl_rmr *r
  *
  */
 u32 dapl_ib_setup_async_callback(struct dapl_ia *ia_ptr,
-				 DAPL_ASYNC_HANDLER_TYPE handler_type,
+				 enum async_handler_type handler_type,
 				 ib_async_handler_t callback, void *context)
 {
 	int ib_status = 0;
Index: linux-kernel/dat-provider/dapl_cookie.h
===================================================================
--- linux-kernel/dat-provider/dapl_cookie.h	(revision 2640)
+++ linux-kernel/dat-provider/dapl_cookie.h	(working copy)
@@ -48,7 +48,8 @@ extern u32 dapl_rmr_cookie_alloc(struct 
 				 struct dapl_cookie **cookie_ptr);
 
 extern u32 dapl_dto_cookie_alloc(struct dapl_cookie_buffer *buffer,
-				 DAPL_DTO_TYPE type, DAT_DTO_COOKIE user_cookie,
+				 enum dapl_dto_type type,
+				 DAT_DTO_COOKIE user_cookie,
 				 struct dapl_cookie **cookie_ptr);
 
 extern void dapl_cookie_dealloc(struct dapl_cookie_buffer *buffer,
Index: linux-kernel/dat-provider/dapl_openib_util.h
===================================================================
--- linux-kernel/dat-provider/dapl_openib_util.h	(revision 2640)
+++ linux-kernel/dat-provider/dapl_openib_util.h	(working copy)
@@ -36,11 +36,11 @@
 #include "ib_verbs.h"
 #include "ib_cm.h"
 
-typedef enum async_handler_type {
+enum async_handler_type {
 	DAPL_ASYNC_UNAFILIATED,
 	DAPL_ASYNC_CQ_ERROR,
 	DAPL_ASYNC_QP_ERROR
-} DAPL_ASYNC_HANDLER_TYPE;
+};
 
 /* alignment for the bus transfer from the HCA/IB chip to the main memory */
 #define DAPL_OPTIMAL_ALIGNMENT   256
@@ -76,7 +76,7 @@ u32 dapl_ib_accept_connection(struct dap
 u32 dapl_ib_reject_connection(struct dapl_cm_ctx *cm_ctx);
 
 u32 dapl_ib_setup_async_callback(struct dapl_ia *ia,
-				 DAPL_ASYNC_HANDLER_TYPE handler_type,
+				 enum async_handler_type handler_type,
 				 ib_async_handler_t callback, void *context);
 
 u32 dapl_ib_cq_alloc(struct dapl_ia *ia, struct dapl_evd *evd, int *cqlen, 
Index: linux-kernel/dat-provider/dapl_ep.c
===================================================================
--- linux-kernel/dat-provider/dapl_ep.c	(revision 2640)
+++ linux-kernel/dat-provider/dapl_ep.c	(working copy)
@@ -168,7 +168,7 @@ static u32 dapl_ep_post_send_req(struct 
 				 DAT_DTO_COOKIE user_cookie,
 				 const struct dat_rmr_triplet *remote_iov,
 				 enum dat_completion_flags completion_flags,
-				 DAPL_DTO_TYPE dto_type, 
+				 enum dapl_dto_type dto_type, 
 				 enum ib_wr_opcode op_type)
 {
 	struct dapl_ep *ep_ptr;
Index: linux-kernel/dat-provider/dapl_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_util.c	(revision 2640)
+++ linux-kernel/dat-provider/dapl_util.c	(working copy)
@@ -36,7 +36,7 @@
 
 #ifdef DAPL_DBG
 
-void dapl_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...)
+void dapl_dbg_log(enum dapl_dbg_type type, const char *fmt, ...)
 {
         char buf[1024];
 	va_list args;
Index: linux-kernel/dat-provider/dapl_evd.c
===================================================================
--- linux-kernel/dat-provider/dapl_evd.c	(revision 2640)
+++ linux-kernel/dat-provider/dapl_evd.c	(working copy)
@@ -557,7 +557,7 @@ static void dapl_evd_wc_to_event(struct 
 		/* We can not check the following assert for now */
 		if (dto_status == DAT_DTO_SUCCESS) {
 			enum ib_wc_opcode ib_opcode = wc->opcode;
-			DAPL_DTO_TYPE dto_type = cookie->val.dto.type;
+			enum dapl_dto_type dto_type = cookie->val.dto.type;
 			dapl_os_assert((ib_opcode == IB_WC_SEND && 
 					dto_type == DAPL_DTO_TYPE_SEND) ||
 				       (ib_opcode == IB_WC_RECV && 
@@ -877,7 +877,7 @@ void dapl_evd_connection_callback(struct
 static void dapl_evd_dto_callback(struct ib_cq *cq, void *user_context)
 {
 	struct dapl_evd *evd;
-	DAPL_EVD_STATE state;
+	enum dapl_evd_state state;
 	u32 status;
 
 	dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK, "dapl_evd_dto_callback(%p, %p)\n",
@@ -888,7 +888,7 @@ static void dapl_evd_dto_callback(struct
 	dapl_os_assert(evd->cq == cq);
 
 	/* Read once.  */
-	state = *(volatile DAPL_EVD_STATE *)&evd->evd_state;
+	state = *(volatile enum dapl_evd_state *)&evd->evd_state;
 
 	dapl_dbg_log(DAPL_DBG_TYPE_EVD,
 		     "dapl_evd_dto_callback: CQ %p, state %x\n",
Index: linux-kernel/dat-provider/dapl_sp.c
===================================================================
--- linux-kernel/dat-provider/dapl_sp.c	(revision 2640)
+++ linux-kernel/dat-provider/dapl_sp.c	(working copy)
@@ -624,7 +624,7 @@ u32 dapl_psp_free(struct dat_sp *dat_psp
 {
 	struct dapl_ia *ia;
 	struct dapl_sp *sp;
-	DAPL_SP_STATE save_state;
+	enum dapl_sp_state save_state;
 	u32 status = DAT_SUCCESS;
 
 	sp = (struct dapl_sp *)dat_psp;
Index: linux-kernel/dat-provider/dapl_util.h
===================================================================
--- linux-kernel/dat-provider/dapl_util.h	(revision 2640)
+++ linux-kernel/dat-provider/dapl_util.h	(working copy)
@@ -167,7 +167,7 @@ static inline long dapl_os_mod64(uint64_
  * Use these bits to enable various tracing/debug options. Each bit
  * represents debugging in a particular subsystem or area of the code.
  */
-typedef enum {
+enum dapl_dbg_type {
 	DAPL_DBG_TYPE_ERR = 0x0001,
 	DAPL_DBG_TYPE_WARN = 0x0002,
 	DAPL_DBG_TYPE_EVD = 0x0004,
@@ -180,12 +180,12 @@ typedef enum {
 	DAPL_DBG_TYPE_RTN = 0x0200,
 	DAPL_DBG_TYPE_EXCEPTION = 0x0400,
 	DAPL_DBG_TYPE_SRQ = 0x0800
-} DAPL_DBG_TYPE;
+};
 
 typedef int DAPL_DBG_MASK;
 
 #if defined(DAPL_DBG)
-extern void dapl_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...);
+extern void dapl_dbg_log(enum dapl_dbg_type type, const char *fmt, ...);
 #else				/* !DAPL_DBG */
 #define dapl_dbg_log(...)
 #endif				/* DAPL_DBG */
Index: linux-kernel/dat-provider/dapl.h
===================================================================
--- linux-kernel/dat-provider/dapl.h	(revision 2640)
+++ linux-kernel/dat-provider/dapl.h	(working copy)
@@ -49,17 +49,17 @@
  *                                                                   *
  *********************************************************************/
 
-typedef enum dapl_evd_state {
+enum dapl_evd_state {
 	DAPL_EVD_STATE_OPEN,
 	DAPL_EVD_STATE_DEAD = 0xDEAD
-} DAPL_EVD_STATE;
+};
 
-typedef enum dapl_evd_completion {
+enum dapl_evd_completion {
 	DAPL_EVD_STATE_INIT,
 	DAPL_EVD_STATE_SOLICITED_WAIT,
 	DAPL_EVD_STATE_THRESHOLD,
 	DAPL_EVD_STATE_UNSIGNALLED
-} DAPL_EVD_COMPLETION;
+};
 
 /*********************************************************************
  *                                                                   *
@@ -161,7 +161,7 @@ struct dapl_evd {
 	struct dat_evd		evd;
 	struct dapl_common	common;
 	struct list_head	list;
-	DAPL_EVD_STATE		evd_state;
+	enum dapl_evd_state	evd_state;
 	enum dat_evd_flags	evd_flags;
 
 	/* Derived from evd_flags; see dapls_evd_internal_create.  */
@@ -265,19 +265,19 @@ struct dapl_rmr {
 };
 
 /* SP types, indicating the state and queue */
-typedef enum dapl_sp_state {
+enum dapl_sp_state {
 	DAPL_SP_STATE_FREE,
 	DAPL_SP_STATE_PSP_LISTENING,
 	DAPL_SP_STATE_PSP_PENDING,
 	DAPL_SP_STATE_RSP_LISTENING,
 	DAPL_SP_STATE_RSP_PENDING
-} DAPL_SP_STATE;
+};
 
 struct dapl_sp {
 	struct dat_sp sp;
 	struct dapl_common common;
 	struct list_head list;
-	DAPL_SP_STATE state;	/* type and queue of the SP */
+	enum dapl_sp_state state;	/* type and queue of the SP */
 
 	/* PSP/RSP PARAM fields */
 	struct dat_ia *ia;
@@ -313,22 +313,22 @@ struct dapl_cr {
 	struct dapl_sp *sp;
 };
 
-typedef enum dapl_dto_type {
+enum dapl_dto_type {
 	DAPL_DTO_TYPE_SEND,
 	DAPL_DTO_TYPE_RECV,
 	DAPL_DTO_TYPE_RDMA_WRITE,
 	DAPL_DTO_TYPE_RDMA_READ,
-} DAPL_DTO_TYPE;
+};
 
-typedef enum dapl_cookie_type {
+enum dapl_cookie_type {
 	DAPL_COOKIE_TYPE_NULL,
 	DAPL_COOKIE_TYPE_DTO,
 	DAPL_COOKIE_TYPE_RMR,
-} DAPL_COOKIE_TYPE;
+};
 
 /* struct dapl_dto_cookie used as context for DTO WQEs */
 struct dapl_dto_cookie {
-	DAPL_DTO_TYPE type;
+	enum dapl_dto_type type;
 	DAT_DTO_COOKIE cookie;
 	int size;		/* used for SEND and RDMA write */
 };
@@ -341,7 +341,7 @@ struct dapl_rmr_cookie {
 
 /* struct dapl_cookie used as context for WQEs */
 struct dapl_cookie {
-	DAPL_COOKIE_TYPE type;	/* Must be first, to define struct.  */
+	enum dapl_cookie_type type;	/* Must be first, to define struct.  */
 	struct dapl_ep *ep;
 	int index;
 	union {
Index: linux-kernel/dat/core.c
===================================================================
--- linux-kernel/dat/core.c	(revision 2640)
+++ linux-kernel/dat/core.c	(working copy)
@@ -43,7 +43,7 @@ static DAT_DBG_MASK g_dbg_mask = DAT_DBG
 module_param_named(dbg_mask, g_dbg_mask, int, 0644);
 MODULE_PARM_DESC(dbg_mask, "Bitmask to enable debug message types.");
 
-void dat_dbg_print(DAT_DBG_TYPE type, const char *fmt, ...)
+void dat_dbg_print(enum dat_dbg_type type, const char *fmt, ...)
 {
 	static char buf[1024];
 
Index: linux-kernel/dat/core.h
===================================================================
--- linux-kernel/dat/core.h	(revision 2640)
+++ linux-kernel/dat/core.h	(working copy)
@@ -45,17 +45,17 @@
 
 #define DAT_IS_BAD_POINTER(p) ( NULL == (p) )
 
-typedef enum {
+enum dat_dbg_type {
 	DAT_DBG_TYPE_ERROR        = (1 << 0),
 	DAT_DBG_TYPE_GENERIC      = (1 << 1),
 	DAT_DBG_TYPE_DR           = (1 << 2),
 	DAT_DBG_TYPE_PROVIDER_API = (1 << 3),
 	DAT_DBG_TYPE_CONSUMER_API = (1 << 4),
 	DAT_DBG_TYPE_ALL          = 0x1f
-} DAT_DBG_TYPE;
+};
 
 typedef int DAT_DBG_MASK;
 
-extern void dat_dbg_print(DAT_DBG_TYPE type, const char *fmt, ...);
+extern void dat_dbg_print(enum dat_dbg_type type, const char *fmt, ...);
 
 #endif /* CORE_H */




More information about the general mailing list