afs/net/rxrpc transport.c,1.4,1.5 sysctl.c,1.4,1.5 proc.c,1.5,1.6 peer.c,1.5,1.6 main.c,1.4,1.5 krxtimod.c,1.6,1.7 krxsecd.c,1.7,1.8 krxiod.c,1.6,1.7 internal.h,1.8,1.9 connection.c,1.4,1.5call.c,1.6,1.7

dwh at infradead.org dwh at infradead.org
Tue Aug 12 19:04:05 BST 2003


Update of /home/cvs/afs/net/rxrpc
In directory phoenix.infradead.org:/tmp/cvs-serv893/net/rxrpc

Modified Files:
	transport.c sysctl.c proc.c peer.c main.c krxtimod.c krxsecd.c 
	krxiod.c internal.h connection.c call.c 
Log Message:
mangled the coding style towards Hellwig compliance


Index: transport.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/transport.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- transport.c	1 Jul 2003 17:46:09 -0000	1.4
+++ transport.c	12 Aug 2003 17:04:02 -0000	1.5
@@ -56,7 +56,8 @@
 /*
  * create a new transport endpoint using the specified UDP port
  */
-int rxrpc_create_transport(unsigned short port, struct rxrpc_transport **_trans)
+int rxrpc_create_transport(unsigned short port,
+			   struct rxrpc_transport **_trans)
 {
 	struct rxrpc_transport *trans;
 	struct sockaddr_in sin;
@@ -64,14 +65,14 @@
 	struct sock *sock;
 	int ret, opt;
 
-	_enter("%hu",port);
+	_enter("%hu", port);
 
-	trans = kmalloc(sizeof(struct rxrpc_transport),GFP_KERNEL);
+	trans = kmalloc(sizeof(struct rxrpc_transport), GFP_KERNEL);
 	if (!trans)
 		return -ENOMEM;
 
-	memset(trans,0,sizeof(struct rxrpc_transport));
-	atomic_set(&trans->usage,1);
+	memset(trans, 0, sizeof(struct rxrpc_transport));
+	atomic_set(&trans->usage, 1);
 	INIT_LIST_HEAD(&trans->services);
 	INIT_LIST_HEAD(&trans->link);
 	INIT_LIST_HEAD(&trans->krxiodq_link);
@@ -81,58 +82,58 @@
 	spin_lock_init(&trans->peer_gylock);
 	init_waitqueue_head(&trans->peer_gy_waitq);
 	rwlock_init(&trans->peer_lock);
-	atomic_set(&trans->peer_count,0);
+	atomic_set(&trans->peer_count, 0);
 	trans->port = port;
 
 	/* create a UDP socket to be my actual transport endpoint */
-	ret = sock_create(PF_INET,SOCK_DGRAM,IPPROTO_UDP,&trans->socket);
-	if (ret<0)
+	ret = sock_create(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &trans->socket);
+	if (ret < 0)
 		goto error;
 
 	/* use the specified port */
 	if (port) {
-		memset(&sin,0,sizeof(sin));
+		memset(&sin, 0, sizeof(sin));
 		sin.sin_family = AF_INET;
 		sin.sin_port = htons(port);
-		ret = trans->socket->ops->bind(trans->socket,(struct sockaddr *)&sin,sizeof(sin));
-		if (ret<0)
+		ret = trans->socket->ops->bind(trans->socket,
+					       (struct sockaddr *) &sin,
+					       sizeof(sin));
+		if (ret < 0)
 			goto error;
 	}
 
 	opt = 1;
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = trans->socket->ops->setsockopt(trans->socket,SOL_IP,IP_RECVERR,
-					     (char*)&opt,sizeof(opt));
+	ret = trans->socket->ops->setsockopt(trans->socket, SOL_IP, IP_RECVERR,
+					     (char *) &opt, sizeof(opt));
 	set_fs(oldfs);
 
 	spin_lock(&rxrpc_transports_lock);
-	list_add(&trans->link,&rxrpc_transports);
+	list_add(&trans->link, &rxrpc_transports);
 	spin_unlock(&rxrpc_transports_lock);
 
 	/* set the socket up */
 	sock = trans->socket->sk;
-	sock->sk_user_data = trans;
-	sock->sk_data_ready = rxrpc_data_ready;
-	sock->sk_error_report = rxrpc_error_report;
+	sock->sk_user_data	= trans;
+	sock->sk_data_ready	= rxrpc_data_ready;
+	sock->sk_error_report	= rxrpc_error_report;
 
 	down_write(&rxrpc_proc_transports_sem);
-	list_add_tail(&trans->proc_link,&rxrpc_proc_transports);
+	list_add_tail(&trans->proc_link, &rxrpc_proc_transports);
 	up_write(&rxrpc_proc_transports_sem);
 
 	__RXACCT(atomic_inc(&rxrpc_transport_count));
 
 	*_trans = trans;
-	_leave(" = 0 (%p)",trans);
+	_leave(" = 0 (%p)", trans);
 	return 0;
 
  error:
 	rxrpc_put_transport(trans);
 
-	_leave(" = %d",ret);
-
+	_leave(" = %d", ret);
 	return ret;
-
 } /* end rxrpc_create_transport() */
 
 /*****************************************************************************/
@@ -151,12 +152,13 @@
  */
 void rxrpc_put_transport(struct rxrpc_transport *trans)
 {
-	_enter("%p{u=%d p=%hu}",trans,atomic_read(&trans->usage),trans->port);
+	_enter("%p{u=%d p=%hu}",
+	       trans, atomic_read(&trans->usage), trans->port);
 
-	if (atomic_read(&trans->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&trans->usage) <= 0);
 
-	/* to prevent a race, the decrement and the dequeue must be effectively atomic */
+	/* to prevent a race, the decrement and the dequeue must be
+	 * effectively atomic */
 	spin_lock(&rxrpc_transports_lock);
 	if (likely(!atomic_dec_and_test(&trans->usage))) {
 		spin_unlock(&rxrpc_transports_lock);
@@ -169,7 +171,7 @@
 
 	/* finish cleaning up the transport */
 	if (trans->socket)
-		trans->socket->ops->shutdown(trans->socket,2);
+		trans->socket->ops->shutdown(trans->socket, 2);
 
 	rxrpc_krxsecd_clear_transport(trans);
 	rxrpc_krxiod_dequeue_transport(trans);
@@ -192,41 +194,41 @@
 	kfree(trans);
 
 	_leave("");
-
 } /* end rxrpc_put_transport() */
 
 /*****************************************************************************/
 /*
  * add a service to a transport to be listened upon
  */
-int rxrpc_add_service(struct rxrpc_transport *trans, struct rxrpc_service *newsrv)
+int rxrpc_add_service(struct rxrpc_transport *trans,
+		      struct rxrpc_service *newsrv)
 {
 	struct rxrpc_service *srv;
 	struct list_head *_p;
 	int ret = -EEXIST;
 
-	_enter("%p{%hu},%p{%hu}",trans,trans->port,newsrv,newsrv->service_id);
+	_enter("%p{%hu},%p{%hu}",
+	       trans, trans->port, newsrv, newsrv->service_id);
 
 	/* verify that the service ID is not already present */
 	spin_lock(&trans->lock);
 
-	list_for_each(_p,&trans->services) {
-		srv = list_entry(_p,struct rxrpc_service,link);
-		if (srv->service_id==newsrv->service_id)
+	list_for_each(_p, &trans->services) {
+		srv = list_entry(_p, struct rxrpc_service, link);
+		if (srv->service_id == newsrv->service_id)
 			goto out;
 	}
 
 	/* okay - add the transport to the list */
-	list_add_tail(&newsrv->link,&trans->services);
+	list_add_tail(&newsrv->link, &trans->services);
 	rxrpc_get_transport(trans);
 	ret = 0;
 
  out:
 	spin_unlock(&trans->lock);
 
-	_leave("= %d",ret);
+	_leave("= %d", ret);
 	return ret;
-
 } /* end rxrpc_add_service() */
 
 /*****************************************************************************/
@@ -235,7 +237,7 @@
  */
 void rxrpc_del_service(struct rxrpc_transport *trans, struct rxrpc_service *srv)
 {
-	_enter("%p{%hu},%p{%hu}",trans,trans->port,srv,srv->service_id);
+	_enter("%p{%hu},%p{%hu}", trans, trans->port, srv, srv->service_id);
 
 	spin_lock(&trans->lock);
 	list_del(&srv->link);
@@ -244,7 +246,6 @@
 	rxrpc_put_transport(trans);
 
 	_leave("");
-
 } /* end rxrpc_del_service() */
 
 /*****************************************************************************/
@@ -255,7 +256,7 @@
 {
 	struct rxrpc_transport *trans;
 
-	_enter("%p{t=%p},%d",sk,sk->sk_user_data,count);
+	_enter("%p{t=%p},%d", sk, sk->sk_user_data, count);
 
 	/* queue the transport for attention by krxiod */
 	trans = (struct rxrpc_transport *) sk->sk_user_data;
@@ -267,7 +268,6 @@
 		wake_up_interruptible(sk->sk_sleep);
 
 	_leave("");
-
 } /* end rxrpc_data_ready() */
 
 /*****************************************************************************/
@@ -279,7 +279,7 @@
 {
 	struct rxrpc_transport *trans;
 
-	_enter("%p{t=%p}",sk,sk->sk_user_data);
+	_enter("%p{t=%p}", sk, sk->sk_user_data);
 
 	/* queue the transport for attention by krxiod */
 	trans = (struct rxrpc_transport *) sk->sk_user_data;
@@ -293,13 +293,12 @@
 		wake_up_interruptible(sk->sk_sleep);
 
 	_leave("");
-
 } /* end rxrpc_error_report() */
 
 /*****************************************************************************/
 /*
- * split a message up, allocating message records and filling them in from the contents of a
- * socket buffer
+ * split a message up, allocating message records and filling them in
+ * from the contents of a socket buffer
  */
 static int rxrpc_incoming_msg(struct rxrpc_transport *trans,
 			      struct sk_buff *pkt,
@@ -310,18 +309,19 @@
 
 	_enter("");
 
-	msg = kmalloc(sizeof(struct rxrpc_message),GFP_KERNEL);
+	msg = kmalloc(sizeof(struct rxrpc_message), GFP_KERNEL);
 	if (!msg) {
 		_leave(" = -ENOMEM");
 		return -ENOMEM;
 	}
 
-	memset(msg,0,sizeof(*msg));
-	atomic_set(&msg->usage,1);
+	memset(msg, 0, sizeof(*msg));
+	atomic_set(&msg->usage, 1);
 	list_add_tail(&msg->link,msgq);
 
 	/* dig out the Rx routing parameters */
-	if (skb_copy_bits(pkt,sizeof(struct udphdr),&msg->hdr,sizeof(msg->hdr))<0) {
+	if (skb_copy_bits(pkt, sizeof(struct udphdr),
+			  &msg->hdr, sizeof(msg->hdr)) < 0) {
 		ret = -EBADMSG;
 		goto error;
 	}
@@ -352,7 +352,9 @@
 	__RXACCT(atomic_inc(&rxrpc_message_count));
 
 	/* split off jumbo packets */
-	while (msg->hdr.type==RXRPC_PACKET_TYPE_DATA && msg->hdr.flags & RXRPC_JUMBO_PACKET) {
+	while (msg->hdr.type == RXRPC_PACKET_TYPE_DATA &&
+	       msg->hdr.flags & RXRPC_JUMBO_PACKET
+	       ) {
 		struct rxrpc_jumbo_header jumbo;
 		struct rxrpc_message *jumbomsg = msg;
 
@@ -360,23 +362,25 @@
 
 		/* quick sanity check */
 		ret = -EBADMSG;
-		if (msg->dsize < RXRPC_JUMBO_DATALEN+sizeof(struct rxrpc_jumbo_header))
+		if (msg->dsize <
+		    RXRPC_JUMBO_DATALEN + sizeof(struct rxrpc_jumbo_header))
 			goto error;
 		if (msg->hdr.flags & RXRPC_LAST_PACKET)
 			goto error;
 
 		/* dig out the secondary header */
-		if (skb_copy_bits(pkt,msg->offset+RXRPC_JUMBO_DATALEN,&jumbo,sizeof(jumbo))<0)
+		if (skb_copy_bits(pkt, msg->offset + RXRPC_JUMBO_DATALEN,
+				  &jumbo, sizeof(jumbo)) < 0)
 			goto error;
 
 		/* allocate a new message record */
 		ret = -ENOMEM;
-		msg = kmalloc(sizeof(struct rxrpc_message),GFP_KERNEL);
+		msg = kmalloc(sizeof(struct rxrpc_message), GFP_KERNEL);
 		if (!msg)
 			goto error;
 
-		memcpy(msg,jumbomsg,sizeof(*msg));
-		list_add_tail(&msg->link,msgq);
+		memcpy(msg, jumbomsg, sizeof(*msg));
+		list_add_tail(&msg->link, msgq);
 
 		/* adjust the jumbo packet */
 		jumbomsg->dsize = RXRPC_JUMBO_DATALEN;
@@ -388,12 +392,15 @@
 		msg->seq++;
 		msg->hdr.seq = htonl(msg->seq);
 		msg->hdr.serial = htonl(ntohl(msg->hdr.serial) + 1);
-		msg->offset += RXRPC_JUMBO_DATALEN + sizeof(struct rxrpc_jumbo_header);
-		msg->dsize -= RXRPC_JUMBO_DATALEN + sizeof(struct rxrpc_jumbo_header);
+		msg->offset += RXRPC_JUMBO_DATALEN +
+			sizeof(struct rxrpc_jumbo_header);
+		msg->dsize -= RXRPC_JUMBO_DATALEN +
+			sizeof(struct rxrpc_jumbo_header);
 		msg->hdr.flags = jumbo.flags;
 		msg->hdr._rsvd = jumbo._rsvd;
 
-		_net("Rx Split jumbo packet from %s (%08x;%08x,%1x,%d,%s,%02x,%d,%d)",
+		_net("Rx Split jumbo packet from %s"
+		     " (%08x;%08x,%1x,%d,%s,%02x,%d,%d)",
 		     msg->hdr.flags & RXRPC_CLIENT_INITIATED ? "client" : "server",
 		     ntohl(msg->hdr.epoch),
 		     (ntohl(msg->hdr.cid) & RXRPC_CIDMASK) >> RXRPC_CIDSHIFT,
@@ -407,18 +414,18 @@
 		__RXACCT(atomic_inc(&rxrpc_message_count));
 	}
 
-	_leave(" = 0 #%d",atomic_read(&rxrpc_message_count));
+	_leave(" = 0 #%d", atomic_read(&rxrpc_message_count));
 	return 0;
 
  error:
 	while (!list_empty(msgq)) {
-		msg = list_entry(msgq->next,struct rxrpc_message,link);
+		msg = list_entry(msgq->next, struct rxrpc_message, link);
 		list_del_init(&msg->link);
 
 		rxrpc_put_message(msg);
 	}
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end rxrpc_incoming_msg() */
 
@@ -438,7 +445,7 @@
 
 	LIST_HEAD(msgq);
 
-	_enter("%p{%d}",trans,trans->port);
+	_enter("%p{%d}", trans, trans->port);
 
 	for (;;) {
 		/* deal with outstanting errors first */
@@ -446,22 +453,25 @@
 			rxrpc_trans_receive_error_report(trans);
 
 		/* attempt to receive a packet */
-		pkt = skb_recv_datagram(trans->socket->sk,0,1,&ret);
+		pkt = skb_recv_datagram(trans->socket->sk, 0, 1, &ret);
 		if (!pkt) {
-			if (ret==-EAGAIN) {
+			if (ret == -EAGAIN) {
 				_leave(" EAGAIN");
 				return;
 			}
 
 			/* an icmp error may have occurred */
 			rxrpc_krxiod_queue_transport(trans);
-			_leave(" error %d\n",ret);
+			_leave(" error %d\n", ret);
 			return;
 		}
 
-		/* we'll probably need to checksum it (didn't call sock_recvmsg) */
+		/* we'll probably need to checksum it (didn't call
+		 * sock_recvmsg) */
 		if (pkt->ip_summed != CHECKSUM_UNNECESSARY) {
-			if ((unsigned short)csum_fold(skb_checksum(pkt,0,pkt->len,pkt->csum))) {
+			if ((unsigned short)
+			    csum_fold(skb_checksum(pkt, 0, pkt->len,
+						   pkt->csum))) {
 				kfree_skb(pkt);
 				rxrpc_krxiod_queue_transport(trans);
 				_leave(" CSUM failed");
@@ -472,34 +482,36 @@
 		addr = pkt->nh.iph->saddr;
 		port = pkt->h.uh->source;
 
-		_net("Rx Received UDP packet from %08x:%04hu",ntohl(addr),ntohs(port));
+		_net("Rx Received UDP packet from %08x:%04hu",
+		     ntohl(addr), ntohs(port));
 
 		/* unmarshall the Rx parameters and split jumbo packets */
-		ret = rxrpc_incoming_msg(trans,pkt,&msgq);
-		if (ret<0) {
+		ret = rxrpc_incoming_msg(trans, pkt, &msgq);
+		if (ret < 0) {
 			kfree_skb(pkt);
 			rxrpc_krxiod_queue_transport(trans);
 			_leave(" bad packet");
 			return;
 		}
 
-		if (list_empty(&msgq)) BUG();
+		BUG_ON(list_empty(&msgq));
 
-		msg = list_entry(msgq.next,struct rxrpc_message,link);
+		msg = list_entry(msgq.next, struct rxrpc_message, link);
 
-		/* locate the record for the peer from which it originated */
-		ret = rxrpc_peer_lookup(trans,addr,&peer);
-		if (ret<0) {
+		/* locate the record for the peer from which it
+		 * originated */
+		ret = rxrpc_peer_lookup(trans, addr, &peer);
+		if (ret < 0) {
 			kdebug("Rx No connections from that peer");
-			rxrpc_trans_immediate_abort(trans,msg,-EINVAL);
+			rxrpc_trans_immediate_abort(trans, msg, -EINVAL);
 			goto finished_msg;
 		}
 
 		/* try and find a matching connection */
-		ret = rxrpc_connection_lookup(peer,msg,&msg->conn);
-		if (ret<0) {
+		ret = rxrpc_connection_lookup(peer, msg, &msg->conn);
+		if (ret < 0) {
 			kdebug("Rx Unknown Connection");
-			rxrpc_trans_immediate_abort(trans,msg,-EINVAL);
+			rxrpc_trans_immediate_abort(trans, msg, -EINVAL);
 			rxrpc_put_peer(peer);
 			goto finished_msg;
 		}
@@ -507,23 +519,23 @@
 
 		/* deal with the first packet of a new call */
 		if (msg->hdr.flags & RXRPC_CLIENT_INITIATED &&
-		    msg->hdr.type==RXRPC_PACKET_TYPE_DATA &&
-		    ntohl(msg->hdr.seq)==1
+		    msg->hdr.type == RXRPC_PACKET_TYPE_DATA &&
+		    ntohl(msg->hdr.seq) == 1
 		    ) {
 			_debug("Rx New server call");
-			rxrpc_trans_receive_new_call(trans,&msgq);
+			rxrpc_trans_receive_new_call(trans, &msgq);
 			goto finished_msg;
 		}
 
 		/* deal with subsequent packet(s) of call */
 		_debug("Rx Call packet");
 		while (!list_empty(&msgq)) {
-			msg = list_entry(msgq.next,struct rxrpc_message,link);
+			msg = list_entry(msgq.next, struct rxrpc_message, link);
 			list_del_init(&msg->link);
 
-			ret = rxrpc_conn_receive_call_packet(msg->conn,NULL,msg);
-			if (ret<0) {
-				rxrpc_trans_immediate_abort(trans,msg,ret);
+			ret = rxrpc_conn_receive_call_packet(msg->conn, NULL, msg);
+			if (ret < 0) {
+				rxrpc_trans_immediate_abort(trans, msg, ret);
 				rxrpc_put_message(msg);
 				goto finished_msg;
 			}
@@ -536,7 +548,7 @@
 		/* dispose of the packets */
 	finished_msg:
 		while (!list_empty(&msgq)) {
-			msg = list_entry(msgq.next,struct rxrpc_message,link);
+			msg = list_entry(msgq.next, struct rxrpc_message, link);
 			list_del_init(&msg->link);
 
 			rxrpc_put_message(msg);
@@ -561,7 +573,7 @@
 	_enter("");
 
 	/* only bother with the first packet */
-	msg = list_entry(msgq->next,struct rxrpc_message,link);
+	msg = list_entry(msgq->next, struct rxrpc_message, link);
 	list_del_init(&msg->link);
 	rxrpc_krxsecd_queue_incoming_call(msg);
 	rxrpc_put_message(msg);
@@ -584,13 +596,13 @@
 	struct msghdr msghdr;
 	struct iovec iov[2];
 	mm_segment_t oldfs;
+	u_int32_t _error;
 	int len, ret;
-	u32 _error;
 
-	_enter("%p,%p,%d",trans,msg,error);
+	_enter("%p,%p,%d", trans, msg, error);
 
 	/* don't abort an abort packet */
-	if (msg->hdr.type==RXRPC_PACKET_TYPE_ABORT) {
+	if (msg->hdr.type == RXRPC_PACKET_TYPE_ABORT) {
 		_leave(" = 0");
 		return 0;
 	}
@@ -598,12 +610,13 @@
 	_error = htonl(-error);
 
 	/* set up the message to be transmitted */
-	memcpy(&ahdr,&msg->hdr,sizeof(ahdr));
+	memcpy(&ahdr, &msg->hdr, sizeof(ahdr));
 	ahdr.epoch	= msg->hdr.epoch;
 	ahdr.serial	= htonl(1);
 	ahdr.seq	= 0;
 	ahdr.type	= RXRPC_PACKET_TYPE_ABORT;
-	ahdr.flags	= RXRPC_LAST_PACKET | (~msg->hdr.flags & RXRPC_CLIENT_INITIATED);
+	ahdr.flags	= RXRPC_LAST_PACKET;
+	ahdr.flags	|= ~msg->hdr.flags & RXRPC_CLIENT_INITIATED;
 
 	iov[0].iov_len	= sizeof(ahdr);
 	iov[0].iov_base	= &ahdr;
@@ -634,17 +647,17 @@
 	/* send the message */
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = sock_sendmsg(trans->socket,&msghdr,len);
+	ret = sock_sendmsg(trans->socket, &msghdr, len);
 	set_fs(oldfs);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end rxrpc_trans_immediate_abort() */
 
 /*****************************************************************************/
 /*
- * receive an ICMP error report and percolate it to all connections heading to the affected
- * host or port
+ * receive an ICMP error report and percolate it to all connections
+ * heading to the affected host or port
  */
 static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans)
 {
@@ -655,10 +668,10 @@
 	struct errormsg emsg;
 	struct msghdr msg;
 	mm_segment_t oldfs;
+	u_int16_t port;
 	int local, err;
-	u16 port;
 
-	_enter("%p",trans);
+	_enter("%p", trans);
 
 	for (;;) {
 		trans->error_rcvd = 0;
@@ -674,48 +687,63 @@
 
 		oldfs = get_fs();
 		set_fs(KERNEL_DS);
-		err = sock_recvmsg(trans->socket,&msg,0,MSG_ERRQUEUE|MSG_DONTWAIT|MSG_TRUNC);
+		err = sock_recvmsg(trans->socket, &msg, 0,
+				   MSG_ERRQUEUE | MSG_DONTWAIT | MSG_TRUNC);
 		set_fs(oldfs);
 
-		if (err==-EAGAIN) {
+		if (err == -EAGAIN) {
 			_leave("");
 			return;
 		}
 
-		if (err<0) {
-			printk("%s: unable to recv an error report: %d\n",__FUNCTION__,err);
+		if (err < 0) {
+			printk("%s: unable to recv an error report: %d\n",
+			       __FUNCTION__, err);
 			_leave("");
 			return;
 		}
 
-		msg.msg_controllen = (char*)msg.msg_control - (char*)&emsg;
+		msg.msg_controllen = (char *) msg.msg_control - (char *) &emsg;
 
-		if (msg.msg_controllen<sizeof(emsg.cmsg) || msg.msg_namelen<sizeof(sin)) {
-			printk("%s: short control message (nlen=%u clen=%Zu fl=%x)\n",
-			       __FUNCTION__,msg.msg_namelen,msg.msg_controllen,msg.msg_flags);
+		if (msg.msg_controllen < sizeof(emsg.cmsg) ||
+		    msg.msg_namelen < sizeof(sin)) {
+			printk("%s: short control message"
+			       " (nlen=%u clen=%Zu fl=%x)\n",
+			       __FUNCTION__,
+			       msg.msg_namelen,
+			       msg.msg_controllen,
+			       msg.msg_flags);
 			continue;
 		}
 
-		_net("Rx Received control message { len=%Zu level=%u type=%u }",
-		     emsg.cmsg.cmsg_len,emsg.cmsg.cmsg_level,emsg.cmsg.cmsg_type);
-
-		if (sin.sin_family!=AF_INET) {
-			printk("Rx Ignoring error report with non-INET address (fam=%u)",
+		_net("Rx Received control message"
+		     " { len=%Zu level=%u type=%u }",
+		     emsg.cmsg.cmsg_len,
+		     emsg.cmsg.cmsg_level,
+		     emsg.cmsg.cmsg_type);
+
+		if (sin.sin_family != AF_INET) {
+			printk("Rx Ignoring error report with non-INET address"
+			       " (fam=%u)",
 			       sin.sin_family);
 			continue;
 		}
 
 		_net("Rx Received message pertaining to host addr=%x port=%hu",
-		     ntohl(sin.sin_addr.s_addr),ntohs(sin.sin_port));
+		     ntohl(sin.sin_addr.s_addr), ntohs(sin.sin_port));
 
-		if (emsg.cmsg.cmsg_level!=SOL_IP || emsg.cmsg.cmsg_type!=IP_RECVERR) {
-			printk("Rx Ignoring unknown error report { level=%u type=%u }",
-			       emsg.cmsg.cmsg_level,emsg.cmsg.cmsg_type);
+		if (emsg.cmsg.cmsg_level != SOL_IP ||
+		    emsg.cmsg.cmsg_type != IP_RECVERR) {
+			printk("Rx Ignoring unknown error report"
+			       " { level=%u type=%u }",
+			       emsg.cmsg.cmsg_level,
+			       emsg.cmsg.cmsg_type);
 			continue;
 		}
 
-		if (msg.msg_controllen<sizeof(emsg.cmsg)+sizeof(emsg.ee)) {
-			printk("%s: short error message (%Zu)\n",__FUNCTION__,msg.msg_controllen);
+		if (msg.msg_controllen < sizeof(emsg.cmsg) + sizeof(emsg.ee)) {
+			printk("%s: short error message (%Zu)\n",
+			       __FUNCTION__, msg.msg_controllen);
 			_leave("");
 			return;
 		}
@@ -767,14 +795,15 @@
 
 			default:
 				_proto("Rx Received ICMP error { type=%u code=%u }",
-				       emsg.ee.ee_type,emsg.ee.ee_code);
+				       emsg.ee.ee_type, emsg.ee.ee_code);
 				err = emsg.ee.ee_errno;
 				break;
 			}
 			break;
 
 		case SO_EE_ORIGIN_LOCAL:
-			_proto("Rx Received local error { error=%d }",emsg.ee.ee_errno);
+			_proto("Rx Received local error { error=%d }",
+			       emsg.ee.ee_errno);
 			local = 1;
 			err = emsg.ee.ee_errno;
 			break;
@@ -782,35 +811,41 @@
 		case SO_EE_ORIGIN_NONE:
 		case SO_EE_ORIGIN_ICMP6:
 		default:
-			_proto("Rx Received error report { orig=%u }",emsg.ee.ee_origin);
+			_proto("Rx Received error report { orig=%u }",
+			       emsg.ee.ee_origin);
 			local = 0;
 			err = emsg.ee.ee_errno;
 			break;
 		}
 
-		/* find all the connections between this transport and the affected destination */
+		/* find all the connections between this transport and the
+		 * affected destination */
 		INIT_LIST_HEAD(&connq);
 
-		if (rxrpc_peer_lookup(trans,sin.sin_addr.s_addr,&peer)==0) {
+		if (rxrpc_peer_lookup(trans, sin.sin_addr.s_addr,
+				      &peer) == 0) {
 			read_lock(&peer->conn_lock);
-			list_for_each(_p,&peer->conn_active) {
-				conn = list_entry(_p,struct rxrpc_connection,link);
-				if (port && conn->addr.sin_port!=port)
+			list_for_each(_p, &peer->conn_active) {
+				conn = list_entry(_p, struct rxrpc_connection,
+						  link);
+				if (port && conn->addr.sin_port != port)
 					continue;
 				if (!list_empty(&conn->err_link))
 					continue;
 
 				rxrpc_get_connection(conn);
-				list_add_tail(&conn->err_link,&connq);
+				list_add_tail(&conn->err_link, &connq);
 			}
 			read_unlock(&peer->conn_lock);
 
 			/* service all those connections */
 			while (!list_empty(&connq)) {
-				conn = list_entry(connq.next,struct rxrpc_connection,err_link);
+				conn = list_entry(connq.next,
+						  struct rxrpc_connection,
+						  err_link);
 				list_del(&conn->err_link);
 
-				rxrpc_conn_handle_error(conn,local,err);
+				rxrpc_conn_handle_error(conn, local, err);
 
 				rxrpc_put_connection(conn);
 			}

Index: sysctl.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/sysctl.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sysctl.c	14 Feb 2003 10:04:10 -0000	1.4
+++ sysctl.c	12 Aug 2003 17:04:02 -0000	1.5
@@ -99,7 +99,7 @@
 int rxrpc_sysctl_init(void)
 {
 #ifdef CONFIG_SYSCTL
-	rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table,0);
+	rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table, 0);
 	if (!rxrpc_sysctl)
 		return -ENOMEM;
 #endif /* CONFIG_SYSCTL */

Index: proc.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/proc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- proc.c	16 Oct 2002 12:45:02 -0000	1.5
+++ proc.c	12 Aug 2003 17:04:02 -0000	1.6
@@ -133,30 +133,30 @@
 {
 	struct proc_dir_entry *p;
 
-	proc_rxrpc = proc_mkdir("rxrpc",proc_net);
+	proc_rxrpc = proc_mkdir("rxrpc", proc_net);
 	if (!proc_rxrpc)
 		goto error;
 	proc_rxrpc->owner = THIS_MODULE;
 
-	p = create_proc_entry("calls",0,proc_rxrpc);
+	p = create_proc_entry("calls", 0, proc_rxrpc);
 	if (!p)
 		goto error_proc;
 	p->proc_fops = &rxrpc_proc_calls_fops;
 	p->owner = THIS_MODULE;
 
-	p = create_proc_entry("connections",0,proc_rxrpc);
+	p = create_proc_entry("connections", 0, proc_rxrpc);
 	if (!p)
 		goto error_calls;
 	p->proc_fops = &rxrpc_proc_conns_fops;
 	p->owner = THIS_MODULE;
 
-	p = create_proc_entry("peers",0,proc_rxrpc);
+	p = create_proc_entry("peers", 0, proc_rxrpc);
 	if (!p)
 		goto error_calls;
 	p->proc_fops = &rxrpc_proc_peers_fops;
 	p->owner = THIS_MODULE;
 
-	p = create_proc_entry("transports",0,proc_rxrpc);
+	p = create_proc_entry("transports", 0, proc_rxrpc);
 	if (!p)
 		goto error_conns;
 	p->proc_fops = &rxrpc_proc_transports_fops;
@@ -165,11 +165,11 @@
 	return 0;
 
  error_conns:
-	remove_proc_entry("conns",proc_rxrpc);
+	remove_proc_entry("connections", proc_rxrpc);
  error_calls:
-	remove_proc_entry("calls",proc_rxrpc);
+	remove_proc_entry("calls", proc_rxrpc);
  error_proc:
-	remove_proc_entry("rxrpc",proc_net);
+	remove_proc_entry("rxrpc", proc_net);
  error:
 	return -ENOMEM;
 } /* end rxrpc_proc_init() */
@@ -180,12 +180,12 @@
  */
 void rxrpc_proc_cleanup(void)
 {
-	remove_proc_entry("transports",proc_rxrpc);
-	remove_proc_entry("peers",proc_rxrpc);
-	remove_proc_entry("connections",proc_rxrpc);
-	remove_proc_entry("calls",proc_rxrpc);
+	remove_proc_entry("transports", proc_rxrpc);
+	remove_proc_entry("peers", proc_rxrpc);
+	remove_proc_entry("connections", proc_rxrpc);
+	remove_proc_entry("calls", proc_rxrpc);
 
-	remove_proc_entry("rxrpc",proc_net);
+	remove_proc_entry("rxrpc", proc_net);
 
 } /* end rxrpc_proc_cleanup() */
 
@@ -198,8 +198,8 @@
 	struct seq_file *m;
 	int ret;
 
-	ret = seq_open(file,&rxrpc_proc_transports_ops);
-	if (ret<0)
+	ret = seq_open(file, &rxrpc_proc_transports_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -222,15 +222,15 @@
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&rxrpc_proc_transports)
+	list_for_each(_p, &rxrpc_proc_transports)
 		if (!pos--)
 			break;
 
-	return _p!=&rxrpc_proc_transports ? _p : NULL;
+	return _p != &rxrpc_proc_transports ? _p : NULL;
 } /* end rxrpc_proc_transports_start() */
 
 /*****************************************************************************/
@@ -244,9 +244,9 @@
 	(*pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? rxrpc_proc_transports.next : _p->next;
+	_p = v==(void *) 1 ? rxrpc_proc_transports.next : _p->next;
 
-	return _p!=&rxrpc_proc_transports ? _p : NULL;
+	return _p != &rxrpc_proc_transports ? _p : NULL;
 } /* end rxrpc_proc_transports_next() */
 
 /*****************************************************************************/
@@ -265,16 +265,17 @@
  */
 static int rxrpc_proc_transports_show(struct seq_file *m, void *v)
 {
-	struct rxrpc_transport *trans = list_entry(v,struct rxrpc_transport,proc_link);
+	struct rxrpc_transport *trans =
+		list_entry(v, struct rxrpc_transport, proc_link);
 
 	/* display header on line 1 */
-	if (v == (void *)1) {
+	if (v == (void *) 1) {
 		seq_puts(m, "LOCAL USE\n");
 		return 0;
 	}
 
 	/* display one transport per line on subsequent lines */
-	seq_printf(m,"%5hu %3d\n",
+	seq_printf(m, "%5hu %3d\n",
 		   trans->port,
 		   atomic_read(&trans->usage)
 		   );
@@ -291,8 +292,8 @@
 	struct seq_file *m;
 	int ret;
 
-	ret = seq_open(file,&rxrpc_proc_peers_ops);
-	if (ret<0)
+	ret = seq_open(file, &rxrpc_proc_peers_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -303,7 +304,8 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the peers list and return the first item
+ * set up the iterator to start reading from the peers list and return the
+ * first item
  */
 static void *rxrpc_proc_peers_start(struct seq_file *m, loff_t *_pos)
 {
@@ -315,15 +317,15 @@
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&rxrpc_peers)
+	list_for_each(_p, &rxrpc_peers)
 		if (!pos--)
 			break;
 
-	return _p!=&rxrpc_peers ? _p : NULL;
+	return _p != &rxrpc_peers ? _p : NULL;
 } /* end rxrpc_proc_peers_start() */
 
 /*****************************************************************************/
@@ -337,9 +339,9 @@
 	(*pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? rxrpc_peers.next : _p->next;
+	_p = v == (void *) 1 ? rxrpc_peers.next : _p->next;
 
-	return _p!=&rxrpc_peers ? _p : NULL;
+	return _p != &rxrpc_peers ? _p : NULL;
 } /* end rxrpc_proc_peers_next() */
 
 /*****************************************************************************/
@@ -358,21 +360,23 @@
  */
 static int rxrpc_proc_peers_show(struct seq_file *m, void *v)
 {
-	struct rxrpc_peer *peer = list_entry(v,struct rxrpc_peer,proc_link);
+	struct rxrpc_peer *peer = list_entry(v, struct rxrpc_peer, proc_link);
 	signed long timeout;
 
 	/* display header on line 1 */
-	if (v == (void *)1) {
-		seq_puts(m,"LOCAL REMOTE   USAGE CONNS  TIMEOUT   MTU RTT(uS)\n");
+	if (v == (void *) 1) {
+		seq_puts(m, "LOCAL REMOTE   USAGE CONNS  TIMEOUT"
+			 "   MTU RTT(uS)\n");
 		return 0;
 	}
 
 	/* display one peer per line on subsequent lines */
 	timeout = 0;
 	if (!list_empty(&peer->timeout.link))
-		timeout = (signed long)peer->timeout.timo_jif - (signed long)jiffies;
+		timeout = (signed long) peer->timeout.timo_jif -
+			(signed long) jiffies;
 
-	seq_printf(m,"%5hu %08x %5d %5d %8ld %5Zu %7lu\n",
+	seq_printf(m, "%5hu %08x %5d %5d %8ld %5Zu %7lu\n",
 		   peer->trans->port,
 		   ntohl(peer->addr.s_addr),
 		   atomic_read(&peer->usage),
@@ -387,15 +391,16 @@
 
 /*****************************************************************************/
 /*
- * open "/proc/net/rxrpc/connections" which provides a summary of extant connections
+ * open "/proc/net/rxrpc/connections" which provides a summary of extant
+ * connections
  */
 static int rxrpc_proc_conns_open(struct inode *inode, struct file *file)
 {
 	struct seq_file *m;
 	int ret;
 
-	ret = seq_open(file,&rxrpc_proc_conns_ops);
-	if (ret<0)
+	ret = seq_open(file, &rxrpc_proc_conns_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -406,7 +411,8 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the conns list and return the first item
+ * set up the iterator to start reading from the conns list and return the
+ * first item
  */
 static void *rxrpc_proc_conns_start(struct seq_file *m, loff_t *_pos)
 {
@@ -418,15 +424,15 @@
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&rxrpc_conns)
+	list_for_each(_p, &rxrpc_conns)
 		if (!pos--)
 			break;
 
-	return _p!=&rxrpc_conns ? _p : NULL;
+	return _p != &rxrpc_conns ? _p : NULL;
 } /* end rxrpc_proc_conns_start() */
 
 /*****************************************************************************/
@@ -440,9 +446,9 @@
 	(*pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? rxrpc_conns.next : _p->next;
+	_p = (v == (void *) 1) ? rxrpc_conns.next : _p->next;
 
-	return _p!=&rxrpc_conns ? _p : NULL;
+	return _p != &rxrpc_conns ? _p : NULL;
 } /* end rxrpc_proc_conns_next() */
 
 /*****************************************************************************/
@@ -461,13 +467,16 @@
  */
 static int rxrpc_proc_conns_show(struct seq_file *m, void *v)
 {
-	struct rxrpc_connection *conn = list_entry(v,struct rxrpc_connection,proc_link);
+	struct rxrpc_connection *conn;
 	signed long timeout;
 
+	conn = list_entry(v, struct rxrpc_connection, proc_link);
+
 	/* display header on line 1 */
-	if (v == (void *)1) {
+	if (v == (void *) 1) {
 		seq_puts(m,
-			 "LOCAL REMOTE   RPORT SRVC CONN     END SERIALNO CALLNO     MTU  TIMEOUT"
+			 "LOCAL REMOTE   RPORT SRVC CONN     END SERIALNO "
+			 "CALLNO     MTU  TIMEOUT"
 			 "\n");
 		return 0;
 	}
@@ -475,9 +484,11 @@
 	/* display one conn per line on subsequent lines */
 	timeout = 0;
 	if (!list_empty(&conn->timeout.link))
-		timeout = (signed long)conn->timeout.timo_jif - (signed long)jiffies;
+		timeout = (signed long) conn->timeout.timo_jif -
+			(signed long) jiffies;
 
-	seq_printf(m,"%5hu %08x %5hu %04hx %08x %-3.3s %08x %08x %5Zu %8ld\n",
+	seq_printf(m,
+		   "%5hu %08x %5hu %04hx %08x %-3.3s %08x %08x %5Zu %8ld\n",
 		   conn->trans->port,
 		   ntohl(conn->addr.sin_addr.s_addr),
 		   ntohs(conn->addr.sin_port),
@@ -502,8 +513,8 @@
 	struct seq_file *m;
 	int ret;
 
-	ret = seq_open(file,&rxrpc_proc_calls_ops);
-	if (ret<0)
+	ret = seq_open(file, &rxrpc_proc_calls_ops);
+	if (ret < 0)
 		return ret;
 
 	m = file->private_data;
@@ -514,7 +525,8 @@
 
 /*****************************************************************************/
 /*
- * set up the iterator to start reading from the calls list and return the first item
+ * set up the iterator to start reading from the calls list and return the
+ * first item
  */
 static void *rxrpc_proc_calls_start(struct seq_file *m, loff_t *_pos)
 {
@@ -526,15 +538,15 @@
 
 	/* allow for the header line */
 	if (!pos)
-		return (void *)1;
+		return (void *) 1;
 	pos--;
 
 	/* find the n'th element in the list */
-	list_for_each(_p,&rxrpc_calls)
+	list_for_each(_p, &rxrpc_calls)
 		if (!pos--)
 			break;
 
-	return _p!=&rxrpc_calls ? _p : NULL;
+	return _p != &rxrpc_calls ? _p : NULL;
 } /* end rxrpc_proc_calls_start() */
 
 /*****************************************************************************/
@@ -548,9 +560,9 @@
 	(*pos)++;
 
 	_p = v;
-	_p = v==(void*)1 ? rxrpc_calls.next : _p->next;
+	_p = (v == (void *) 1) ? rxrpc_calls.next : _p->next;
 
-	return _p!=&rxrpc_calls ? _p : NULL;
+	return _p != &rxrpc_calls ? _p : NULL;
 } /* end rxrpc_proc_calls_next() */
 
 /*****************************************************************************/
@@ -569,10 +581,10 @@
  */
 static int rxrpc_proc_calls_show(struct seq_file *m, void *v)
 {
-	struct rxrpc_call *call = list_entry(v,struct rxrpc_call,call_link);
+	struct rxrpc_call *call = list_entry(v, struct rxrpc_call, call_link);
 
 	/* display header on line 1 */
-	if (v == (void *)1) {
+	if (v == (void *) 1) {
 		seq_puts(m,
 			 "LOCAL REMOT SRVC CONN     CALL     DIR USE "
 			 " L STATE   OPCODE ABORT    ERRNO\n"

Index: peer.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/peer.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- peer.c	4 Feb 2003 16:12:04 -0000	1.5
+++ peer.c	12 Aug 2003 17:04:02 -0000	1.6
@@ -32,9 +32,10 @@
 
 static void __rxrpc_peer_timeout(rxrpc_timer_t *timer)
 {
-	struct rxrpc_peer *peer = list_entry(timer,struct rxrpc_peer,timeout);
+	struct rxrpc_peer *peer =
+		list_entry(timer, struct rxrpc_peer, timeout);
 
-	_debug("Rx PEER TIMEOUT [%p{u=%d}]",peer,atomic_read(&peer->usage));
+	_debug("Rx PEER TIMEOUT [%p{u=%d}]", peer, atomic_read(&peer->usage));
 
 	rxrpc_peer_do_timeout(peer);
 }
@@ -47,21 +48,22 @@
 /*
  * create a peer record
  */
-static int __rxrpc_create_peer(struct rxrpc_transport *trans, u32 addr, struct rxrpc_peer **_peer)
+static int __rxrpc_create_peer(struct rxrpc_transport *trans, u_int32_t addr,
+			       struct rxrpc_peer **_peer)
 {
 	struct rxrpc_peer *peer;
 
-	_enter("%p,%08x",trans,ntohl(addr));
+	_enter("%p,%08x", trans, ntohl(addr));
 
 	/* allocate and initialise a peer record */
-	peer = kmalloc(sizeof(struct rxrpc_peer),GFP_KERNEL);
+	peer = kmalloc(sizeof(struct rxrpc_peer), GFP_KERNEL);
 	if (!peer) {
 		_leave(" = -ENOMEM");
 		return -ENOMEM;
 	}
 
-	memset(peer,0,sizeof(struct rxrpc_peer));
-	atomic_set(&peer->usage,1);
+	memset(peer, 0, sizeof(struct rxrpc_peer));
+	atomic_set(&peer->usage, 1);
 
 	INIT_LIST_HEAD(&peer->link);
 	INIT_LIST_HEAD(&peer->proc_link);
@@ -70,9 +72,9 @@
 	spin_lock_init(&peer->conn_gylock);
 	init_waitqueue_head(&peer->conn_gy_waitq);
 	rwlock_init(&peer->conn_lock);
-	atomic_set(&peer->conn_count,0);
+	atomic_set(&peer->conn_count, 0);
 	spin_lock_init(&peer->lock);
-	rxrpc_timer_init(&peer->timeout,&rxrpc_peer_timer_ops);
+	rxrpc_timer_init(&peer->timeout, &rxrpc_peer_timer_ops);
 
 	peer->addr.s_addr = addr;
 
@@ -81,7 +83,7 @@
 
 	__RXACCT(atomic_inc(&rxrpc_peer_count));
 	*_peer = peer;
-	_leave(" = 0 (%p)",peer);
+	_leave(" = 0 (%p)", peer);
 
 	return 0;
 } /* end __rxrpc_create_peer() */
@@ -92,43 +94,45 @@
  * - returns (if successful) with peer record usage incremented
  * - resurrects it from the graveyard if found there
  */
-int rxrpc_peer_lookup(struct rxrpc_transport *trans, u32 addr, struct rxrpc_peer **_peer)
+int rxrpc_peer_lookup(struct rxrpc_transport *trans, u_int32_t addr,
+		      struct rxrpc_peer **_peer)
 {
 	struct rxrpc_peer *peer, *candidate = NULL;
 	struct list_head *_p;
 	int ret;
 
-	_enter("%p{%hu},%08x",trans,trans->port,ntohl(addr));
+	_enter("%p{%hu},%08x", trans, trans->port, ntohl(addr));
 
 	/* [common case] search the transport's active list first */
 	read_lock(&trans->peer_lock);
-	list_for_each(_p,&trans->peer_active) {
-		peer = list_entry(_p,struct rxrpc_peer,link);
-		if (peer->addr.s_addr==addr)
+	list_for_each(_p, &trans->peer_active) {
+		peer = list_entry(_p, struct rxrpc_peer, link);
+		if (peer->addr.s_addr == addr)
 			goto found_active;
 	}
 	read_unlock(&trans->peer_lock);
 
 	/* [uncommon case] not active - create a candidate for a new record */
-	ret = __rxrpc_create_peer(trans,addr,&candidate);
-	if (ret<0) {
-		_leave(" = %d",ret);
+	ret = __rxrpc_create_peer(trans, addr, &candidate);
+	if (ret < 0) {
+		_leave(" = %d", ret);
 		return ret;
 	}
 
-	/* search the active list again, just in case it appeared whilst we were busy */
+	/* search the active list again, just in case it appeared whilst we
+	 * were busy */
 	write_lock(&trans->peer_lock);
-	list_for_each(_p,&trans->peer_active) {
-		peer = list_entry(_p,struct rxrpc_peer,link);
-		if (peer->addr.s_addr==addr)
+	list_for_each(_p, &trans->peer_active) {
+		peer = list_entry(_p, struct rxrpc_peer, link);
+		if (peer->addr.s_addr == addr)
 			goto found_active_second_chance;
 	}
 
 	/* search the transport's graveyard list */
 	spin_lock(&trans->peer_gylock);
-	list_for_each(_p,&trans->peer_graveyard) {
-		peer = list_entry(_p,struct rxrpc_peer,link);
-		if (peer->addr.s_addr==addr)
+	list_for_each(_p, &trans->peer_graveyard) {
+		peer = list_entry(_p, struct rxrpc_peer, link);
+		if (peer->addr.s_addr == addr)
 			goto found_in_graveyard;
 	}
 	spin_unlock(&trans->peer_gylock);
@@ -142,12 +146,12 @@
 
 	if (peer->ops && peer->ops->adding) {
 		ret = peer->ops->adding(peer);
-		if (ret<0) {
+		if (ret < 0) {
 			write_unlock(&trans->peer_lock);
 			__RXACCT(atomic_dec(&rxrpc_peer_count));
 			kfree(peer);
 			rxrpc_put_transport(trans);
-			_leave(" = %d",ret);
+			_leave(" = %d", ret);
 			return ret;
 		}
 	}
@@ -155,7 +159,7 @@
 	atomic_inc(&trans->peer_count);
 
  make_active:
-	list_add_tail(&peer->link,&trans->peer_active);
+	list_add_tail(&peer->link, &trans->peer_active);
 
  success_uwfree:
 	write_unlock(&trans->peer_lock);
@@ -167,7 +171,7 @@
 
 	if (list_empty(&peer->proc_link)) {
 		down_write(&rxrpc_peers_sem);
-		list_add_tail(&peer->proc_link,&rxrpc_peers);
+		list_add_tail(&peer->proc_link, &rxrpc_peers);
 		up_write(&rxrpc_peers_sem);
 	}
 
@@ -175,7 +179,9 @@
 	*_peer = peer;
 
 	_leave(" = 0 (%p{u=%d cc=%d})",
-	       peer,atomic_read(&peer->usage),atomic_read(&peer->conn_count));
+	       peer,
+	       atomic_read(&peer->usage),
+	       atomic_read(&peer->conn_count));
 	return 0;
 
 	/* handle the peer being found in the active list straight off */
@@ -193,7 +199,8 @@
 	spin_unlock(&trans->peer_gylock);
 	goto make_active;
 
-	/* handle finding the peer on the second time through the active list */
+	/* handle finding the peer on the second time through the active
+	 * list */
  found_active_second_chance:
 	rxrpc_get_peer(peer);
 	goto success_uwfree;
@@ -203,16 +210,20 @@
 /*****************************************************************************/
 /*
  * finish with a peer record
- * - it gets sent to the graveyard from where it can be resurrected or timed out
+ * - it gets sent to the graveyard from where it can be resurrected or timed
+ *   out
  */
 void rxrpc_put_peer(struct rxrpc_peer *peer)
 {
 	struct rxrpc_transport *trans = peer->trans;
 
-	_enter("%p{cc=%d a=%08x}",peer,atomic_read(&peer->conn_count),ntohl(peer->addr.s_addr));
+	_enter("%p{cc=%d a=%08x}",
+	       peer,
+	       atomic_read(&peer->conn_count),
+	       ntohl(peer->addr.s_addr));
 
 	/* sanity check */
-	if (atomic_read(&peer->usage)<=0)
+	if (atomic_read(&peer->usage) <= 0)
 		BUG();
 
 	write_lock(&trans->peer_lock);
@@ -228,11 +239,11 @@
 	list_del(&peer->link);
 	write_unlock(&trans->peer_lock);
 
-	list_add_tail(&peer->link,&trans->peer_graveyard);
+	list_add_tail(&peer->link, &trans->peer_graveyard);
 
-	if (!list_empty(&peer->conn_active)) BUG();
+	BUG_ON(!list_empty(&peer->conn_active));
 
-	rxrpc_krxtimod_add_timer(&peer->timeout,rxrpc_peer_timeout*HZ);
+	rxrpc_krxtimod_add_timer(&peer->timeout, rxrpc_peer_timeout * HZ);
 
 	spin_unlock(&trans->peer_gylock);
 
@@ -251,15 +262,16 @@
 	struct rxrpc_transport *trans = peer->trans;
 
 	_enter("%p{u=%d cc=%d a=%08x}",
-	       peer,atomic_read(&peer->usage),atomic_read(&peer->conn_count),
+	       peer,
+	       atomic_read(&peer->usage),
+	       atomic_read(&peer->conn_count),
 	       ntohl(peer->addr.s_addr));
 
-	if (atomic_read(&peer->usage)<0)
-		BUG();
+	BUG_ON(atomic_read(&peer->usage) < 0);
 
 	/* remove from graveyard if still dead */
 	spin_lock(&trans->peer_gylock);
-	if (atomic_read(&peer->usage)==0)
+	if (atomic_read(&peer->usage) == 0)
 		list_del_init(&peer->link);
 	else
 		peer = NULL;
@@ -273,8 +285,8 @@
 	/* clear all connections on this peer */
 	rxrpc_conn_clearall(peer);
 
-	if (!list_empty(&peer->conn_active)) BUG();
-	if (!list_empty(&peer->conn_graveyard)) BUG();
+	BUG_ON(!list_empty(&peer->conn_active));
+	BUG_ON(!list_empty(&peer->conn_graveyard));
 
 	/* inform the application layer */
 	if (peer->ops && peer->ops->discarding)
@@ -310,18 +322,18 @@
 	_enter("%p",trans);
 
 	/* there shouldn't be any active peers remaining */
-	if (!list_empty(&trans->peer_active))
-		BUG();
+	BUG_ON(!list_empty(&trans->peer_active));
 
 	/* manually timeout all peers in the graveyard */
 	spin_lock(&trans->peer_gylock);
 	while (!list_empty(&trans->peer_graveyard)) {
-		peer = list_entry(trans->peer_graveyard.next,struct rxrpc_peer,link);
-		_debug("Clearing peer %p\n",peer);
+		peer = list_entry(trans->peer_graveyard.next,
+				  struct rxrpc_peer, link);
+		_debug("Clearing peer %p\n", peer);
 		err = rxrpc_krxtimod_del_timer(&peer->timeout);
 		spin_unlock(&trans->peer_gylock);
 
-		if (err==0)
+		if (err == 0)
 			rxrpc_peer_do_timeout(peer);
 
 		spin_lock(&trans->peer_gylock);
@@ -330,18 +342,17 @@
 
 	/* wait for the the peer graveyard to be completely cleared */
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	add_wait_queue(&trans->peer_gy_waitq,&myself);
+	add_wait_queue(&trans->peer_gy_waitq, &myself);
 
-	while (atomic_read(&trans->peer_count)!=0) {
+	while (atomic_read(&trans->peer_count) != 0) {
 		schedule();
 		set_current_state(TASK_UNINTERRUPTIBLE);
 	}
 
-	remove_wait_queue(&trans->peer_gy_waitq,&myself);
+	remove_wait_queue(&trans->peer_gy_waitq, &myself);
 	set_current_state(TASK_RUNNING);
 
 	_leave("");
-
 } /* end rxrpc_peer_clearall() */
 
 /*****************************************************************************/
@@ -355,7 +366,7 @@
 	unsigned long long rtt;
 	int loop;
 
-	_enter("%p,%p,%p",peer,msg,resp);
+	_enter("%p,%p,%p", peer, msg, resp);
 
 	/* calculate the latest RTT */
 	rtt = resp->stamp.tv_sec - msg->stamp.tv_sec;
@@ -367,16 +378,18 @@
 	peer->rtt_point++;
 	peer->rtt_point %= RXRPC_RTT_CACHE_SIZE;
 
-	if (peer->rtt_usage<RXRPC_RTT_CACHE_SIZE) peer->rtt_usage++;
+	if (peer->rtt_usage < RXRPC_RTT_CACHE_SIZE)
+		peer->rtt_usage++;
 
 	/* recalculate RTT */
 	rtt = 0;
-	for (loop=peer->rtt_usage-1; loop>=0; loop--)
+	for (loop = peer->rtt_usage - 1; loop >= 0; loop--)
 		rtt += peer->rtt_cache[loop];
 
-	do_div(rtt,peer->rtt_usage);
+	do_div(rtt, peer->rtt_usage);
 	peer->rtt = rtt;
 
-	_leave(" RTT=%lu.%lums",(long)(peer->rtt/1000),(long)(peer->rtt%1000));
+	_leave(" RTT=%lu.%lums",
+	       (long) (peer->rtt / 1000), (long) (peer->rtt % 1000));
 
 } /* end rxrpc_peer_calculate_rtt() */

Index: main.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- main.c	4 Jul 2003 15:23:51 -0000	1.4
+++ main.c	12 Aug 2003 17:04:02 -0000	1.5
@@ -32,7 +32,7 @@
 MODULE_AUTHOR("Red Hat, Inc.");
 MODULE_LICENSE("GPL");
 
-u32 rxrpc_epoch;
+u_int32_t rxrpc_epoch;
 
 /*****************************************************************************/
 /*
@@ -101,11 +101,16 @@
 {
 	kenter("");
 
-	__RXACCT(printk("Outstanding Messages   : %d\n",atomic_read(&rxrpc_message_count)));
-	__RXACCT(printk("Outstanding Calls      : %d\n",atomic_read(&rxrpc_call_count)));
-	__RXACCT(printk("Outstanding Connections: %d\n",atomic_read(&rxrpc_connection_count)));
-	__RXACCT(printk("Outstanding Peers      : %d\n",atomic_read(&rxrpc_peer_count)));
-	__RXACCT(printk("Outstanding Transports : %d\n",atomic_read(&rxrpc_transport_count)));
+	__RXACCT(printk("Outstanding Messages   : %d\n",
+			atomic_read(&rxrpc_message_count)));
+	__RXACCT(printk("Outstanding Calls      : %d\n",
+			atomic_read(&rxrpc_call_count)));
+	__RXACCT(printk("Outstanding Connections: %d\n",
+			atomic_read(&rxrpc_connection_count)));
+	__RXACCT(printk("Outstanding Peers      : %d\n",
+			atomic_read(&rxrpc_peer_count)));
+	__RXACCT(printk("Outstanding Transports : %d\n",
+			atomic_read(&rxrpc_transport_count)));
 
 	rxrpc_krxsecd_kill();
 	rxrpc_krxiod_kill();
@@ -117,11 +122,16 @@
 	rxrpc_proc_cleanup();
 #endif
 
-	__RXACCT(printk("Outstanding Messages   : %d\n",atomic_read(&rxrpc_message_count)));
-	__RXACCT(printk("Outstanding Calls      : %d\n",atomic_read(&rxrpc_call_count)));
-	__RXACCT(printk("Outstanding Connections: %d\n",atomic_read(&rxrpc_connection_count)));
-	__RXACCT(printk("Outstanding Peers      : %d\n",atomic_read(&rxrpc_peer_count)));
-	__RXACCT(printk("Outstanding Transports : %d\n",atomic_read(&rxrpc_transport_count)));
+	__RXACCT(printk("Outstanding Messages   : %d\n",
+			atomic_read(&rxrpc_message_count)));
+	__RXACCT(printk("Outstanding Calls      : %d\n",
+			atomic_read(&rxrpc_call_count)));
+	__RXACCT(printk("Outstanding Connections: %d\n",
+			atomic_read(&rxrpc_connection_count)));
+	__RXACCT(printk("Outstanding Peers      : %d\n",
+			atomic_read(&rxrpc_peer_count)));
+	__RXACCT(printk("Outstanding Transports : %d\n",
+			atomic_read(&rxrpc_transport_count)));
 
 	kleave("");
 } /* end rxrpc_cleanup() */

Index: krxtimod.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/krxtimod.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- krxtimod.c	9 Apr 2003 15:43:06 -0000	1.6
+++ krxtimod.c	12 Aug 2003 17:04:02 -0000	1.7
@@ -37,8 +37,8 @@
 {
 	int ret;
 
-	ret = kernel_thread(krxtimod,NULL,0);
-	if (ret<0)
+	ret = kernel_thread(krxtimod, NULL, 0);
+	if (ret < 0)
 		return ret;
 
 	wait_for_completion(&krxtimod_alive);
@@ -65,11 +65,11 @@
  */
 static int krxtimod(void *arg)
 {
-	DECLARE_WAITQUEUE(myself,current);
+	DECLARE_WAITQUEUE(myself, current);
 
 	rxrpc_timer_t *timer;
 
-	printk("Started krxtimod %d\n",current->pid);
+	printk("Started krxtimod %d\n", current->pid);
 
 	daemonize("krxtimod");
 
@@ -77,14 +77,14 @@
 
 	/* only certain signals are of interest */
 	spin_lock_irq(&current->sighand->siglock);
-	siginitsetinv(&current->blocked,0);
+	siginitsetinv(&current->blocked, 0);
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
 	/* loop around looking for things to attend to */
  loop:
 	set_current_state(TASK_INTERRUPTIBLE);
-	add_wait_queue(&krxtimod_sleepq,&myself);
+	add_wait_queue(&krxtimod_sleepq, &myself);
 
 	for (;;) {
 		unsigned long jif;
@@ -92,9 +92,9 @@
 
 		/* deal with the server being asked to die */
 		if (krxtimod_die) {
-			remove_wait_queue(&krxtimod_sleepq,&myself);
+			remove_wait_queue(&krxtimod_sleepq, &myself);
 			_leave("");
-			complete_and_exit(&krxtimod_dead,0);
+			complete_and_exit(&krxtimod_dead, 0);
 		}
 
 		/* discard pending signals */
@@ -106,15 +106,16 @@
 			timeout = MAX_SCHEDULE_TIMEOUT;
 		}
 		else {
-			timer = list_entry(krxtimod_list.next,rxrpc_timer_t,link);
+			timer = list_entry(krxtimod_list.next,
+					   rxrpc_timer_t, link);
 			timeout = timer->timo_jif;
 			jif = jiffies;
 
-			if (time_before_eq((unsigned long)timeout,jif))
+			if (time_before_eq((unsigned long) timeout, jif))
 				goto immediate;
 
 			else {
-				timeout = (long)timeout - (long)jiffies;
+				timeout = (long) timeout - (long) jiffies;
 			}
 		}
 		spin_unlock(&krxtimod_lock);
@@ -125,13 +126,14 @@
 	}
 
 	/* the thing on the front of the queue needs processing
-	 * - we come here with the lock held and timer pointing to the expired entry
+	 * - we come here with the lock held and timer pointing to the expired
+	 *   entry
 	 */
  immediate:
-	remove_wait_queue(&krxtimod_sleepq,&myself);
+	remove_wait_queue(&krxtimod_sleepq, &myself);
 	set_current_state(TASK_RUNNING);
 
-	_debug("@@@ Begin Timeout of %p",timer);
+	_debug("@@@ Begin Timeout of %p", timer);
 
 	/* dequeue the timer */
 	list_del_init(&timer->link);
@@ -154,29 +156,30 @@
 	struct list_head *_p;
 	rxrpc_timer_t *ptimer;
 
-	_enter("%p,%lu",timer,timeout);
+	_enter("%p,%lu", timer, timeout);
 
 	spin_lock(&krxtimod_lock);
 
 	list_del(&timer->link);
 
-	/* the timer was deferred or reset - put it back in the queue at the right place */
+	/* the timer was deferred or reset - put it back in the queue at the
+	 * right place */
 	timer->timo_jif = jiffies + timeout;
 
-	list_for_each(_p,&krxtimod_list) {
-		ptimer = list_entry(_p,rxrpc_timer_t,link);
-		if (time_before(timer->timo_jif,ptimer->timo_jif))
+	list_for_each(_p, &krxtimod_list) {
+		ptimer = list_entry(_p, rxrpc_timer_t, link);
+		if (time_before(timer->timo_jif, ptimer->timo_jif))
 			break;
 	}
 
-	list_add_tail(&timer->link,_p); /* insert before stopping point */
+	list_add_tail(&timer->link, _p); /* insert before stopping point */
 
 	spin_unlock(&krxtimod_lock);
 
 	wake_up(&krxtimod_sleepq);
 
 	_leave("");
-} /* end rxrpc_krxtimod_queue_vlocation() */
+} /* end rxrpc_krxtimod_add_timer() */
 
 /*****************************************************************************/
 /*
@@ -187,7 +190,7 @@
 {
 	int ret = 0;
 
-	_enter("%p",timer);
+	_enter("%p", timer);
 
 	spin_lock(&krxtimod_lock);
 
@@ -200,6 +203,6 @@
 
 	wake_up(&krxtimod_sleepq);
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 	return ret;
 } /* end rxrpc_krxtimod_del_timer() */

Index: krxsecd.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/krxsecd.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- krxsecd.c	2 Mar 2003 18:56:14 -0000	1.7
+++ krxsecd.c	12 Aug 2003 17:04:02 -0000	1.8
@@ -37,7 +37,8 @@
 
 static atomic_t rxrpc_krxsecd_qcount;
 
-/* queue of unprocessed inbound messages with seqno #1 and RXRPC_CLIENT_INITIATED flag set */
+/* queue of unprocessed inbound messages with seqno #1 and
+ * RXRPC_CLIENT_INITIATED flag set */
 static LIST_HEAD(rxrpc_krxsecd_initmsgq);
 static spinlock_t rxrpc_krxsecd_initmsgq_lock = SPIN_LOCK_UNLOCKED;
 
@@ -49,17 +50,17 @@
  */
 static int rxrpc_krxsecd(void *arg)
 {
-	DECLARE_WAITQUEUE(krxsecd,current);
+	DECLARE_WAITQUEUE(krxsecd, current);
 
 	int die;
 
-	printk("Started krxsecd %d\n",current->pid);
+	printk("Started krxsecd %d\n", current->pid);
 
 	daemonize("krxsecd");
 
 	/* only certain signals are of interest */
 	spin_lock_irq(&current->sighand->siglock);
-	siginitsetinv(&current->blocked,0);
+	siginitsetinv(&current->blocked, 0);
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
@@ -70,7 +71,7 @@
 		if (!atomic_read(&rxrpc_krxsecd_qcount)) {
 			set_current_state(TASK_INTERRUPTIBLE);
 
-			add_wait_queue(&rxrpc_krxsecd_sleepq,&krxsecd);
+			add_wait_queue(&rxrpc_krxsecd_sleepq, &krxsecd);
 
 			for (;;) {
 				set_current_state(TASK_INTERRUPTIBLE);
@@ -82,7 +83,7 @@
 				schedule();
 			}
 
-			remove_wait_queue(&rxrpc_krxsecd_sleepq,&krxsecd);
+			remove_wait_queue(&rxrpc_krxsecd_sleepq, &krxsecd);
 			set_current_state(TASK_RUNNING);
 		}
 		die = rxrpc_krxsecd_die;
@@ -98,7 +99,7 @@
 
 			if (!list_empty(&rxrpc_krxsecd_initmsgq)) {
 				msg = list_entry(rxrpc_krxsecd_initmsgq.next,
-						 struct rxrpc_message,link);
+						 struct rxrpc_message, link);
 				list_del_init(&msg->link);
 				atomic_dec(&rxrpc_krxsecd_qcount);
 			}
@@ -119,7 +120,7 @@
 	} while (!die);
 
 	/* and that's all */
-	complete_and_exit(&rxrpc_krxsecd_dead,0);
+	complete_and_exit(&rxrpc_krxsecd_dead, 0);
 
 } /* end rxrpc_krxsecd() */
 
@@ -129,7 +130,7 @@
  */
 int __init rxrpc_krxsecd_init(void)
 {
-	return kernel_thread(rxrpc_krxsecd,NULL,0);
+	return kernel_thread(rxrpc_krxsecd, NULL, 0);
 
 } /* end rxrpc_krxsecd_init() */
 
@@ -161,11 +162,11 @@
 	/* move all the messages for this transport onto a temp list */
 	spin_lock(&rxrpc_krxsecd_initmsgq_lock);
 
-	list_for_each_safe(_p,_n,&rxrpc_krxsecd_initmsgq) {
-		msg = list_entry(_p,struct rxrpc_message,link);
-		if (msg->trans==trans) {
+	list_for_each_safe(_p, _n, &rxrpc_krxsecd_initmsgq) {
+		msg = list_entry(_p, struct rxrpc_message, link);
+		if (msg->trans == trans) {
 			list_del(&msg->link);
-			list_add_tail(&msg->link,&tmp);
+			list_add_tail(&msg->link, &tmp);
 			atomic_dec(&rxrpc_krxsecd_qcount);
 		}
 	}
@@ -174,7 +175,7 @@
 
 	/* zap all messages on the temp list */
 	while (!list_empty(&tmp)) {
-		msg = list_entry(tmp.next,struct rxrpc_message,link);
+		msg = list_entry(tmp.next, struct rxrpc_message, link);
 		list_del_init(&msg->link);
 		rxrpc_put_message(msg);
 	}
@@ -188,14 +189,14 @@
  */
 void rxrpc_krxsecd_queue_incoming_call(struct rxrpc_message *msg)
 {
-	_enter("%p",msg);
+	_enter("%p", msg);
 
 	/* queue for processing by krxsecd */
 	spin_lock(&rxrpc_krxsecd_initmsgq_lock);
 
 	if (!rxrpc_krxsecd_die) {
 		rxrpc_get_message(msg);
-		list_add_tail(&msg->link,&rxrpc_krxsecd_initmsgq);
+		list_add_tail(&msg->link, &rxrpc_krxsecd_initmsgq);
 		atomic_inc(&rxrpc_krxsecd_qcount);
 	}
 
@@ -219,10 +220,10 @@
 	unsigned short sid;
 	int ret;
 
-	_enter("%p{tr=%p}",msg,trans);
+	_enter("%p{tr=%p}", msg, trans);
 
-	ret = rxrpc_incoming_call(msg->conn,msg,&call);
-	if (ret<0)
+	ret = rxrpc_incoming_call(msg->conn, msg, &call);
+	if (ret < 0)
 		goto out;
 
 	/* find the matching service on the transport */
@@ -230,11 +231,11 @@
 	srv = NULL;
 
 	spin_lock(&trans->lock);
-	list_for_each(_p,&trans->services) {
-		srv = list_entry(_p,struct rxrpc_service,link);
-		if (srv->service_id==sid && try_module_get(srv->owner)) {
+	list_for_each(_p, &trans->services) {
+		srv = list_entry(_p, struct rxrpc_service, link);
+		if (srv->service_id == sid && try_module_get(srv->owner)) {
 			/* found a match (made sure it won't vanish) */
-			_debug("found service '%s'",srv->name);
+			_debug("found service '%s'", srv->name);
 			call->owner = srv->owner;
 			break;
 		}
@@ -245,7 +246,7 @@
 	 * - the func must inc the call's usage count to keep it
 	 */
 	ret = -ENOENT;
-	if (_p!=&trans->services) {
+	if (_p != &trans->services) {
 		/* attempt to accept the call */
 		call->conn->service = srv;
 		call->app_attn_func = srv->attn_func;
@@ -255,19 +256,20 @@
 		ret = srv->new_call(call);
 
 		/* send an abort if an error occurred */
-		if (ret<0) {
-			rxrpc_call_abort(call,ret);
+		if (ret < 0) {
+			rxrpc_call_abort(call, ret);
 		}
 		else {
 			/* formally receive and ACK the new packet */
-			ret = rxrpc_conn_receive_call_packet(call->conn,call,msg);
+			ret = rxrpc_conn_receive_call_packet(call->conn,
+							     call, msg);
 		}
 	}
 
 	rxrpc_put_call(call);
  out:
-	if (ret<0)
-		rxrpc_trans_immediate_abort(trans,msg,ret);
+	if (ret < 0)
+		rxrpc_trans_immediate_abort(trans, msg, ret);
 
-	_leave(" (%d)",ret);
+	_leave(" (%d)", ret);
 } /* end rxrpc_krxsecd_process_incoming_call() */

Index: krxiod.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/krxiod.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- krxiod.c	2 Mar 2003 18:56:14 -0000	1.6
+++ krxiod.c	12 Aug 2003 17:04:02 -0000	1.7
@@ -47,7 +47,7 @@
 
 	/* only certain signals are of interest */
 	spin_lock_irq(&current->sighand->siglock);
-	siginitsetinv(&current->blocked,0);
+	siginitsetinv(&current->blocked, 0);
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
@@ -58,7 +58,7 @@
 		if (!atomic_read(&rxrpc_krxiod_qcount)) {
 			set_current_state(TASK_INTERRUPTIBLE);
 
-			add_wait_queue(&rxrpc_krxiod_sleepq,&krxiod);
+			add_wait_queue(&rxrpc_krxiod_sleepq, &krxiod);
 
 			for (;;) {
 				set_current_state(TASK_INTERRUPTIBLE);
@@ -70,7 +70,7 @@
 				schedule();
 			}
 
-			remove_wait_queue(&rxrpc_krxiod_sleepq,&krxiod);
+			remove_wait_queue(&rxrpc_krxiod_sleepq, &krxiod);
 			set_current_state(TASK_RUNNING);
 		}
 		_debug("### End Wait");
@@ -85,12 +85,16 @@
 			spin_lock_irq(&rxrpc_krxiod_transportq_lock);
 
 			if (!list_empty(&rxrpc_krxiod_transportq)) {
-				trans = list_entry(rxrpc_krxiod_transportq.next,
-						   struct rxrpc_transport,krxiodq_link);
+				trans = list_entry(
+					rxrpc_krxiod_transportq.next,
+					struct rxrpc_transport,
+					krxiodq_link);
+
 				list_del_init(&trans->krxiodq_link);
 				atomic_dec(&rxrpc_krxiod_qcount);
 
-				/* make sure it hasn't gone away and doesn't go away */
+				/* make sure it hasn't gone away and doesn't go
+				 * away */
 				if (atomic_read(&trans->usage)>0)
 					rxrpc_get_transport(trans);
 				else
@@ -113,13 +117,16 @@
 
 			if (!list_empty(&rxrpc_krxiod_callq)) {
 				call = list_entry(rxrpc_krxiod_callq.next,
-						   struct rxrpc_call,rcv_krxiodq_lk);
+						   struct rxrpc_call,
+						  rcv_krxiodq_lk);
 				list_del_init(&call->rcv_krxiodq_lk);
 				atomic_dec(&rxrpc_krxiod_qcount);
 
-				/* make sure it hasn't gone away and doesn't go away */
-				if (atomic_read(&call->usage)>0) {
-					_debug("@@@ KRXIOD Begin Attend Call %p",call);
+				/* make sure it hasn't gone away and doesn't go
+				 * away */
+				if (atomic_read(&call->usage) > 0) {
+					_debug("@@@ KRXIOD"
+					       " Begin Attend Call %p",call);
 					rxrpc_get_call(call);
 				}
 				else {
@@ -132,7 +139,7 @@
 			if (call) {
 				rxrpc_call_do_stuff(call);
 				rxrpc_put_call(call);
-				_debug("@@@ KRXIOD End Attend Call %p",call);
+				_debug("@@@ KRXIOD End Attend Call %p", call);
 			}
 		}
 
@@ -144,7 +151,7 @@
 	} while (!rxrpc_krxiod_die);
 
 	/* and that's all */
-	complete_and_exit(&rxrpc_krxiod_dead,0);
+	complete_and_exit(&rxrpc_krxiod_dead, 0);
 
 } /* end rxrpc_krxiod() */
 
@@ -154,7 +161,7 @@
  */
 int __init rxrpc_krxiod_init(void)
 {
-	return kernel_thread(rxrpc_krxiod,NULL,0);
+	return kernel_thread(rxrpc_krxiod, NULL, 0);
 
 } /* end rxrpc_krxiod_init() */
 
@@ -181,16 +188,17 @@
 	_enter("");
 
 	if (list_empty(&trans->krxiodq_link)) {
-		spin_lock_irqsave(&rxrpc_krxiod_transportq_lock,flags);
+		spin_lock_irqsave(&rxrpc_krxiod_transportq_lock, flags);
 
 		if (list_empty(&trans->krxiodq_link)) {
-			if (atomic_read(&trans->usage)>0) {
-				list_add_tail(&trans->krxiodq_link,&rxrpc_krxiod_transportq);
+			if (atomic_read(&trans->usage) > 0) {
+				list_add_tail(&trans->krxiodq_link,
+					      &rxrpc_krxiod_transportq);
 				atomic_inc(&rxrpc_krxiod_qcount);
 			}
 		}
 
-		spin_unlock_irqrestore(&rxrpc_krxiod_transportq_lock,flags);
+		spin_unlock_irqrestore(&rxrpc_krxiod_transportq_lock, flags);
 		wake_up_all(&rxrpc_krxiod_sleepq);
 	}
 
@@ -208,12 +216,12 @@
 
 	_enter("");
 
-	spin_lock_irqsave(&rxrpc_krxiod_transportq_lock,flags);
+	spin_lock_irqsave(&rxrpc_krxiod_transportq_lock, flags);
 	if (!list_empty(&trans->krxiodq_link)) {
 		list_del_init(&trans->krxiodq_link);
 		atomic_dec(&rxrpc_krxiod_qcount);
 	}
-	spin_unlock_irqrestore(&rxrpc_krxiod_transportq_lock,flags);
+	spin_unlock_irqrestore(&rxrpc_krxiod_transportq_lock, flags);
 
 	_leave("");
 
@@ -228,15 +236,16 @@
 	unsigned long flags;
 
 	if (list_empty(&call->rcv_krxiodq_lk)) {
-		spin_lock_irqsave(&rxrpc_krxiod_callq_lock,flags);
-		if (atomic_read(&call->usage)>0) {
-			list_add_tail(&call->rcv_krxiodq_lk,&rxrpc_krxiod_callq);
+		spin_lock_irqsave(&rxrpc_krxiod_callq_lock, flags);
+		if (atomic_read(&call->usage) > 0) {
+			list_add_tail(&call->rcv_krxiodq_lk,
+				      &rxrpc_krxiod_callq);
 			atomic_inc(&rxrpc_krxiod_qcount);
 		}
-		spin_unlock_irqrestore(&rxrpc_krxiod_callq_lock,flags);
+		spin_unlock_irqrestore(&rxrpc_krxiod_callq_lock, flags);
 	}
 	wake_up_all(&rxrpc_krxiod_sleepq);
-	
+
 } /* end rxrpc_krxiod_queue_call() */
 
 /*****************************************************************************/
@@ -247,11 +256,11 @@
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&rxrpc_krxiod_callq_lock,flags);
+	spin_lock_irqsave(&rxrpc_krxiod_callq_lock, flags);
 	if (!list_empty(&call->rcv_krxiodq_lk)) {
 		list_del_init(&call->rcv_krxiodq_lk);
 		atomic_dec(&rxrpc_krxiod_qcount);
 	}
-	spin_unlock_irqrestore(&rxrpc_krxiod_callq_lock,flags);
+	spin_unlock_irqrestore(&rxrpc_krxiod_callq_lock, flags);
 
 } /* end rxrpc_krxiod_dequeue_call() */

Index: internal.h
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/internal.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- internal.h	2 Mar 2003 18:56:14 -0000	1.8
+++ internal.h	12 Aug 2003 17:04:02 -0000	1.9
@@ -55,7 +55,7 @@
 		siginfo_t sinfo;
 
 		spin_lock_irq(&current->sighand->siglock);
-		dequeue_signal(current,&current->blocked,&sinfo);
+		dequeue_signal(current, &current->blocked, &sinfo);
 		spin_unlock_irq(&current->sighand->siglock);
 	}
 }

Index: connection.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/connection.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- connection.c	4 Feb 2003 16:12:04 -0000	1.4
+++ connection.c	12 Aug 2003 17:04:02 -0000	1.5
@@ -32,9 +32,10 @@
 
 static void __rxrpc_conn_timeout(rxrpc_timer_t *timer)
 {
-	struct rxrpc_connection *conn = list_entry(timer,struct rxrpc_connection,timeout);
+	struct rxrpc_connection *conn =
+		list_entry(timer, struct rxrpc_connection, timeout);
 
-	_debug("Rx CONN TIMEOUT [%p{u=%d}]",conn,atomic_read(&conn->usage));
+	_debug("Rx CONN TIMEOUT [%p{u=%d}]", conn, atomic_read(&conn->usage));
 
 	rxrpc_conn_do_timeout(conn);
 }
@@ -55,19 +56,19 @@
 	_enter("%p",peer);
 
 	/* allocate and initialise a connection record */
-	conn = kmalloc(sizeof(struct rxrpc_connection),GFP_KERNEL);
+	conn = kmalloc(sizeof(struct rxrpc_connection), GFP_KERNEL);
 	if (!conn) {
 		_leave(" = -ENOMEM");
 		return -ENOMEM;
 	}
 
-	memset(conn,0,sizeof(struct rxrpc_connection));
-	atomic_set(&conn->usage,1);
+	memset(conn, 0, sizeof(struct rxrpc_connection));
+	atomic_set(&conn->usage, 1);
 
 	INIT_LIST_HEAD(&conn->link);
 	init_waitqueue_head(&conn->chanwait);
 	spin_lock_init(&conn->lock);
-	rxrpc_timer_init(&conn->timeout,&rxrpc_conn_timer_ops);
+	rxrpc_timer_init(&conn->timeout, &rxrpc_conn_timer_ops);
 
 	do_gettimeofday(&conn->atime);
 	conn->mtu_size = 1024;
@@ -76,7 +77,7 @@
 
 	__RXACCT(atomic_inc(&rxrpc_connection_count));
 	*_conn = conn;
-	_leave(" = 0 (%p)",conn);
+	_leave(" = 0 (%p)", conn);
 
 	return 0;
 } /* end __rxrpc_create_connection() */
@@ -86,9 +87,9 @@
  * create a new connection record for outgoing connections
  */
 int rxrpc_create_connection(struct rxrpc_transport *trans,
-			    u16 port,
-			    u32 addr,
-			    unsigned short service_id,
+			    u_int16_t port,
+			    u_int32_t addr,
+			    u_int16_t service_id,
 			    void *security,
 			    struct rxrpc_connection **_conn)
 {
@@ -97,20 +98,20 @@
 	struct list_head *_p;
 	int ret;
 
-	_enter("%p{%hu},%u,%hu",trans,trans->port,ntohs(port),service_id);
+	_enter("%p{%hu},%u,%hu", trans, trans->port, ntohs(port), service_id);
 
 	/* get a peer record */
-	ret = rxrpc_peer_lookup(trans,addr,&peer);
-	if (ret<0) {
-		_leave(" = %d",ret);
+	ret = rxrpc_peer_lookup(trans, addr, &peer);
+	if (ret < 0) {
+		_leave(" = %d", ret);
 		return ret;
 	}
 
 	/* allocate and initialise a connection record */
-	ret = __rxrpc_create_connection(peer,&candidate);
-	if (ret<0) {
+	ret = __rxrpc_create_connection(peer, &candidate);
+	if (ret < 0) {
 		rxrpc_put_peer(peer);
-		_leave(" = %d",ret);
+		_leave(" = %d", ret);
 		return ret;
 	}
 
@@ -123,7 +124,8 @@
 	candidate->out_epoch		= rxrpc_epoch;
 	candidate->in_clientflag	= 0;
 	candidate->out_clientflag	= RXRPC_CLIENT_INITIATED;
-	candidate->conn_id		= htonl((unsigned long) candidate & RXRPC_CIDMASK);
+	candidate->conn_id		= htonl((unsigned long)
+						candidate & RXRPC_CIDMASK);
 	candidate->service_id		= htons(service_id);
 
 	/* attach to peer */
@@ -133,8 +135,8 @@
 
 	/* search the peer's transport graveyard list */
 	spin_lock(&peer->conn_gylock);
-	list_for_each(_p,&peer->conn_graveyard) {
-		conn = list_entry(_p,struct rxrpc_connection,link);
+	list_for_each(_p, &peer->conn_graveyard) {
+		conn = list_entry(_p, struct rxrpc_connection, link);
 		if (conn->addr.sin_port	== candidate->addr.sin_port	&&
 		    conn->security_ix	== candidate->security_ix	&&
 		    conn->service_id	== candidate->service_id	&& 
@@ -144,13 +146,13 @@
 	spin_unlock(&peer->conn_gylock);
 
 	/* pick the new candidate */
-	_debug("created connection: {%08x} [out]",htonl(candidate->conn_id));
+	_debug("created connection: {%08x} [out]", htonl(candidate->conn_id));
 	atomic_inc(&peer->conn_count);
 	conn = candidate;
 	candidate = NULL;
 
  make_active:
-	list_add_tail(&conn->link,&peer->conn_active);
+	list_add_tail(&conn->link, &peer->conn_active);
 	write_unlock(&peer->conn_lock);
 
 	if (candidate) {
@@ -159,18 +161,18 @@
 	}
 	else {
 		down_write(&rxrpc_conns_sem);
-		list_add_tail(&conn->proc_link,&rxrpc_conns);
+		list_add_tail(&conn->proc_link, &rxrpc_conns);
 		up_write(&rxrpc_conns_sem);
 	}
 
 	*_conn = conn;
-	_leave(" = 0 (%p)",conn);
+	_leave(" = 0 (%p)", conn);
 
 	return 0;
 
 	/* handle resurrecting a connection from the graveyard */
  found_in_graveyard:
-	_debug("resurrecting connection: {%08x} [out]",htonl(conn->conn_id));
+	_debug("resurrecting connection: {%08x} [out]", htonl(conn->conn_id));
 	rxrpc_get_connection(conn);
 	rxrpc_krxtimod_del_timer(&conn->timeout);
 	list_del_init(&conn->link);
@@ -195,7 +197,10 @@
 	u8 x_clflag;
 
 	_enter("%p{{%hu}},%u,%hu",
-	       peer,peer->trans->port,ntohs(msg->pkt->h.uh->source),ntohs(msg->hdr.serviceId));
+	       peer,
+	       peer->trans->port,
+	       ntohs(msg->pkt->h.uh->source),
+	       ntohs(msg->hdr.serviceId));
 
 	x_port		= msg->pkt->h.uh->source;
 	x_epoch		= msg->hdr.epoch;
@@ -206,8 +211,8 @@
 
 	/* [common case] search the transport's active list first */
 	read_lock(&peer->conn_lock);
-	list_for_each(_p,&peer->conn_active) {
-		conn = list_entry(_p,struct rxrpc_connection,link);
+	list_for_each(_p, &peer->conn_active) {
+		conn = list_entry(_p, struct rxrpc_connection, link);
 		if (conn->addr.sin_port		== x_port	&&
 		    conn->in_epoch		== x_epoch	&&
 		    conn->conn_id		== x_connid	&&
@@ -223,9 +228,9 @@
 	 * - only examine the graveyard for an outbound connection
 	 */
 	if (x_clflag) {
-		ret = __rxrpc_create_connection(peer,&candidate);
-		if (ret<0) {
-			_leave(" = %d",ret);
+		ret = __rxrpc_create_connection(peer, &candidate);
+		if (ret < 0) {
+			_leave(" = %d", ret);
 			return ret;
 		}
 
@@ -242,10 +247,11 @@
 		candidate->security_ix		= x_secix;
 	}
 
-	/* search the active list again, just in case it appeared whilst we were busy */
+	/* search the active list again, just in case it appeared whilst we
+	 * were busy */
 	write_lock(&peer->conn_lock);
-	list_for_each(_p,&peer->conn_active) {
-		conn = list_entry(_p,struct rxrpc_connection,link);
+	list_for_each(_p, &peer->conn_active) {
+		conn = list_entry(_p, struct rxrpc_connection, link);
 		if (conn->addr.sin_port		== x_port	&&
 		    conn->in_epoch		== x_epoch	&&
 		    conn->conn_id		== x_connid	&&
@@ -257,8 +263,8 @@
 
 	/* search the transport's graveyard list */
 	spin_lock(&peer->conn_gylock);
-	list_for_each(_p,&peer->conn_graveyard) {
-		conn = list_entry(_p,struct rxrpc_connection,link);
+	list_for_each(_p, &peer->conn_graveyard) {
+		conn = list_entry(_p, struct rxrpc_connection, link);
 		if (conn->addr.sin_port		== x_port	&&
 		    conn->in_epoch		== x_epoch	&&
 		    conn->conn_id		== x_connid	&&
@@ -277,7 +283,7 @@
 	}
 
 	/* we can now add the new candidate to the list */
-	_debug("created connection: {%08x} [in]",htonl(candidate->conn_id));
+	_debug("created connection: {%08x} [in]", htonl(candidate->conn_id));
 	rxrpc_get_peer(peer);
 	conn = candidate;
 	candidate = NULL;
@@ -285,7 +291,7 @@
 	fresh = 1;
 
  make_active:
-	list_add_tail(&conn->link,&peer->conn_active);
+	list_add_tail(&conn->link, &peer->conn_active);
 
  success_uwfree:
 	write_unlock(&peer->conn_lock);
@@ -297,13 +303,13 @@
 
 	if (fresh) {
 		down_write(&rxrpc_conns_sem);
-		list_add_tail(&conn->proc_link,&rxrpc_conns);
+		list_add_tail(&conn->proc_link, &rxrpc_conns);
 		up_write(&rxrpc_conns_sem);
 	}
 
  success:
 	*_conn = conn;
-	_leave(" = 0 (%p)",conn);
+	_leave(" = 0 (%p)", conn);
 	return 0;
 
 	/* handle the connection being found in the active list straight off */
@@ -314,7 +320,7 @@
 
 	/* handle resurrecting a connection from the graveyard */
  found_in_graveyard:
-	_debug("resurrecting connection: {%08x} [in]",htonl(conn->conn_id));
+	_debug("resurrecting connection: {%08x} [in]", htonl(conn->conn_id));
 	rxrpc_get_peer(peer);
 	rxrpc_get_connection(conn);
 	rxrpc_krxtimod_del_timer(&conn->timeout);
@@ -322,7 +328,8 @@
 	spin_unlock(&peer->conn_gylock);
 	goto make_active;
 
-	/* handle finding the connection on the second time through the active list */
+	/* handle finding the connection on the second time through the active
+	 * list */
  found_active_second_chance:
 	rxrpc_get_connection(conn);
 	goto success_uwfree;
@@ -332,18 +339,24 @@
 /*****************************************************************************/
 /*
  * finish using a connection record
- * - it will be transferred to the peer's connection graveyard when refcount reaches 0
+ * - it will be transferred to the peer's connection graveyard when refcount
+ *   reaches 0
  */
 void rxrpc_put_connection(struct rxrpc_connection *conn)
 {
-	struct rxrpc_peer *peer = conn->peer;
+	struct rxrpc_peer *peer;
+
+	if (!conn)
+		return;
 
-	_enter("%p{u=%d p=%hu}",conn,atomic_read(&conn->usage),ntohs(conn->addr.sin_port));
+	_enter("%p{u=%d p=%hu}",
+	       conn, atomic_read(&conn->usage), ntohs(conn->addr.sin_port));
 
+	peer = conn->peer;
 	spin_lock(&peer->conn_gylock);
 
 	/* sanity check */
-	if (atomic_read(&conn->usage)<=0)
+	if (atomic_read(&conn->usage) <= 0)
 		BUG();
 
 	if (likely(!atomic_dec_and_test(&conn->usage))) {
@@ -353,11 +366,11 @@
 	}
 
 	/* move to graveyard queue */
-	_debug("burying connection: {%08x}",htonl(conn->conn_id));
+	_debug("burying connection: {%08x}", htonl(conn->conn_id));
 	list_del(&conn->link);
-	list_add_tail(&conn->link,&peer->conn_graveyard);
+	list_add_tail(&conn->link, &peer->conn_graveyard);
 
-	rxrpc_krxtimod_add_timer(&conn->timeout,rxrpc_conn_timeout*HZ);
+	rxrpc_krxtimod_add_timer(&conn->timeout, rxrpc_conn_timeout * HZ);
 
 	spin_unlock(&peer->conn_gylock);
 
@@ -374,16 +387,17 @@
 {
 	struct rxrpc_peer *peer;
 
-	_enter("%p{u=%d p=%hu}",conn,atomic_read(&conn->usage),ntohs(conn->addr.sin_port));
+	_enter("%p{u=%d p=%hu}",
+	       conn, atomic_read(&conn->usage), ntohs(conn->addr.sin_port));
 
 	peer = conn->peer;
 
-	if (atomic_read(&conn->usage)<0)
+	if (atomic_read(&conn->usage) < 0)
 		BUG();
 
 	/* remove from graveyard if still dead */
 	spin_lock(&peer->conn_gylock);
-	if (atomic_read(&conn->usage)==0) {
+	if (atomic_read(&conn->usage) == 0) {
 		list_del_init(&conn->link);
 	}
 	else {
@@ -396,7 +410,8 @@
 		return; /* resurrected */
 	}
 
-	_debug("--- Destroying Connection %p{%08x} ---",conn,htonl(conn->conn_id));
+	_debug("--- Destroying Connection %p{%08x} ---",
+	       conn, htonl(conn->conn_id));
 
 	down_write(&rxrpc_conns_sem);
 	list_del(&conn->proc_link);
@@ -418,12 +433,12 @@
  */
 void rxrpc_conn_clearall(struct rxrpc_peer *peer)
 {
-	DECLARE_WAITQUEUE(myself,current);
+	DECLARE_WAITQUEUE(myself, current);
 
 	struct rxrpc_connection *conn;
 	int err;
 
-	_enter("%p",peer);
+	_enter("%p", peer);
 
 	/* there shouldn't be any active conns remaining */
 	if (!list_empty(&peer->conn_active))
@@ -432,11 +447,12 @@
 	/* manually timeout all conns in the graveyard */
 	spin_lock(&peer->conn_gylock);
 	while (!list_empty(&peer->conn_graveyard)) {
-		conn = list_entry(peer->conn_graveyard.next,struct rxrpc_connection,link);
+		conn = list_entry(peer->conn_graveyard.next,
+				  struct rxrpc_connection, link);
 		err = rxrpc_krxtimod_del_timer(&conn->timeout);
 		spin_unlock(&peer->conn_gylock);
 
-		if (err==0)
+		if (err == 0)
 			rxrpc_conn_do_timeout(conn);
 
 		spin_lock(&peer->conn_gylock);
@@ -445,27 +461,27 @@
 
 	/* wait for the the conn graveyard to be completely cleared */
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	add_wait_queue(&peer->conn_gy_waitq,&myself);
+	add_wait_queue(&peer->conn_gy_waitq, &myself);
 
-	while (atomic_read(&peer->conn_count)!=0) {
+	while (atomic_read(&peer->conn_count) != 0) {
 		schedule();
 		set_current_state(TASK_UNINTERRUPTIBLE);
 	}
 
-	remove_wait_queue(&peer->conn_gy_waitq,&myself);
+	remove_wait_queue(&peer->conn_gy_waitq, &myself);
 	set_current_state(TASK_RUNNING);
 
 	_leave("");
-
 } /* end rxrpc_conn_clearall() */
 
 /*****************************************************************************/
 /*
- * allocate and prepare a message for sending out through the transport endpoint
+ * allocate and prepare a message for sending out through the transport
+ * endpoint
  */
 int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
 		      struct rxrpc_call *call,
-		      u8 type,
+		      u_int8_t type,
 		      int dcount,
 		      struct iovec diov[],
 		      int alloc_flags,
@@ -474,21 +490,21 @@
 	struct rxrpc_message *msg;
 	int loop;
 
-	_enter("%p{%d},%p,%u",conn,ntohs(conn->addr.sin_port),call,type);
+	_enter("%p{%d},%p,%u", conn, ntohs(conn->addr.sin_port), call, type);
 
-	if (dcount>3) {
+	if (dcount > 3) {
 		_leave(" = -EINVAL");
 		return -EINVAL;
 	}
 
-	msg = kmalloc(sizeof(struct rxrpc_message),alloc_flags);
+	msg = kmalloc(sizeof(struct rxrpc_message), alloc_flags);
 	if (!msg) {
 		_leave(" = -ENOMEM");
 		return -ENOMEM;
 	}
 
-	memset(msg,0,sizeof(*msg));
-	atomic_set(&msg->usage,1);
+	memset(msg, 0, sizeof(*msg));
+	atomic_set(&msg->usage, 1);
 
 	INIT_LIST_HEAD(&msg->link);
 
@@ -510,7 +526,8 @@
 			msg->hdr.seq = htonl(msg->seq);
 			break;
 		case RXRPC_PACKET_TYPE_ACK:
-			/* ACK sequence numbers are complicated. The following may be wrong:
+			/* ACK sequence numbers are complicated. The following
+			 * may be wrong:
 			 * - jumbo packet ACKs should have a seq number
 			 * - normal ACKs should not
 			 */
@@ -524,7 +541,7 @@
 	msg->data[0].iov_len = sizeof(msg->hdr);
 	msg->data[0].iov_base = &msg->hdr;
 
-	for (loop=0; loop<dcount; loop++) {
+	for (loop=0; loop < dcount; loop++) {
 		msg->dsize += diov[loop].iov_len;
 		msg->data[loop+1].iov_len  = diov[loop].iov_len;
 		msg->data[loop+1].iov_base = diov[loop].iov_base;
@@ -532,7 +549,7 @@
 
 	__RXACCT(atomic_inc(&rxrpc_message_count));
 	*_msg = msg;
-	_leave(" = 0 (%p) #%d",msg,atomic_read(&rxrpc_message_count));
+	_leave(" = 0 (%p) #%d", msg, atomic_read(&rxrpc_message_count));
 	return 0;
 } /* end rxrpc_conn_newmsg() */
 
@@ -544,13 +561,14 @@
 {
 	int loop;
 
-	_enter("%p #%d",msg,atomic_read(&rxrpc_message_count));
+	_enter("%p #%d", msg, atomic_read(&rxrpc_message_count));
 
-	if (msg->pkt) kfree_skb(msg->pkt);
-	if (msg->conn) rxrpc_put_connection(msg->conn);
+	if (msg->pkt)
+		kfree_skb(msg->pkt);
+	rxrpc_put_connection(msg->conn);
 
-	for (loop=0; loop<8; loop++)
-		if (test_bit(loop,&msg->dfree))
+	for (loop = 0; loop < 8; loop++)
+		if (test_bit(loop, &msg->dfree))
 			kfree(msg->data[loop].iov_base);
 
 	__RXACCT(atomic_dec(&rxrpc_message_count));
@@ -563,13 +581,14 @@
 /*
  * send a message out through the transport endpoint
  */
-int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, struct rxrpc_message *msg)
+int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
+		       struct rxrpc_message *msg)
 {
 	struct msghdr msghdr;
 	mm_segment_t oldfs;
 	int ret;
 
-	_enter("%p{%d}",conn,ntohs(conn->addr.sin_port));
+	_enter("%p{%d}", conn, ntohs(conn->addr.sin_port));
 
 	/* fill in some fields in the header */
 	spin_lock(&conn->lock);
@@ -584,7 +603,7 @@
 	msghdr.msg_iovlen	= msg->dcount;
 	msghdr.msg_control	= NULL;
 	msghdr.msg_controllen	= 0;
-	msghdr.msg_flags	= MSG_CONFIRM|MSG_DONTWAIT;
+	msghdr.msg_flags	= MSG_CONFIRM | MSG_DONTWAIT;
 
 	_net("Sending message type %d of %Zd bytes to %08x:%d",
 	     msg->hdr.type,
@@ -595,10 +614,10 @@
 	/* send the message */
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = sock_sendmsg(conn->trans->socket,&msghdr,msg->dsize);
+	ret = sock_sendmsg(conn->trans->socket, &msghdr, msg->dsize);
 	set_fs(oldfs);
 
-	if (ret<0) {
+	if (ret < 0) {
 		msg->state = RXRPC_MSG_ERROR;
 	}
 	else {
@@ -611,7 +630,7 @@
 		spin_unlock(&conn->lock);
 	}
 
-	_leave(" = %d",ret);
+	_leave(" = %d", ret);
 
 	return ret;
 } /* end rxrpc_conn_sendmsg() */
@@ -629,7 +648,7 @@
 	unsigned cix, seq;
 	int ret = 0;
 
-	_enter("%p,%p,%p",conn,call,msg);
+	_enter("%p,%p,%p", conn, call, msg);
 
 	if (!call) {
 		cix = ntohl(msg->hdr.cid) & RXRPC_CHANNELMASK;
@@ -639,7 +658,7 @@
 
 		if (!call || call->call_id != msg->hdr.callNumber) {
 			spin_unlock(&conn->lock);
-			rxrpc_trans_immediate_abort(conn->trans,msg,-ENOENT);
+			rxrpc_trans_immediate_abort(conn->trans, msg, -ENOENT);
 			goto out;
 		}
 		else {
@@ -661,19 +680,21 @@
 	call->pkt_rcv_count++;
 
 	if (msg->pkt->dst && msg->pkt->dst->dev)
-		conn->peer->if_mtu = msg->pkt->dst->dev->mtu - msg->pkt->dst->dev->hard_header_len;
+		conn->peer->if_mtu =
+			msg->pkt->dst->dev->mtu -
+			msg->pkt->dst->dev->hard_header_len;
 
 	/* queue on the call in seq order */
 	rxrpc_get_message(msg);
 	seq = msg->seq;
 
 	spin_lock(&call->lock);
-	list_for_each(_p,&call->rcv_receiveq) {
-		pmsg = list_entry(_p,struct rxrpc_message,link);
-		if (pmsg->seq>seq)
+	list_for_each(_p, &call->rcv_receiveq) {
+		pmsg = list_entry(_p, struct rxrpc_message, link);
+		if (pmsg->seq > seq)
 			break;
 	}
-	list_add_tail(&msg->link,_p);
+	list_add_tail(&msg->link, _p);
 
 	/* reset the activity timeout */
 	call->flags |= RXRPC_CALL_RCV_PKT;
@@ -685,8 +706,7 @@
 
 	rxrpc_put_call(call);
  out:
-	_leave(" = %d",ret);
-
+	_leave(" = %d", ret);
 	return ret;
 } /* end rxrpc_conn_receive_call_packet() */
 
@@ -694,18 +714,19 @@
 /*
  * handle an ICMP error being applied to a connection
  */
-void rxrpc_conn_handle_error(struct rxrpc_connection *conn, int local, int errno)
+void rxrpc_conn_handle_error(struct rxrpc_connection *conn,
+			     int local, int errno)
 {
 	struct rxrpc_call *calls[4];
 	int loop;
 
-	_enter("%p{%d},%d",conn,ntohs(conn->addr.sin_port),errno);
+	_enter("%p{%d},%d", conn, ntohs(conn->addr.sin_port), errno);
 
 	/* get a ref to all my calls in one go */
-	memset(calls,0,sizeof(calls));
+	memset(calls, 0, sizeof(calls));
 	spin_lock(&conn->lock);
 
-	for (loop=3; loop>=0; loop--) {
+	for (loop = 3; loop >= 0; loop--) {
 		if (conn->channels[loop]) {
 			calls[loop] = conn->channels[loop];
 			rxrpc_get_call(calls[loop]);
@@ -715,9 +736,9 @@
 	spin_unlock(&conn->lock);
 
 	/* now kick them all */
-	for (loop=3; loop>=0; loop--) {
+	for (loop = 3; loop >= 0; loop--) {
 		if (calls[loop]) {
-			rxrpc_call_handle_error(calls[loop],local,errno);
+			rxrpc_call_handle_error(calls[loop], local, errno);
 			rxrpc_put_call(calls[loop]);
 		}
 	}

Index: call.c
===================================================================
RCS file: /home/cvs/afs/net/rxrpc/call.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- call.c	4 Feb 2003 16:12:04 -0000	1.6
+++ call.c	12 Aug 2003 17:04:02 -0000	1.7
@@ -53,20 +53,25 @@
 };
 
 const char *rxrpc_pkts[] = {
-	"?00", "data", "ack", "busy", "abort", "ackall", "chall", "resp", "debug",
+	"?00",
+	"data", "ack", "busy", "abort", "ackall", "chall", "resp", "debug",
 	"?09", "?10", "?11", "?12", "?13", "?14", "?15"
 };
 
 const char *rxrpc_acks[] = {
-	"---", "REQ", "DUP", "SEQ", "WIN", "MEM", "PNG", "PNR", "DLY", "IDL", "-?-"
[...1977 lines suppressed...]
-	if (call->app_call_state==RXRPC_CSTATE_ERROR) {
+	if (call->app_call_state == RXRPC_CSTATE_ERROR) {
 		call->app_error_func(call);
 	}
 	else {
@@ -2124,10 +2253,10 @@
 			call->app_err_state = RXRPC_ESTATE_LOCAL_ERROR;
 		else
 			call->app_err_state = RXRPC_ESTATE_REMOTE_ERROR;
-		call->app_errno = errno;
-		call->app_mark = RXRPC_APP_MARK_EOF;
-		call->app_read_buf = NULL;
-		call->app_async_read = 0;
+		call->app_errno		= errno;
+		call->app_mark		= RXRPC_APP_MARK_EOF;
+		call->app_read_buf	= NULL;
+		call->app_async_read	= 0;
 
 		/* map the error */
 		call->app_aemap_func(call);




More information about the linux-afs-cvs mailing list