[openib-general] Re: sdp_kvec.c

Michael S. Tsirkin mst at mellanox.co.il
Thu Feb 24 14:12:50 PST 2005


Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: sdp_kvec.c
> 
> On Thu, Feb 24, 2005 at 10:58:34PM +0200, Michael S. Tsirkin wrote:
> > Quoting r. Libor Michalek <libor at topspin.com>:
> > > > What do you say to removing the comments after the closing }?
> > > > Its clearly unnecessary (most functions are, or shall be, short enough
> > > > to see where they end), and increases the code footprint.
> > > > For me, they make the detection of the function end harder rather than
> > > > easier, since I am always looking for a sole }.
> > > 
> > >   OK, I'll stop adding them to new functions, and remove them as I
> > > touch code. If I or anyone else get's ambitious we can strip them
> > > from all the functions.


Here's some more - I missed the ones after the structure end.
Note how at least in one case (_sdp_prot) the closing comment said
_pf_family. Which shows that these clean-ups are a good thing.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: sdp_queue.h
===================================================================
--- sdp_queue.h	(revision 1909)
+++ sdp_queue.h	(working copy)
@@ -55,7 +55,7 @@ struct sdpc_desc {
 	u32                 type;  /* element type. (for generic queue) */
 	struct sdpc_desc_q *table; /* table to which this object belongs */
 	int (*release)(struct sdpc_desc *element); /* release the object */
-}; /* struct sdpc_desc */
+};
 
 /*
  * table for holding SDP advertisments.
@@ -64,7 +64,7 @@ struct sdpc_desc_q {
 	struct sdpc_desc *head; /* double linked list of advertisments */
 	int size;               /* current number of advertisments in table */
 	u16 count[SDP_DESC_TYPE_NONE]; /* object specific counter */
-}; /* struct sdpc_desc_q */
+};
 
 /*
  * SDP generic queue inline functions
Index: sdp_rcvd.c
===================================================================
--- sdp_rcvd.c	(revision 1909)
+++ sdp_rcvd.c	(working copy)
@@ -1084,7 +1084,7 @@ static sdp_event_cb_func recv_event_func
 	_sdp_rcvd_snk_avail,        /* SDP_MID_SNK_AVAIL        0xFD */
 	_sdp_rcvd_src_avail,        /* SDP_MID_SRC_AVAIL        0xFE */
 	_sdp_rcvd_data              /* SDP_MID_DATA             0xFF */
-}; /* recv_event_funcs */
+};
 
 /*
  * sdp_event_recv - recv event demultiplexing into sdp messages
Index: sdp_inet.c
===================================================================
--- sdp_inet.c	(revision 1909)
+++ sdp_inet.c	(working copy)
@@ -1403,7 +1403,7 @@ struct proto_ops _lnx_stream_ops = {
 	.socketpair =  sock_no_socketpair,
 	.mmap       =  sock_no_mmap,
 	.owner      =  THIS_MODULE,
-}; /* _lnx_stream_ops */
+};
 
 /*
  * _sdp_inet_create - create a socket
@@ -1455,7 +1455,7 @@ static struct net_proto_family _sdp_prot
 	.family =  AF_INET_SDP,
 	.create = _sdp_inet_create,
 	.owner  =  THIS_MODULE,
-}; /* _pf_family */
+};
 
 /*
  * SDP host module load/unload functions
Index: sdp_link.h
===================================================================
--- sdp_link.h	(revision 1909)
+++ sdp_link.h	(working copy)
@@ -64,7 +64,7 @@ struct sdp_path_info {
 	struct sdp_path_info **pext; /* previous next element in path list */
 
 	struct sdp_path_wait  *wait_list; /* waiting for completions */
-}; /* struct sdp_path_info */
+};
 
 struct sdp_path_wait {
 	u64 id;  /* request identifier */
@@ -80,12 +80,12 @@ struct sdp_path_wait {
 	int   retry;
 	struct sdp_path_wait  *next;
 	struct sdp_path_wait **pext;
-}; /* struct sdp_path_wait */
+};
 
 struct sdp_work {
 	struct work_struct work;
 	void *arg;
-}; /* struct sdp_work */
+};
 
 struct sdp_link_arp {
 	/*
Index: sdp_conn.h
===================================================================
--- sdp_conn.h	(revision 1909)
+++ sdp_conn.h	(working copy)
@@ -171,7 +171,7 @@ struct sdp_conn_state {
 	__u16 state[SDP_CONN_STATE_MAX];
 	void *file[SDP_CONN_STATE_MAX];
 	__s32 line[SDP_CONN_STATE_MAX];
-}; /* struct sdp_conn_state */
+};
 
 #define SDP_CONN_ST_SET(conn, val) \
 do { \
@@ -208,7 +208,7 @@ struct sdp_conn_lock {
 	__u32 users;
 	spinlock_t slock;
 	wait_queue_head_t waitq;
-}; /* struct sdp_conn_lock */
+};
 
 /*
  * SDP Connection structure.
@@ -412,7 +412,7 @@ struct sdp_opt {
 #ifdef _SDP_CONN_STATE_REC
 	struct sdp_conn_state state_rec;
 #endif
-}; /* struct sdp_opt */
+};
 
 #define SDP_WRAP_GT(x, y) ((signed int)((x) - (y)) > 0)
 #define SDP_WRAP_LT(x, y) ((signed int)((x) - (y)) < 0)
Index: sdp_advt.h
===================================================================
--- sdp_advt.h	(revision 1909)
+++ sdp_advt.h	(working copy)
@@ -60,7 +60,7 @@ struct sdpc_advt {
 	u64 wrid; /* work request completing this advertisment */
 	u32 flag; /* advertisment flags. */
 	u64 addr; /* advertised buffer virtual address */
-}; /* struct sdpc_advt */
+};
 
 /*
  * table for holding SDP advertisments.
@@ -68,7 +68,7 @@ struct sdpc_advt {
 struct sdpc_advt_q {
 	struct sdpc_advt *head; /* double linked list of advertisments */
 	s32 size;               /* current number of advertisments in table */
-}; /* struct sdpc_advt_q */
+};
 
 /*
  * make size a macro.
Index: sdp_buff_p.h
===================================================================
--- sdp_buff_p.h	(revision 1909)
+++ sdp_buff_p.h	(working copy)
@@ -71,6 +71,6 @@ struct sdpc_buff_root {
 
 	int alloc_inc;  /* allocation increment */
 	int free_mark;  /* start freeing unused buffers */
-}; /* struct sdpc_buff_root */
+};
 
 #endif /* _SDP_BUFF_P_H */
Index: sdp_proc.h
===================================================================
--- sdp_proc.h	(revision 1909)
+++ sdp_proc.h	(working copy)
@@ -65,6 +65,6 @@ struct sdpc_proc_ent {
 		    int   max_size,
 		    off_t start, 
 		    long *end);
-}; /* struct sdpc_proc_ent */
+};
 
 #endif /* _SDP_PROC_H */
Index: sdp_sent.c
===================================================================
--- sdp_sent.c	(revision 1909)
+++ sdp_sent.c	(working copy)
@@ -316,7 +316,7 @@ static sdp_event_cb_func send_event_func
 	_sdp_sent_snk_avail,       /* SDP_MID_SNK_AVAIL        0xFD */
 	_sdp_sent_src_avail,       /* SDP_MID_SRC_AVAIL        0xFE */
 	_sdp_sent_data             /* SDP_MID_DATA             0xFF */
-}; /* send_event_funcs */
+};
 
 /*
  * sdp_event_send - send event handler
Index: sdp_iocb.h
===================================================================
--- sdp_iocb.h	(revision 1909)
+++ sdp_iocb.h	(working copy)
@@ -114,7 +114,7 @@ struct sdpc_iocb {
 	 */
 	struct kiocb *req;
 	struct sock_iocb *si;
-}; /* struct sdpc_iocb */
+};
 
 /*
  * table for IOCBs
@@ -122,7 +122,7 @@ struct sdpc_iocb {
 struct sdpc_iocb_q {
 	struct sdpc_iocb *head; /* double linked list of IOCBs */
 	int size;               /* current number of IOCBs in table */
-}; /* struct sdpc_iocb_q */
+};
 
 /*
  * Address translations
Index: sdp_dev.h
===================================================================
--- sdp_dev.h	(revision 1909)
+++ sdp_dev.h	(working copy)
@@ -143,7 +143,7 @@ struct sdev_hca_port {
 	u8                    index; /* port ID */
 	union ib_gid          gid;   /* port GID */
 	struct sdev_hca_port *next;  /* next port in the list */
-}; /* struct sdev_hca_port */
+};
 
 struct sdev_hca {
 	struct ib_device     *ca;        /* HCA */
@@ -154,7 +154,7 @@ struct sdev_hca {
 	struct ib_fmr_pool   *fmr_pool;  /* fast memory for Zcopy */
 	struct sdev_hca_port *port_list; /* ports on this HCA */
 	struct sdev_hca      *next;      /* next HCA in the list */
-}; /* struct sdev_hca */
+};
 
 struct sdev_root {
 	u32 src_addr;
@@ -196,6 +196,6 @@ struct sdev_root {
 	 */
 	kmem_cache_t *conn_cache;
 	kmem_cache_t *sock_cache;
-}; /* struct sdev_root */
+};
 
 #endif /* _SDP_DEV_H */
Index: sdp_buff.h
===================================================================
--- sdp_buff.h	(revision 1909)
+++ sdp_buff.h	(working copy)
@@ -42,7 +42,7 @@
 struct sdpc_buff_q {
 	struct sdpc_buff *head; /* double linked list of buffers */
 	u32 size;               /* number of buffers in the pool */
-}; /* struct sdpc_buff_q */
+};
 
 struct sdpc_buff {
 	struct sdpc_buff   *next;
@@ -74,7 +74,7 @@ struct sdpc_buff {
 	u64 real; /* component of scather/gather list (address) */
 	u32 size; /* component of scather/gather list (lenght)  */
 	u32 lkey; /* component of scather/gather list (key) */
-}; /* struct sdpc_buff */
+};
 
 /*
  * buffer flag defintions
-- 
MST - Michael S. Tsirkin



More information about the general mailing list