patch-2.4.9 linux/net/sunrpc/xprt.c

Next file: linux/net/unix/af_unix.c
Previous file: linux/net/sunrpc/sunrpc_syms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c
@@ -84,11 +84,6 @@
 # define RPCDBG_FACILITY	RPCDBG_XPRT
 #endif
 
-#ifndef MAX
-# define MAX(a, b)	((a) > (b)? (a) : (b))
-# define MIN(a, b)	((a) < (b)? (a) : (b))
-#endif
-
 /*
  * Local functions
  */
@@ -749,7 +744,7 @@
 
 	if (xprt->tcp_copied >= sizeof(xprt->tcp_xid) || !avail)
 		goto done;
-	want = MIN(sizeof(xprt->tcp_xid) - xprt->tcp_copied, avail);
+	want = min(unsigned int, sizeof(xprt->tcp_xid) - xprt->tcp_copied, avail);
 	do {
 		dprintk("RPC:      reading xid (%d bytes)\n", want);
 		riov.iov_base = ((u8*) &xprt->tcp_xid) + xprt->tcp_copied;
@@ -776,7 +771,7 @@
 
 	if (req->rq_rlen <= xprt->tcp_copied || !avail)
 		goto done;
-	want = MIN(req->rq_rlen - xprt->tcp_copied, avail);
+	want = min(unsigned int, req->rq_rlen - xprt->tcp_copied, avail);
 	do {
 		dprintk("RPC: %4d TCP receiving %d bytes\n",
 			req->rq_task->tk_pid, want);
@@ -810,7 +805,7 @@
 	int		want, result = 0;
 
 	while (avail) {
-		want = MIN(avail, sizeof(dummy));
+		want = min(unsigned int, avail, sizeof(dummy));
 		riov.iov_base = dummy;
 		riov.iov_len  = want;
 		dprintk("RPC:      TCP skipping %d bytes\n", want);
@@ -1072,7 +1067,7 @@
 
 
 	/* Wait until we have enough socket memory */
-	if (sock_wspace(sk) < min(sk->sndbuf,XPRT_MIN_WRITE_SPACE))
+	if (sock_wspace(sk) < min(int, sk->sndbuf,XPRT_MIN_WRITE_SPACE))
 		return;
 
 	if (!xprt_test_and_set_wspace(xprt)) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)