[openib-general] [PATCH] cleanup typedefs in ip2pr_proc.h

Tom Duffy Tom.Duffy at Sun.COM
Wed Aug 4 14:17:32 PDT 2004


Signed-by: Tom Duffy <tduffy at sun.com> with permission from Sun legal.

Index: drivers/infiniband/ulp/ipoib/ip2pr_proc.c
===================================================================
--- drivers/infiniband/ulp/ipoib/ip2pr_proc.c	(revision 583)
+++ drivers/infiniband/ulp/ipoib/ip2pr_proc.c	(working copy)
@@ -26,58 +26,73 @@
 static const char _dir_name_root[] = TS_IP2PR_PROC_DIR_NAME;
 static struct proc_dir_entry *_dir_root = NULL;
 
-extern tINT32 tsIp2prPathElementTableDump(tSTR buffer,
-					  tINT32 max_size,
-					  tINT32 start_index, long *end_index);
-extern tINT32 tsIp2prIpoibWaitTableDump(tSTR buffer,
-					tINT32 max_size,
-					tINT32 start_index, long *end_index);
-extern tINT32 tsIp2prProcRetriesRead(tSTR buffer,
-				     tINT32 max_size,
-				     tINT32 start_index, long *end_index);
-extern tINT32 tsIp2prProcTimeoutRead(tSTR buffer,
-				     tINT32 max_size,
-				     tINT32 start_index, long *end_index);
-extern tINT32 tsIp2prProcBackoffRead(tSTR buffer,
-				     tINT32 max_size,
-				     tINT32 start_index, long *end_index);
-extern tINT32 tsIp2prProcCacheTimeoutRead(tSTR buffer,
-					  tINT32 max_size,
-					  tINT32 start_index, long *end_index);
+extern s32 tsIp2prPathElementTableDump(tSTR buffer,
+				       s32 max_size,
+				       s32 start_index,
+				       long *end_index);
+extern s32 tsIp2prIpoibWaitTableDump(tSTR buffer,
+				     s32 max_size,
+				     s32 start_index,
+				     long *end_index);
+extern s32 tsIp2prProcRetriesRead(tSTR buffer,
+				  s32 max_size,
+				  s32 start_index,
+				  long *end_index);
+extern s32 tsIp2prProcTimeoutRead(tSTR buffer,
+				  s32 max_size,
+				  s32 start_index,
+				  long *end_index);
+extern s32 tsIp2prProcBackoffRead(tSTR buffer,
+				  s32 max_size,
+				  s32 start_index,
+				  long *end_index);
+extern s32 tsIp2prProcCacheTimeoutRead(tSTR buffer,
+				       s32 max_size,
+				       s32 start_index,
+				       long *end_index);
 extern int tsIp2prProcRetriesWrite(struct file *file,
 				   const char *buffer,
-				   unsigned long count, void *pos);
+				   unsigned long count,
+				   void *pos);
 extern int tsIp2prProcTimeoutWrite(struct file *file,
 				   const char *buffer,
-				   unsigned long count, void *pos);
+				   unsigned long count,
+				   void *pos);
 extern int tsIp2prProcBackoffWrite(struct file *file,
 				   const char *buffer,
-				   unsigned long count, void *pos);
+				   unsigned long count,
+				   void *pos);
 extern int tsIp2prProcCacheTimeoutWrite(struct file *file,
 					const char *buffer,
-					unsigned long count, void *pos);
+					unsigned long count,
+					void *pos);
 
 extern int tsIp2prProcTotalReq(tSTR buffer,
-			       tINT32 max_size,
-			       tINT32 start_index, long *end_index);
+			       s32 max_size,
+			       s32 start_index,
+			       long *end_index);
 extern int tsIp2prProcArpTimeout(tSTR buffer,
-				 tINT32 max_size,
-				 tINT32 start_index, long *end_index);
+				 s32 max_size,
+				 s32 start_index,
+				 long *end_index);
 extern int tsIp2prProcPathTimeout(tSTR buffer,
-				  tINT32 max_size,
-				  tINT32 start_index, long *end_index);
+				  s32 max_size,
+				  s32 start_index,
+				  long *end_index);
 extern int tsIp2prProcTotalFail(tSTR buffer,
-				tINT32 max_size,
-				tINT32 start_index, long *end_index);
+				s32 max_size,
+				s32 start_index,
+				long *end_index);
 
 /* ========================================================================= */
 /*.._tsIp2prProcReadParse -- read function for the injection table */
-static tINT32 _tsIp2prProcReadParse
-    (char *page,
-     char **start, off_t offset, tINT32 count, tINT32 * eof, tPTR data) {
-	tIP2PR_PROC_SUB_ENTRY sub_entry = (tIP2PR_PROC_SUB_ENTRY) data;
+static s32 _tsIp2prProcReadParse(char *page, char **start, off_t offset,
+				 s32 count, s32 *eof, tPTR data)
+{
+	struct ip2pr_proc_sub_entry *sub_entry =
+					(struct ip2pr_proc_sub_entry *) data;
 	long end_index = 0;
-	tINT32 size;
+	s32 size;
 
 	TS_CHECK_NULL(sub_entry, -EINVAL);
 
@@ -103,7 +118,7 @@
 	return size;
 }				/* _tsIp2prProcReadParse */
 
-static tIP2PR_PROC_SUB_ENTRY_STRUCT _file_entry_list[TS_IP2PR_PROC_ENTRIES] = {
+static struct ip2pr_proc_sub_entry _file_entry_list[TS_IP2PR_PROC_ENTRIES] = {
       {entry:NULL,
 	      type:TS_IP2PR_PROC_ENTRY_ARP_WAIT,
 	      name:"arp_wait",
@@ -158,10 +173,10 @@
 
 /* ========================================================================= */
 /*..tsIp2prProcFsCleanup -- cleanup the proc filesystem entries  */
-tINT32 tsIp2prProcFsCleanup(void
-    ) {
-	tIP2PR_PROC_SUB_ENTRY sub_entry;
-	tINT32 counter;
+s32 tsIp2prProcFsCleanup(void)
+{
+	struct ip2pr_proc_sub_entry *sub_entry;
+	s32 counter;
 
 	TS_CHECK_NULL(_dir_root, -EINVAL);
 	/*
@@ -189,19 +204,20 @@
 
 /* ========================================================================= */
 /*..tsIp2prProcFsInit -- initialize the proc filesystem entries  */
-tINT32 tsIp2prProcFsInit(void) {
-	tIP2PR_PROC_SUB_ENTRY sub_entry;
-	tINT32 result;
-	tINT32 counter;
+s32 tsIp2prProcFsInit(void)
+{
+	struct ip2pr_proc_sub_entry *sub_entry;
+	s32 result;
+	s32 counter;
 	/*
 	 * XXX still need to check this:
 	 * validate some assumptions the write parser will be making.
 	 */
-	if (0 && sizeof(tINT32) != sizeof(tSTR)) {
+	if (0 && sizeof(s32) != sizeof(tSTR)) {
 
 		TS_TRACE(MOD_IP2PR, T_TERSE, TRACE_FLOW_FATAL,
 			 "PROC: integers and pointers of a different size. <%d:%d>",
-			 sizeof(tINT32), sizeof(tSTR));
+			 sizeof(s32), sizeof(tSTR));
 		return -EFAULT;
 	}
 	/* if */
Index: drivers/infiniband/ulp/ipoib/ip2pr_proc.h
===================================================================
--- drivers/infiniband/ulp/ipoib/ip2pr_proc.h	(revision 583)
+++ drivers/infiniband/ulp/ipoib/ip2pr_proc.h	(working copy)
@@ -30,19 +30,18 @@
 /* --------------------------------------------------------------------- */
 /* read callback prototype.                                              */
 /* --------------------------------------------------------------------- */
-typedef tINT32(*tIP2PR_PROC_READ_CB_FUNC) (tSTR buffer,
-					   tINT32 max_size,
-					   tINT32 start, long *end);
-typedef struct tIP2PR_PROC_SUB_ENTRY_STRUCT tIP2PR_PROC_SUB_ENTRY_STRUCT,
-    *tIP2PR_PROC_SUB_ENTRY;
+typedef s32(*tIP2PR_PROC_READ_CB_FUNC) (tSTR buffer,
+					s32 max_size,
+					s32 start,
+					long *end);
 
-struct tIP2PR_PROC_SUB_ENTRY_STRUCT {
+struct ip2pr_proc_sub_entry {
 	tSTR name;
-	tINT32 type;
+	s32 type;
 	struct proc_dir_entry *entry;
 	tIP2PR_PROC_READ_CB_FUNC read;
 	write_proc_t *write;
-};				/* tIP2PR_PROC_SUB_ENTRY_STRUCT */
+};
 /* --------------------------------------------------------------------- */
 /* entry write parsing                                                   */
 /* --------------------------------------------------------------------- */
@@ -70,24 +69,19 @@
 	TS_IP2PR_PROC_ENTRIES	/* number of entries in framework */
 } TS_IP2PR_PROC_ENTRY_LIST;
 
-typedef struct tIP2PR_PROC_ENTRY_WRITE_STRUCT tIP2PR_PROC_ENTRY_WRITE_STRUCT,
-    *tIP2PR_PROC_ENTRY_WRITE;
-typedef struct tIP2PR_PROC_ENTRY_PARSE_STRUCT tIP2PR_PROC_ENTRY_PARSE_STRUCT,
-    *tIP2PR_PROC_ENTRY_PARSE;
-
-struct tIP2PR_PROC_ENTRY_WRITE_STRUCT {
-	tINT16 id;
-	tINT16 type;
+struct ip2pr_proc_entry_write {
+	s16 id;
+	s16 type;
 	union {
-		tINT32 i;
+		s32 i;
 		tSTR s;
 	} value;
-};				/* tIP2PR_PROC_WRITE_STRUCT */
+};
 
-struct tIP2PR_PROC_ENTRY_PARSE_STRUCT {
-	tINT16 id;
-	tINT16 type;
+struct ip2pr_proc_entry_parse {
+	s16 id;
+	s16 type;
 	tSTR value;
-};				/* tIP2PR_PROC_ENTRY_PARSE_STRUCT */
+};
 
 #endif				/* _TS_IP2PR_PROC_H */

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040804/50ff6679/attachment.sig>


More information about the general mailing list