[openib-general] CHECK_NULL [was Re: SDP_CONN_LOCK]

Libor Michalek libor at topspin.com
Wed Feb 23 13:44:38 PST 2005


On Wed, Feb 23, 2005 at 11:46:34AM -0800, Libor Michalek wrote:
> On Wed, Feb 23, 2005 at 01:01:43PM +0200, Michael S. Tsirkin wrote:
> > Quoting r. Libor Michalek <libor at topspin.com>:
> > > Subject: Re: Re: SDP_CONN_LOCK
> > > 
> > > On Sun, Feb 20, 2005 at 02:11:37AM +0200, Michael S. Tsirkin wrote:
> > > > Quoting r. Libor Michalek <libor at topspin.com>:
> > > > > 
> > > > >   And here I would have thought SDP_CONN_HOLD as a macro would have
> > > > > bugged people more. :)
> > > >
> > > > Didn't get that far yet :)
> > > > 
> > > > I also wander whether we could get rid of most called to 
> > > > _CHECK macros, consequently turn lots of functions
> > > > which cant otherwise fail into void?
> > > > Given that these checks are disabled upon a compile switch, one wanders
> > > > how big a debugging aid they are.
> > > 
> > >   Yes, I think the _CHECK and EXPECT macros can be gotten rid of. Getting
> > > rid of _CHECK does have the added benefit of turning a lot of functions
> > > into void return functions, which in turn can get rid of most of the
> > > EXPECT macros. I do agree that there are quite a few function that return
> > > an status which can safely be turned into void functions.
> > > 
> > > -Libor
> > > 
> > 
> > Here's a patch to remove CHECK_NULL's, as a first step.
> > 
> > Signed-off-by: Michael s. Tsirkin <mst at mellanox.co.il>
> 
>   Thanks, I've applied and commited the change. I'll make a pass at turning
> some of the obvious int return functions into voids.

  Here is a pass at turning some of the more obvious functions into void
returns. I didn't convert any of the functions in sdp_wall.c, since I'm
working on moving some of them around at the moment.

-Libor

Signed-off-by: Libor Michalek <libor at topspin.com>

Index: sdp_kvec.c
===================================================================
--- sdp_kvec.c	(revision 1873)
+++ sdp_kvec.c	(working copy)
@@ -35,10 +35,6 @@
 #include "sdp_main.h"
 
 /*
- * static kvec internal functions
- */
-
-/*
  * _sdp_iocb_q_cancel_lookup_func - lookup function for cancelation
  */
 static int _sdp_iocb_q_cancel_lookup_func(struct sdpc_desc *element, void *arg)
@@ -47,26 +43,19 @@
 } /* _sdp_iocb_q_cancel_lookup_func */
 
 /*
- * Public write functions
- */
-
-/*
- * Cancel operations
- */
-
-/*
  * _sdp_iocb_q_cancel_read_pending - cancel all pending read AIOs
  */
-static int _sdp_iocb_q_cancel_read_pending(struct sdp_opt *conn, ssize_t error)
+static void _sdp_iocb_q_cancel_read_pending(struct sdp_opt *conn,
+					    ssize_t error)
 {
-	return sdp_iocb_q_cancel(&conn->r_pend, SDP_IOCB_F_ALL,
-					error);
+	sdp_iocb_q_cancel(&conn->r_pend, SDP_IOCB_F_ALL, error);
+	return;
 } /* _sdp_iocb_q_cancel_read_pending */
 
 /*
  * _sdp_iocb_q_cancel_read_source - cancel all pending read AIOs
  */
-static int _sdp_iocb_q_cancel_read_source(struct sdp_opt *conn, ssize_t error)
+static void _sdp_iocb_q_cancel_read_source(struct sdp_opt *conn, ssize_t error)
 {
 	struct sdpc_iocb *iocb;
 	int result;
@@ -74,28 +63,29 @@
 	while (NULL != (iocb = (struct sdpc_iocb *) sdp_desc_q_lookup(&conn->r_src,
 								   _sdp_iocb_q_cancel_lookup_func,
 								   NULL))) {
-		result = sdp_iocb_q_remove(iocb);
-		SDP_EXPECT(!(0 > result));
+		sdp_iocb_q_remove(iocb);
 
 		result = sdp_iocb_complete(iocb, error);
 		SDP_EXPECT(!(0 > result));
 	}
 
-	return 0;
+	return;
 } /* _sdp_iocb_q_cancel_read_source */
 
 /*
  * _sdp_iocb_q_cancel_read_snk - cancel all pending read AIOs
  */
-static int _sdp_iocb_q_cancel_read_snk(struct sdp_opt *conn, ssize_t error)
+static void _sdp_iocb_q_cancel_read_snk(struct sdp_opt *conn, ssize_t error)
 {
-	return sdp_iocb_q_cancel(&conn->r_snk, SDP_IOCB_F_ALL, error);
+	sdp_iocb_q_cancel(&conn->r_snk, SDP_IOCB_F_ALL, error);
+	return;
 } /* _sdp_iocb_q_cancel_read_snk */
 
 /*
  * _sdp_iocb_q_cancel_write_pending - cancel all pending read AIOs
  */
-static int _sdp_iocb_q_cancel_write_pending(struct sdp_opt *conn, ssize_t error)
+static void _sdp_iocb_q_cancel_write_pending(struct sdp_opt *conn,
+					     ssize_t error)
 {
 	struct sdpc_iocb *iocb;
 	int result;
@@ -105,28 +95,29 @@
 		(struct sdpc_iocb *) sdp_desc_q_lookup(&conn->send_queue,
 						    _sdp_iocb_q_cancel_lookup_func,
 						    NULL))) {
-		result = sdp_iocb_q_remove(iocb);
-		SDP_EXPECT(!(0 > result));
+		sdp_iocb_q_remove(iocb);
 
 		result = sdp_iocb_complete(iocb, error);
 		SDP_EXPECT(!(0 > result));
 	}
 
-	return 0;
+	return;
 } /* _sdp_iocb_q_cancel_write_pending */
 
 /*
  * _sdp_iocb_q_cancel_write_source - cancel all pending source AIOs
  */
-static int _sdp_iocb_q_cancel_write_source(struct sdp_opt *conn, ssize_t error)
+static void _sdp_iocb_q_cancel_write_source(struct sdp_opt *conn,
+					    ssize_t error)
 {
-	return sdp_iocb_q_cancel(&conn->w_src, SDP_IOCB_F_ALL, error);
+	sdp_iocb_q_cancel(&conn->w_src, SDP_IOCB_F_ALL, error);
+	return;
 } /* _sdp_iocb_q_cancel_write_source */
 
 /*
  * _sdp_iocb_q_cancel_write_snk - cancel all pending sink AIOs
  */
-static int _sdp_iocb_q_cancel_write_snk(struct sdp_opt *conn, ssize_t error)
+static void _sdp_iocb_q_cancel_write_snk(struct sdp_opt *conn, ssize_t error)
 {
 	struct sdpc_iocb *iocb;
 	int result;
@@ -134,66 +125,46 @@
 	while (NULL != (iocb = (struct sdpc_iocb *) sdp_desc_q_lookup(&conn->w_snk,
 								   _sdp_iocb_q_cancel_lookup_func,
 								   NULL))) {
-		result = sdp_iocb_q_remove(iocb);
-		SDP_EXPECT(!(0 > result));
+		sdp_iocb_q_remove(iocb);
 
 		result = sdp_iocb_complete(iocb, error);
 		SDP_EXPECT(!(0 > result));
 	}
 
-	return 0;
+	return;
 } /* _sdp_iocb_q_cancel_write_snk */
 
 /* 
  * sdp_iocb_q_cancel_all_read - cancel all outstanding read AIOs
  */
-int sdp_iocb_q_cancel_all_read(struct sdp_opt *conn, ssize_t error)
+void sdp_iocb_q_cancel_all_read(struct sdp_opt *conn, ssize_t error)
 {
-	int result;
+	_sdp_iocb_q_cancel_read_pending(conn, error);
+	_sdp_iocb_q_cancel_read_snk(conn, error);
+	_sdp_iocb_q_cancel_read_source(conn, error);
 
-	result = _sdp_iocb_q_cancel_read_pending(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	result = _sdp_iocb_q_cancel_read_snk(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	result = _sdp_iocb_q_cancel_read_source(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	return 0;
+	return;
 } /* sdp_iocb_q_cancel_all_read */
 
 /*
  * sdp_iocb_q_cancel_all_write - cancel all outstanding write AIOs
  */
-int sdp_iocb_q_cancel_all_write(struct sdp_opt *conn, ssize_t error)
+void sdp_iocb_q_cancel_all_write(struct sdp_opt *conn, ssize_t error)
 {
-	int result;
+	_sdp_iocb_q_cancel_write_pending(conn, error);
+	_sdp_iocb_q_cancel_write_source(conn, error);
+	_sdp_iocb_q_cancel_write_snk(conn, error);
 
-	result = _sdp_iocb_q_cancel_write_pending(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	result = _sdp_iocb_q_cancel_write_source(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	result = _sdp_iocb_q_cancel_write_snk(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	return 0;
+	return;
 } /* sdp_iocb_q_cancel_all_write */
 
 /*
  * sdp_iocb_q_cancel_all - cancel all outstanding AIOs
  */
-int sdp_iocb_q_cancel_all(struct sdp_opt *conn, ssize_t error)
+void sdp_iocb_q_cancel_all(struct sdp_opt *conn, ssize_t error)
 {
-	int result;
+	sdp_iocb_q_cancel_all_read(conn, error);
+	sdp_iocb_q_cancel_all_write(conn, error);
 
-	result = sdp_iocb_q_cancel_all_read(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	result = sdp_iocb_q_cancel_all_write(conn, error);
-	SDP_EXPECT(!(0 > result));
-
-	return 0;
+	return;
 } /* sdp_iocb_q_cancel_all */
Index: sdp_write.c
===================================================================
--- sdp_write.c	(revision 1873)
+++ sdp_write.c	(working copy)
@@ -57,9 +57,7 @@
 			/*
 			 * clear posted buffers from error'd queue
 			 */
-			result = sdp_desc_q_clear(&conn->w_snk);
-			SDP_EXPECT(!(0 > result));
-
+			sdp_desc_q_clear(&conn->w_snk);
 			result = 0;
 			break;
 		default:
Index: sdp_rcvd.c
===================================================================
--- sdp_rcvd.c	(revision 1873)
+++ sdp_rcvd.c	(working copy)
@@ -454,11 +454,9 @@
 		 * immediate completion
 		 */
 		if (0 < (SDP_ADVT_F_READ & advt->flag)) {
-			advt = sdp_advt_q_get(&conn->src_pend);
-			SDP_EXPECT((NULL != advt));
 
-			result = sdp_advt_q_put(&conn->src_actv, advt);
-			SDP_EXPECT(!(0 > result));
+			sdp_advt_q_put(&conn->src_actv,
+				       sdp_advt_q_get(&conn->src_pend));
 			/*
 			 * keep track of cancellations
 			 */
@@ -780,11 +778,7 @@
 	conn->s_cur_adv = 1;
 	conn->s_par_adv = 0;
 
-	result = sdp_advt_q_put(&conn->snk_pend, advt);
-	if (0 > result) {
-		sdp_dbg_warn(conn, "SnkAvail cannot be saved. <%d>", result);
-		goto advt_error;
-	}
+	sdp_advt_q_put(&conn->snk_pend, advt);
 
 consume:
 	conn->s_wq_cur = SDP_SEND_POST_SLOW;
@@ -812,9 +806,6 @@
 	 * PostRecv will take care of consuming this advertisment, based
 	 * on result.
 	 */
-	return result;
-advt_error:
-	(void)sdp_advt_destroy(advt);
 error:
 	return result;
 } /* _sdp_rcvd_snk_avail */
@@ -946,16 +937,14 @@
 	 */
 	conn->src_recv++;
 
-	result = sdp_advt_q_put(&conn->src_pend, advt);
-	if (0 > result) {
-		sdp_dbg_warn(conn, "Error <%d> queuing SrcAvail", result);
-		goto advt_error;
-	}
+	sdp_advt_q_put(&conn->src_pend, advt);
 	/*
 	 * process any ULP data in the message
 	 */
-	if (0 == size)
+	if (0 == size) {
+		result = 0;
 		goto done;
+	}
 	/*
 	 * update non-discard for sink advertisment management
 	 */
@@ -1116,11 +1105,9 @@
 			/*
 			 * clear posted buffers from error'd queue
 			 */
-			result = sdp_buff_q_clear_unmap(&conn->recv_post,
-							conn->ca->dma_device,
-							PCI_DMA_FROMDEVICE);
-			SDP_EXPECT(!(0 > result));
-
+			sdp_buff_q_clear_unmap(&conn->recv_post,
+					       conn->ca->dma_device,
+					       PCI_DMA_FROMDEVICE);
 			result = 0;
 			break;
 		default:
Index: sdp_inet.c
===================================================================
--- sdp_inet.c	(revision 1873)
+++ sdp_inet.c	(working copy)
@@ -422,8 +422,7 @@
 		 */
 		if (0 < (SDP_ST_MASK_DRAIN & conn->istate)) {
 
-			result = sdp_iocb_q_cancel_all_write(conn, -ECANCELED);
-			SDP_EXPECT(!(0 > result));
+			sdp_iocb_q_cancel_all_write(conn, -ECANCELED);
 
 			result = _sdp_inet_disconnect(conn);
 			SDP_EXPECT(!(0 > result));
@@ -1553,7 +1552,7 @@
 error_buff:
 	(void)sdp_link_addr_cleanup();
 error_link:
-	(void)sdp_main_advt_cleanup();
+	sdp_main_advt_cleanup();
 error_advt:
 	(void)sdp_main_proc_cleanup();
 error_proc:
@@ -1585,7 +1584,7 @@
 	/*
 	 * delete advertisment table
 	 */
-	(void)sdp_main_advt_cleanup();
+	sdp_main_advt_cleanup();
 	/*
 	 * proc tables
 	 */
Index: sdp_proto.h
===================================================================
--- sdp_proto.h	(revision 1873)
+++ sdp_proto.h	(working copy)
@@ -53,19 +53,20 @@
 
 int sdp_buff_pool_chain_put(struct sdpc_buff *buff, u32 count);
 
-int sdp_buff_pool_chain_link(struct sdpc_buff *head, struct sdpc_buff *buff);
+void sdp_buff_pool_chain_link(struct sdpc_buff *head, struct sdpc_buff *buff);
 
 int sdp_buff_pool_buff_size(void);
 
-int sdp_buff_q_init(struct sdpc_buff_q *pool, u32 size);
+void sdp_buff_q_init(struct sdpc_buff_q *pool);
 
-int sdp_buff_q_clear_unmap(struct sdpc_buff_q *pool,
-			   struct device *dev,
-			   int direction);
+void sdp_buff_q_clear_unmap(struct sdpc_buff_q *pool,
+			    struct device *dev,
+			    int direction);
 
-static inline int sdp_buff_q_clear(struct sdpc_buff_q *pool)
+static inline void sdp_buff_q_clear(struct sdpc_buff_q *pool)
 {
-	return sdp_buff_q_clear_unmap(pool, NULL, 0);
+	sdp_buff_q_clear_unmap(pool, NULL, 0);
+	return;
 }
 
 int sdp_buff_q_remove(struct sdpc_buff *buff);
@@ -143,11 +144,11 @@
  */
 int sdp_main_advt_init(void);
 
-int sdp_main_advt_cleanup(void);
+void sdp_main_advt_cleanup(void);
 
-int sdp_advt_q_init(struct sdpc_advt_q *table);
+void sdp_advt_q_init(struct sdpc_advt_q *table);
 
-int sdp_advt_q_clear(struct sdpc_advt_q *table);
+void sdp_advt_q_clear(struct sdpc_advt_q *table);
 
 struct sdpc_advt *sdp_advt_create(void);
 
@@ -157,18 +158,18 @@
 
 struct sdpc_advt *sdp_advt_q_look(struct sdpc_advt_q *table);
 
-int sdp_advt_q_put(struct sdpc_advt_q *table, struct sdpc_advt *advt);
+void sdp_advt_q_put(struct sdpc_advt_q *table, struct sdpc_advt *advt);
 
 /*
  * Zcopy IOCB managment
  */
 int sdp_main_iocb_init(void);
 
-int sdp_main_iocb_cleanup(void);
+void sdp_main_iocb_cleanup(void);
 
-int sdp_iocb_q_init(struct sdpc_iocb_q *table);
+void sdp_iocb_q_init(struct sdpc_iocb_q *table);
 
-int sdp_iocb_q_clear(struct sdpc_iocb_q *table);
+void sdp_iocb_q_clear(struct sdpc_iocb_q *table);
 
 struct sdpc_iocb *sdp_iocb_create(void);
 
@@ -186,9 +187,9 @@
 
 struct sdpc_iocb *sdp_iocb_q_lookup(struct sdpc_iocb_q *table, u32 key);
 
-int sdp_iocb_q_cancel(struct sdpc_iocb_q *table, u32 mask, ssize_t comp);
+void sdp_iocb_q_cancel(struct sdpc_iocb_q *table, u32 mask, ssize_t comp);
 
-int sdp_iocb_q_remove(struct sdpc_iocb *iocb);
+void sdp_iocb_q_remove(struct sdpc_iocb *iocb);
 
 int sdp_iocb_register(struct sdpc_iocb *iocb, struct sdp_opt *conn);
 
@@ -203,7 +204,7 @@
 /*
  * Generic object managment
  */
-int sdp_desc_q_remove(struct sdpc_desc *element);
+void sdp_desc_q_remove(struct sdpc_desc *element);
 
 struct sdpc_desc *sdp_desc_q_get_head(struct sdpc_desc_q *table);
 
@@ -233,9 +234,9 @@
 int sdp_desc_q_types_size(struct sdpc_desc_q *table,
 			  enum sdp_desc_type type);
 
-int sdp_desc_q_init(struct sdpc_desc_q *table);
+void sdp_desc_q_init(struct sdpc_desc_q *table);
 
-int sdp_desc_q_clear(struct sdpc_desc_q *table);
+void sdp_desc_q_clear(struct sdpc_desc_q *table);
 
 /*
  * proc entry managment
@@ -422,11 +423,11 @@
 		  size_t size, 
 		  int    flags);
 
-int sdp_iocb_q_cancel_all_read(struct sdp_opt *conn, ssize_t error);
+void sdp_iocb_q_cancel_all_read(struct sdp_opt *conn, ssize_t error);
 
-int sdp_iocb_q_cancel_all_write(struct sdp_opt *conn, ssize_t error);
+void sdp_iocb_q_cancel_all_write(struct sdp_opt *conn, ssize_t error);
 
-int sdp_iocb_q_cancel_all(struct sdp_opt *conn, ssize_t error);
+void sdp_iocb_q_cancel_all(struct sdp_opt *conn, ssize_t error);
 
 /*
  * link address information
Index: sdp_read.c
===================================================================
--- sdp_read.c	(revision 1873)
+++ sdp_read.c	(working copy)
@@ -123,9 +123,7 @@
 			/*
 			 * clear posted buffers from error'd queue
 			 */
-			result = sdp_desc_q_clear(&conn->r_src);
-			SDP_EXPECT(!(0 > result));
-
+			sdp_desc_q_clear(&conn->r_src);
 			result = 0;
 			break;
 		default:
Index: sdp_send.c
===================================================================
--- sdp_send.c	(revision 1873)
+++ sdp_send.c	(working copy)
@@ -124,10 +124,8 @@
 	/*
 	 * check queue membership. (first send attempt vs. flush)
 	 */
-	if (0 < sdp_desc_q_member((struct sdpc_desc *) buff)) {
-		result = sdp_desc_q_remove((struct sdpc_desc *) buff);
-		SDP_EXPECT(!(0 > result));
-	}
+	if (0 < sdp_desc_q_member((struct sdpc_desc *) buff))
+		sdp_desc_q_remove((struct sdpc_desc *) buff);
 	/*
 	 * save the buffer for the event handler.
 	 */
@@ -371,10 +369,8 @@
 	/*
 	 * dequeue if needed and the queue buffer
 	 */
-	if (0 < sdp_desc_q_member((struct sdpc_desc *) buff)) {
-		result = sdp_desc_q_remove((struct sdpc_desc *) buff);
-		SDP_EXPECT(!(0 > result));
-	}
+	if (0 < sdp_desc_q_member((struct sdpc_desc *) buff))
+		sdp_desc_q_remove((struct sdpc_desc *) buff);
 
 	result = sdp_desc_q_put_tail(&conn->w_snk, (struct sdpc_desc *)buff);
         if (0 > result) {
@@ -872,15 +868,11 @@
 			 * callers to determine the fate of the IOCB on
 			 * failure or partial processing.
 			 */
-			if (0 < sdp_desc_q_member((struct sdpc_desc *)iocb)) {
-				result =
-				    sdp_desc_q_remove((struct sdpc_desc *)
-							    iocb);
-				SDP_EXPECT(!(0 > result));
-			}
+			if (0 < sdp_desc_q_member((struct sdpc_desc *)iocb))
+				sdp_desc_q_remove((struct sdpc_desc *)iocb);
 
 			result = sdp_desc_q_put_tail(&conn->w_snk,
-						     (struct sdpc_desc *) iocb);
+						     (struct sdpc_desc *)iocb);
 			if (0 > result) {
 				sdp_dbg_warn(conn, 
 					     "Error <%d> queuing write IOCB.",
@@ -906,10 +898,8 @@
 			/*
 			 * complete this IOCB
 			 */
-			if (0 < sdp_desc_q_member((struct sdpc_desc *) iocb)) {
-				result = sdp_desc_q_remove((struct sdpc_desc *) iocb);
-				SDP_EXPECT(!(0 > result));
-			}
+			if (0 < sdp_desc_q_member((struct sdpc_desc *) iocb))
+				sdp_desc_q_remove((struct sdpc_desc *) iocb);
 
 			SDP_CONN_STAT_WRITE_INC(conn, iocb->post);
 			SDP_CONN_STAT_WQ_DEC(conn, iocb->size);
@@ -929,10 +919,8 @@
 		/*
 		 * queue IOCB
 		 */
-		if (0 < sdp_desc_q_member((struct sdpc_desc *) iocb)) {
-			result = sdp_desc_q_remove((struct sdpc_desc *)iocb);
-			SDP_EXPECT(!(0 > result));
-		}
+		if (0 < sdp_desc_q_member((struct sdpc_desc *) iocb))
+			sdp_desc_q_remove((struct sdpc_desc *)iocb);
 
 		result = sdp_iocb_q_put_tail(&conn->w_src, iocb);
 		if (0 > result)
@@ -1840,8 +1828,7 @@
 		 * always remove the IOCB.
 		 * If active, then place it into the correct active queue
 		 */
-		result = sdp_desc_q_remove((struct sdpc_desc *)iocb);
-		SDP_EXPECT(!(0 > result));
+		sdp_desc_q_remove((struct sdpc_desc *)iocb);
 		
 		if (0 < (SDP_IOCB_F_ACTIVE & iocb->flags)) {
 			if (0 < (SDP_IOCB_F_RDMA_W & iocb->flags)) {
Index: sdp_conn.c
===================================================================
--- sdp_conn.c	(revision 1873)
+++ sdp_conn.c	(working copy)
@@ -638,38 +638,38 @@
 	 * really there shouldn't be anything in these tables, but it's
 	 * really bad if we leave a dangling reference here.
 	 */
-	(void)sdp_iocb_q_cancel_all(conn, -ECANCELED);
-	(void)sdp_iocb_q_clear(&conn->r_pend);
-	(void)sdp_iocb_q_clear(&conn->r_snk);
-	(void)sdp_iocb_q_clear(&conn->w_src);
+	sdp_iocb_q_cancel_all(conn, -ECANCELED);
+	sdp_iocb_q_clear(&conn->r_pend);
+	sdp_iocb_q_clear(&conn->r_snk);
+	sdp_iocb_q_clear(&conn->w_src);
 
-	(void)sdp_desc_q_clear(&conn->r_src);
-	(void)sdp_desc_q_clear(&conn->w_snk);
+	sdp_desc_q_clear(&conn->r_src);
+	sdp_desc_q_clear(&conn->w_snk);
 	/*
 	 * clear the buffer pools
 	 */
-	(void)sdp_buff_q_clear(&conn->recv_pool);
+	sdp_buff_q_clear(&conn->recv_pool);
 
 	if (conn->ca) {
-		(void)sdp_buff_q_clear_unmap(&conn->send_post,
-					     conn->ca->dma_device,
-					     PCI_DMA_TODEVICE);
-		(void)sdp_buff_q_clear_unmap(&conn->recv_post,
-					     conn->ca->dma_device,
-					     PCI_DMA_FROMDEVICE);
+		sdp_buff_q_clear_unmap(&conn->send_post,
+				       conn->ca->dma_device,
+				       PCI_DMA_TODEVICE);
+		sdp_buff_q_clear_unmap(&conn->recv_post,
+				       conn->ca->dma_device,
+				       PCI_DMA_FROMDEVICE);
 	}
 
 	/*
 	 * clear advertisment tables
 	 */
-	(void)sdp_advt_q_clear(&conn->src_pend);
-	(void)sdp_advt_q_clear(&conn->src_actv);
-	(void)sdp_advt_q_clear(&conn->snk_pend);
+	sdp_advt_q_clear(&conn->src_pend);
+	sdp_advt_q_clear(&conn->src_actv);
+	sdp_advt_q_clear(&conn->snk_pend);
 	/*
 	 * generic table clear
 	 */
-	(void)sdp_desc_q_clear(&conn->send_ctrl);
-	(void)sdp_desc_q_clear(&conn->send_queue);
+	sdp_desc_q_clear(&conn->send_ctrl);
+	sdp_desc_q_clear(&conn->send_queue);
 	/*
 	 * If the QP owner is not the CM, then destroy.
 	 */
@@ -908,13 +908,13 @@
 /*
  * _sdp_conn_lock_init - initialize connection lock
  */
-static int _sdp_conn_lock_init(struct sdp_opt *conn)
+static void _sdp_conn_lock_init(struct sdp_opt *conn)
 {
 	spin_lock_init(&(conn->lock.slock));
 	conn->lock.users = 0;
 	init_waitqueue_head(&(conn->lock.waitq));
 
-	return 0;
+	return;
 } /* _sdp_conn_lock_init */
 
 /*
@@ -1233,47 +1233,33 @@
 	/*
 	 * generic send queue
 	 */
-	result = sdp_desc_q_init(&conn->send_queue);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_desc_q_init(&conn->send_ctrl);
-	SDP_EXPECT(!(0 > result));
+	sdp_desc_q_init(&conn->send_queue);
+	sdp_desc_q_init(&conn->send_ctrl);
 	/*
 	 * create buffer pools for posted events
 	 */
-	result = sdp_buff_q_init(&conn->recv_post, 0);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_buff_q_init(&conn->recv_pool, 0);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_buff_q_init(&conn->send_post, 0);
-	SDP_EXPECT(!(0 > result));
+	sdp_buff_q_init(&conn->recv_post);
+	sdp_buff_q_init(&conn->recv_pool);
+	sdp_buff_q_init(&conn->send_post);
 	/*
 	 * initialize zcopy advertisment tables
 	 */
-	result = sdp_advt_q_init(&conn->src_pend);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_advt_q_init(&conn->src_actv);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_advt_q_init(&conn->snk_pend);
-	SDP_EXPECT(!(0 > result));
+	sdp_advt_q_init(&conn->src_pend);
+	sdp_advt_q_init(&conn->src_actv);
+	sdp_advt_q_init(&conn->snk_pend);
 	/*
 	 * initialize zcopy iocb tables
 	 */
-	result = sdp_iocb_q_init(&conn->r_pend);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_iocb_q_init(&conn->r_snk);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_iocb_q_init(&conn->w_src);
-	SDP_EXPECT(!(0 > result));
+	sdp_iocb_q_init(&conn->r_pend);
+	sdp_iocb_q_init(&conn->r_snk);
+	sdp_iocb_q_init(&conn->w_src);
 
-	result = sdp_desc_q_init(&conn->r_src);
-	SDP_EXPECT(!(0 > result));
-	result = sdp_desc_q_init(&conn->w_snk);
-	SDP_EXPECT(!(0 > result));
+	sdp_desc_q_init(&conn->r_src);
+	sdp_desc_q_init(&conn->w_snk);
 	/*
 	 * connection lock
 	 */
-	result = _sdp_conn_lock_init(conn);
-	SDP_EXPECT(!(0 > result));
+	_sdp_conn_lock_init(conn);
 	/*
 	 * insert connection into lookup table
 	 */
@@ -2007,7 +1993,7 @@
 error_sock:
 	kmem_cache_destroy(_dev_root_s.conn_cache);
 error_conn:
-	(void)sdp_main_iocb_cleanup();
+	sdp_main_iocb_cleanup();
 error_iocb:
 	_dev_root_s.sk_array--;
 	free_pages((unsigned long)_dev_root_s.sk_array, _dev_root_s.sk_ordr);
@@ -2057,7 +2043,7 @@
 	/*
 	 * delete IOCB table
 	 */
-	(void)sdp_main_iocb_cleanup();
+	sdp_main_iocb_cleanup();
 
 	return 0;
 } /* sdp_conn_table_clear */
Index: sdp_advt.c
===================================================================
--- sdp_advt.c	(revision 1873)
+++ sdp_advt.c	(working copy)
@@ -125,7 +125,7 @@
 /*
  * sdp_advt_q_put - put the advertisment object at the tables tail
  */
-int sdp_advt_q_put(struct sdpc_advt_q *table, struct sdpc_advt *advt)
+void sdp_advt_q_put(struct sdpc_advt_q *table, struct sdpc_advt *advt)
 {
 	struct sdpc_advt *next;
 	struct sdpc_advt *prev;
@@ -147,24 +147,24 @@
 
 	table->size++;
 
-	return 0;
+	return;
 } /* sdp_advt_q_put */
 
 /*
  * sdp_advt_q_init - initialize a new empty advertisment table
  */
-int sdp_advt_q_init(struct sdpc_advt_q *table)
+void sdp_advt_q_init(struct sdpc_advt_q *table)
 {
 	table->head = NULL;
 	table->size = 0;
 
-	return 0;
+	return;
 } /* sdp_advt_q_init */
 
 /*
  * sdp_advt_q_clear - clear the contents of an advertisment table
  */
-int sdp_advt_q_clear(struct sdpc_advt_q *table)
+void sdp_advt_q_clear(struct sdpc_advt_q *table)
 {
 	struct sdpc_advt *advt;
 	int result;
@@ -177,7 +177,7 @@
 		SDP_EXPECT(!(0 > result));
 	}
 
-	return 0;
+	return;
 } /* sdp_advt_q_clear */
 
 /*
@@ -189,8 +189,6 @@
  */
 int sdp_main_advt_init(void)
 {
-	int result;
-
 	sdp_dbg_init("Advertisment cache initialization.");
 	/*
 	 * initialize the caches only once.
@@ -204,20 +202,16 @@
 					     sizeof(struct sdpc_advt),
 					     0, SLAB_HWCACHE_ALIGN, NULL,
 					     NULL);
-	if (NULL == __sdp_advt_cache) {
-		result = -ENOMEM;
-		goto error_advt_c;
-	}
+	if (NULL == __sdp_advt_cache)
+		return -ENOMEM;
 
 	return 0;
-error_advt_c:
-	return 0;
 } /* sdp_main_advt_init */
 
 /*
  * sdp_main_advt_cleanup - cleanup the advertisment caches.
  */
-int sdp_main_advt_cleanup(void)
+void sdp_main_advt_cleanup(void)
 {
 	sdp_dbg_init("Advertisment cache cleanup.");
 	/*
@@ -229,5 +223,5 @@
 	 */
 	__sdp_advt_cache = NULL;
 
-	return 0;
+	return;
 } /* sdp_main_advt_cleanup */
Index: sdp_recv.c
===================================================================
--- sdp_recv.c	(revision 1873)
+++ sdp_recv.c	(working copy)
@@ -172,24 +172,9 @@
 	 * If there is no more advertised space move the advertisment to the
 	 * active list, and match the WRID.
 	 */
-	if (!(0 < advt->size)) {
-		advt = sdp_advt_q_get(&conn->src_pend);
-		if (NULL == advt) {
-			sdp_dbg_warn(conn, "SrcAvail disappeared. <%d>",
-				     sdp_advt_q_size(&conn->src_pend));
-			result = -ENODEV;
-			goto drop;
-		}
-
-		result = sdp_advt_q_put(&conn->src_actv, advt);
-		if (0 > result) {
-			sdp_dbg_warn(conn, "Error <%d> queuing active src",
-				     result);
-
-			(void)sdp_advt_destroy(advt);
-			goto drop;
-		}
-	}
+	if (!(0 < advt->size))
+		sdp_advt_q_put(&conn->src_actv,
+			       sdp_advt_q_get(&conn->src_pend));
 	/*
 	 * save the buffer for the event handler. Make sure it's before
 	 * actually posting the thing. Completion event can happen before
@@ -312,23 +297,9 @@
 	 * if there is no more advertised space,  queue the
 	 * advertisment for completion
 	 */
-	if (!(0 < advt->size)) {
-		advt = sdp_advt_q_get(&conn->src_pend);
-		if (NULL == advt) {
-			sdp_dbg_warn(conn, "SrcAvail disappeared. <%d>",
-				     sdp_advt_q_size(&conn->src_pend));
-			result = -ENODEV;
-			goto error;
-		}
-
-		result = sdp_advt_q_put(&conn->src_actv, advt);
-		if (0 > result) {
-			sdp_dbg_warn(conn, "Error <%d> queuing active src",
-				     result);
-			(void)sdp_advt_destroy(advt);
-			goto error;
-		}
-	}
+	if (!(0 < advt->size))
+		sdp_advt_q_put(&conn->src_actv,
+			       sdp_advt_q_get(&conn->src_pend));
 	/*
 	 * if there is no more iocb space queue the it for completion
 	 */
@@ -981,8 +952,7 @@
 		 * the correct active queue. Inactive empty IOCBs can be
 		 * deleted, while inactive partials needs to be compelted.
 		 */
-		result = sdp_iocb_q_remove(iocb);
-		SDP_EXPECT(!(0 > result));
+		sdp_iocb_q_remove(iocb);
 
 		if (0 == (SDP_IOCB_F_ACTIVE & iocb->flags)) {
 			if (0 < iocb->post) {
@@ -1225,7 +1195,7 @@
 		return -EOPNOTSUPP;
 
 	if (0 < (MSG_PEEK & flags)) {
-		(void)sdp_buff_q_init(&peek_queue, 0);
+		sdp_buff_q_init(&peek_queue);
 		msg->msg_flags |= MSG_PEEK;
 	}
 
@@ -1356,8 +1326,7 @@
 				 * will be returned to the free pool
 				 * in one group.
 				 */
-				expect = sdp_buff_pool_chain_link(head, buff);
-				SDP_EXPECT(!(0 > expect));
+				sdp_buff_pool_chain_link(head, buff);
 
 				head = buff;
 				free_count++;
Index: sdp_wall.c
===================================================================
--- sdp_wall.c	(revision 1873)
+++ sdp_wall.c	(working copy)
@@ -182,15 +182,13 @@
 		/*
 		 * clear the pending control buffer.
 		 */
-		result = sdp_desc_q_clear(&conn->send_ctrl);
-		SDP_EXPECT(!(0 > result));
+		sdp_desc_q_clear(&conn->send_ctrl);
 		/*
 		 * fall through
 		 */
 	case SDP_CONN_ST_DIS_SEND_1:	/* don't touch control queue, diconnect
 					   message may still be queued. */
-		result = sdp_desc_q_clear(&conn->send_queue);
-		SDP_EXPECT(!(0 > result));
+		sdp_desc_q_clear(&conn->send_queue);
 		/*
 		 * post abort
 		 */
@@ -283,8 +281,6 @@
  */
 int sdp_wall_recv_reject(struct sdp_opt *conn, int error)
 {
-	int result;
-
 	sdp_dbg_ctrl(conn, "Reject recv. src <%08x:%04x> dst <%08x:%04x> <%d>",
 		     conn->src_addr, conn->src_port, 
 		     conn->dst_addr, conn->dst_port, error);
@@ -297,10 +293,7 @@
 	conn->istate = SDP_SOCK_ST_ERROR;
 	conn->shutdown = SHUTDOWN_MASK;
 
-	result = sdp_iocb_q_cancel_all(conn, (0 - error));
-	if (0 > result)
-		sdp_dbg_warn(conn, "Error <%d> canceling outstanding IOCBs",
-			     result);
+	sdp_iocb_q_cancel_all(conn, (0 - error));
 
 	sdp_inet_wake_error(conn->sk);
 
@@ -411,8 +404,6 @@
  */
 int sdp_wall_recv_close(struct sdp_opt *conn)
 {
-	int result;
-
 	sdp_dbg_ctrl(conn, "Close recv. src <%08x:%04x> dst <%08x:%04x>",
 		     conn->src_addr, conn->src_port, 
 		     conn->dst_addr, conn->dst_port);
@@ -436,11 +427,7 @@
 		 * cancel all outstanding read AIO's since there will be
 		 * no more data from the peer.
 		 */
-		result = sdp_iocb_q_cancel_all_read(conn, 0);
-		if (0 > result)
-			sdp_dbg_warn(conn, 
-				     "Error <%d> canceling outstanding IOCBs",
-				     result);
+		sdp_iocb_q_cancel_all_read(conn, 0);
 		/*
 		 * async notification. POLL_HUP on full duplex close only.
 		 */
@@ -458,8 +445,6 @@
  */
 int sdp_wall_recv_closing(struct sdp_opt *conn)
 {
-	int result;
-
 	sdp_dbg_ctrl(conn, "Closing recv. src <%08x:%04x> dst <%08x:%04x>",
 		     conn->src_addr, conn->src_port, 
 		     conn->dst_addr, conn->dst_port);
@@ -475,15 +460,11 @@
 	 * cancel all outstanding read AIO's since there will be no more data
 	 * from the peer.
 	 */
-	result = sdp_iocb_q_cancel_all_read(conn, 0);
-	if (0 > result)
-		sdp_dbg_warn(conn, "Error <%d> canceling outstanding IOCBs",
-			     result);
-
-	sdp_inet_wake_generic(conn->sk);
+	sdp_iocb_q_cancel_all_read(conn, 0);
 	/*
 	 * async notification. POLL_HUP on full duplex close only.
 	 */
+	sdp_inet_wake_generic(conn->sk);
 	sk_wake_async(conn->sk, 1, POLL_HUP);
 
 	return 0;
@@ -494,8 +475,6 @@
  */
 int sdp_wall_recv_abort(struct sdp_opt *conn)
 {
-	int result;
-
 	sdp_dbg_ctrl(conn, "Abort recv. src <%08x:%04x> dst <%08x:%04x>",
 		     conn->src_addr, conn->src_port, 
 		     conn->dst_addr, conn->dst_port);
@@ -524,10 +503,7 @@
 	/*
 	 * cancel all outstanding IOCBs
 	 */
-	result = sdp_iocb_q_cancel_all(conn, -ECONNRESET);
-	if (0 > result)
-		sdp_dbg_warn(conn, "Error <%d> canceling outstanding IOCBs",
-			     result);
+	sdp_iocb_q_cancel_all(conn, -ECONNRESET);
 
 	sdp_inet_wake_error(conn->sk);
 
@@ -581,10 +557,7 @@
 		/*
 		 * cancel all outstanding IOCBs
 		 */
-		result = sdp_iocb_q_cancel_all(conn, -ECONNRESET);
-		if (0 > result)
-			sdp_dbg_warn(conn, "Error <%d> canceling all IOCBs",
-				     result);
+		sdp_iocb_q_cancel_all(conn, -ECONNRESET);
 
 		sdp_inet_wake_error(conn->sk);
 
Index: sdp_sent.c
===================================================================
--- sdp_sent.c	(revision 1873)
+++ sdp_sent.c	(working copy)
@@ -340,11 +340,9 @@
 			/*
 			 * clear posted buffers from error'd queue
 			 */
-			result = sdp_buff_q_clear_unmap(&conn->send_post,
-							conn->ca->dma_device,
-							PCI_DMA_TODEVICE);
-			SDP_EXPECT(!(0 > result));
-
+			sdp_buff_q_clear_unmap(&conn->send_post,
+					       conn->ca->dma_device,
+					       PCI_DMA_TODEVICE);
 			result = 0;
 			break;
 		default:
@@ -436,8 +434,7 @@
 		 * create a link of buffers which will be returned to
 		 * the free pool in one group.
 		 */
-		result = sdp_buff_pool_chain_link(head, buff);
-		SDP_EXPECT(!(0 > result));
+		sdp_buff_pool_chain_link(head, buff);
 
 		head = buff;
 		free_count++;
Index: sdp_iocb.c
===================================================================
--- sdp_iocb.c	(revision 1873)
+++ sdp_iocb.c	(working copy)
@@ -553,7 +553,7 @@
 /*
  * sdp_iocb_q_remove - remove the object from the table
  */
-int sdp_iocb_q_remove(struct sdpc_iocb *iocb)
+void sdp_iocb_q_remove(struct sdpc_iocb *iocb)
 {
 	struct sdpc_iocb_q *table;
 	struct sdpc_iocb *next;
@@ -579,7 +579,7 @@
 	iocb->next = NULL;
 	iocb->prev = NULL;
 
-	return 0;
+	return;
 } /* sdp_iocb_q_remove */
 
 /*
@@ -773,9 +773,9 @@
 /*
  * sdp_iocb_q_cancel - cancel all outstanding AIOs in a queue
  */
-int sdp_iocb_q_cancel(struct sdpc_iocb_q *table,
-		      u32     mask,
-		      ssize_t comp)
+void sdp_iocb_q_cancel(struct sdpc_iocb_q *table,
+		       u32     mask,
+		       ssize_t comp)
 {
 	struct sdpc_iocb *iocb;
 	struct sdpc_iocb *next;
@@ -797,8 +797,7 @@
 				    iocb->key, comp, iocb->flags, iocb->size,
 				    iocb->post, iocb->len);
 
-			result = sdp_iocb_q_remove(iocb);
-			SDP_EXPECT(!(0 > result));
+			sdp_iocb_q_remove(iocb);
 
 			result = sdp_iocb_complete(iocb, comp);
 			SDP_EXPECT(!(0 > result));
@@ -807,24 +806,24 @@
 		iocb = next;
 	}
 
-	return 0;
+	return;
 } /* sdp_iocb_q_cancel */
 
 /*
  * sdp_iocb_q_init - initialize a new empty IOCB table
  */
-int sdp_iocb_q_init(struct sdpc_iocb_q *table)
+void sdp_iocb_q_init(struct sdpc_iocb_q *table)
 {
 	table->head = NULL;
 	table->size = 0;
 
-	return 0;
+	return;
 } /* sdp_iocb_q_init */
 
 /*
  * sdp_iocb_q_clear - clear the contents of an IOCB table
  */
-int sdp_iocb_q_clear(struct sdpc_iocb_q *table)
+void sdp_iocb_q_clear(struct sdpc_iocb_q *table)
 {
 	struct sdpc_iocb *iocb;
 	int result;
@@ -837,7 +836,7 @@
 		SDP_EXPECT(!(0 > result));
 	}
 
-	return 0;
+	return;
 } /* sdp_iocb_q_clear */
 
 /*
@@ -886,7 +885,7 @@
 /*
  * sdp_main_iocb_cleanup - cleanup the advertisment caches
  */
-int sdp_main_iocb_cleanup(void)
+void sdp_main_iocb_cleanup(void)
 {
 	sdp_dbg_init("IOCB cache cleanup.");
 	/*
@@ -902,5 +901,5 @@
 	 */
 	(void)_sdp_mem_lock_cleanup();
 
-	return 0;
+	return;
 } /* sdp_main_iocb_cleanup */
Index: sdp_event.c
===================================================================
--- sdp_event.c	(revision 1873)
+++ sdp_event.c	(working copy)
@@ -427,9 +427,9 @@
 	 * torn down. Here is a good spot since we know that the QP has gone to
 	 * reset, and pretty much all take downs end up here.
 	 */
-	(void)sdp_buff_q_clear_unmap(&conn->recv_post,
-				     conn->ca->dma_device,
-				     PCI_DMA_FROMDEVICE);
+	sdp_buff_q_clear_unmap(&conn->recv_post,
+			       conn->ca->dma_device,
+			       PCI_DMA_FROMDEVICE);
 	/*
 	 * check state
 	 */
Index: sdp_buff.c
===================================================================
--- sdp_buff.c	(revision 1873)
+++ sdp_buff.c	(working copy)
@@ -161,26 +161,12 @@
 /*
  * sdp_buff_q_init - Init a pool drawing its buffers from the main pool
  */
-int sdp_buff_q_init(struct sdpc_buff_q *pool, u32 size)
+void sdp_buff_q_init(struct sdpc_buff_q *pool)
 {
-	int counter;
-	int result;
-
 	pool->head = NULL;
 	pool->size = 0;
 
-	for (counter = 0; counter < size; counter++) {
-		result = sdp_buff_q_put(pool, sdp_buff_pool_get());
-		if (0 > result) {
-			result = -ENOMEM;
-			goto error;
-		}
-	}
-
-	return 0;
-error:
-	(void)sdp_buff_q_clear(pool);
-	return result;
+	return;
 } /* sdp_buff_q_init */
 
 /*
@@ -189,13 +175,9 @@
 int sdp_buff_q_remove(struct sdpc_buff *buff)
 {
 	struct sdpc_buff_q *pool;
-	int result;
 
 	pool = buff->pool;
-
-	result = _sdp_buff_q_remove(pool, buff);
-
-	return result;
+	return _sdp_buff_q_remove(pool, buff);
 } /* sdp_buff_q_remove */
 
 /*
@@ -203,11 +185,7 @@
  */
 struct sdpc_buff *sdp_buff_q_get(struct sdpc_buff_q *pool)
 {
-	struct sdpc_buff *buff;
-
-	buff = _sdp_buff_q_get(pool, 1, NULL, NULL);
-
-	return buff;
+	return _sdp_buff_q_get(pool, 1, NULL, NULL);
 } /* sdp_buff_q_get */
 
 /*
@@ -215,11 +193,7 @@
  */
 struct sdpc_buff *sdp_buff_q_get_head(struct sdpc_buff_q *pool)
 {
-	struct sdpc_buff *buff;
-
-	buff = _sdp_buff_q_get(pool, 1, NULL, NULL);
-
-	return buff;
+	return _sdp_buff_q_get(pool, 1, NULL, NULL);
 } /* sdp_buff_q_get_head */
 
 /*
@@ -227,11 +201,7 @@
  */
 struct sdpc_buff *sdp_buff_q_get_tail(struct sdpc_buff_q *pool)
 {
-	struct sdpc_buff *buff;
-
-	buff = _sdp_buff_q_get(pool, 0, NULL, NULL);
-
-	return buff;
+	return _sdp_buff_q_get(pool, 0, NULL, NULL);
 } /* sdp_buff_q_get_tail */
 
 /*
@@ -239,11 +209,7 @@
  */
 struct sdpc_buff *sdp_buff_q_look_head(struct sdpc_buff_q *pool)
 {
-	struct sdpc_buff *buff;
-
-	buff = _sdp_buff_q_look(pool, 1);
-
-	return buff;
+	return _sdp_buff_q_look(pool, 1);
 } /* sdp_buff_q_look_head */
 
 /*
@@ -254,11 +220,7 @@
 						    void *arg),
 					void *usr_arg)
 {
-	struct sdpc_buff *buff;
-
-	buff = _sdp_buff_q_get(pool, 1, test, usr_arg);
-
-	return buff;
+	return _sdp_buff_q_get(pool, 1, test, usr_arg);
 } /* sdp_buff_q_fetch_head */
 
 /*
@@ -333,11 +295,7 @@
 int sdp_buff_q_put(struct sdpc_buff_q *pool,
 		   struct sdpc_buff *buff)
 {
-	int result;
-
-	result = _sdp_buff_q_put(pool, buff, 1);
-
-	return result;
+	return _sdp_buff_q_put(pool, buff, 1);
 } /* sdp_buff_q_put */
 
 /*
@@ -346,11 +304,7 @@
 int sdp_buff_q_put_head(struct sdpc_buff_q *pool,
 			struct sdpc_buff *buff)
 {
-	int result;
-
-	result = _sdp_buff_q_put(pool, buff, 1);
-
-	return result;
+	return _sdp_buff_q_put(pool, buff, 1);
 } /* sdp_buff_q_put_head */
 
 /*
@@ -359,19 +313,15 @@
 int sdp_buff_q_put_tail(struct sdpc_buff_q *pool,
 			struct sdpc_buff *buff)
 {
-	int result;
-
-	result = _sdp_buff_q_put(pool, buff, 0);
-
-	return result;
+	return _sdp_buff_q_put(pool, buff, 0);
 } /* sdp_buff_q_put_tail */
 
 /*
  * sdp_buff_q_clear_unmap - clear the buffers out of a specific buffer pool
  */
-int sdp_buff_q_clear_unmap(struct sdpc_buff_q *pool,
-			   struct device *dev,
-			   int direction)
+void sdp_buff_q_clear_unmap(struct sdpc_buff_q *pool,
+			    struct device *dev,
+			    int direction)
 {
 	int result;
 	struct sdpc_buff *buff;
@@ -387,8 +337,8 @@
 				    result);
 	}
 	
-	return 0;
-} /* sdp_buff_q_clear */
+	return;
+} /* sdp_buff_q_clear_unmap */
 
 /*
  * internal data buffer pool manager
@@ -397,7 +347,7 @@
 /*
  * _sdp_buff_pool_release - release allocated buffers from the main pool
  */
-static int _sdp_buff_pool_release(struct sdpc_buff_root *m_pool, int count)
+static void _sdp_buff_pool_release(struct sdpc_buff_root *m_pool, int count)
 {
 	struct sdpc_buff *buff;
 
@@ -417,13 +367,13 @@
 		kmem_cache_free(m_pool->buff_cache, buff);
 	}
 	
-	return 0;
+	return;
 } /* _sdp_buff_pool_release */
 
 /*
  * _sdp_buff_pool_release_check - check for buffer release from main pool
  */
-static inline int _sdp_buff_pool_release_check(struct sdpc_buff_root *m_pool)
+static inline void _sdp_buff_pool_release_check(struct sdpc_buff_root *m_pool)
 {
 	/*
 	 * If there are more then minimum buffers outstanding, free half of
@@ -439,10 +389,10 @@
 		count = min((m_pool->buff_cur - m_pool->buff_min),
 			    (m_pool->free_mark/2));
 
-		return _sdp_buff_pool_release(m_pool, count);
+		_sdp_buff_pool_release(m_pool, count);
 	}
-	else
-		return 0;
+
+	return;
 } /* _sdp_buff_pool_release_check */
 
 /*
@@ -556,10 +506,8 @@
 	main_pool->free_mark = free_mark;
 
 	spin_lock_init(&main_pool->lock);
+	sdp_buff_q_init(&main_pool->pool);
 
-	result = sdp_buff_q_init(&main_pool->pool, 0);
-	SDP_EXPECT(!(0 > result));
-
 	main_pool->pool_cache = kmem_cache_create("sdp_buff_pool",
 						  sizeof(struct sdpc_buff_q),
 						  0, SLAB_HWCACHE_ALIGN,
@@ -618,7 +566,7 @@
 	/*
 	 * Free all the buffers.
 	 */
-	(void)_sdp_buff_pool_release(main_pool, main_pool->buff_cur);
+	_sdp_buff_pool_release(main_pool, main_pool->buff_cur);
 	/*
 	 * Sanity check that the current number of buffers was released.
 	 */
@@ -732,7 +680,7 @@
 
 	main_pool->pool.size++;
 
-	(void)_sdp_buff_pool_release_check(main_pool);
+	_sdp_buff_pool_release_check(main_pool);
 
 	spin_unlock_irqrestore(&main_pool->lock, flags);
 
@@ -742,7 +690,7 @@
 /*
  * sdp_buff_pool_chain_link - create chain of buffers which can be returned
  */
-int sdp_buff_pool_chain_link(struct sdpc_buff *head, struct sdpc_buff *buff)
+void sdp_buff_pool_chain_link(struct sdpc_buff *head, struct sdpc_buff *buff)
 {
 	buff->data = buff->head;
 	buff->tail = buff->head;
@@ -759,7 +707,7 @@
 		buff->prev->next = buff;
 	}
 
-	return 0;
+	return;
 } /* sdp_buff_pool_chain_link */
 
 /*
Index: sdp_queue.c
===================================================================
--- sdp_queue.c	(revision 1873)
+++ sdp_queue.c	(working copy)
@@ -117,7 +117,7 @@
 /*
  * sdp_desc_q_remove - remove a specific element from a table
  */
-int sdp_desc_q_remove(struct sdpc_desc *element)
+void sdp_desc_q_remove(struct sdpc_desc *element)
 {
 	struct sdpc_desc_q *table;
 	struct sdpc_desc *prev;
@@ -138,14 +138,13 @@
 	}
 
 	table->size--;
-	table->count[element->type] -=
-	    ((SDP_DESC_TYPE_NONE > element->type) ? 1 : 0);
-
+	table->count[element->type] -=((SDP_DESC_TYPE_NONE > element->type) ?
+				       1 : 0);
 	element->table = NULL;
 	element->next = NULL;
 	element->prev = NULL;
 
-	return 0;
+	return;
 } /* sdp_desc_q_remove */
 
 /*
@@ -258,20 +257,20 @@
 /*
  * sdp_desc_q_init - initialize a new empty generic table
  */
-int sdp_desc_q_init(struct sdpc_desc_q *table)
+void sdp_desc_q_init(struct sdpc_desc_q *table)
 {
 	table->head = NULL;
 	table->size = 0;
 
 	memset(table, 0, sizeof(struct sdpc_desc_q));
 
-	return 0;
+	return;
 } /* sdp_desc_q_init */
 
 /*
  * sdp_desc_q_clear - clear the contents of a generic table
  */
-int sdp_desc_q_clear(struct sdpc_desc_q *table)
+void sdp_desc_q_clear(struct sdpc_desc_q *table)
 {
 	struct sdpc_desc *element;
 	int result;
@@ -285,5 +284,5 @@
 			SDP_EXPECT(!(0 > result));
 		}
 
-	return 0;
+	return;
 } /* sdp_desc_q_clear */



More information about the general mailing list