patch-2.4.9 linux/drivers/net/wireless/airo.c

Next file: linux/drivers/net/wireless/airport.c
Previous file: linux/drivers/net/wan/wanpipe_multppp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/drivers/net/wireless/airo.c linux/drivers/net/wireless/airo.c
@@ -259,8 +259,6 @@
 
 #include <asm/uaccess.h>
 
-#define min(x,y) ((x<y)?x:y)
-
 /* This is a kind of sloppy hack to get this information to OUT4500 and
    IN4500.  I would be extremely interested in the situation where this
    doesnt work though!!! */
@@ -1755,7 +1753,7 @@
 	// read the rid length field
 	bap_read(ai, pBuf, 2, BAP1);
 	// length for remaining part of rid
-	len = min(len, le16_to_cpu(*(u16*)pBuf)) - 2;
+	len = min(unsigned int, len, le16_to_cpu(*(u16*)pBuf)) - 2;
 	
 	if ( len <= 2 ) {
 		printk( KERN_ERR 
@@ -3998,7 +3996,8 @@
 	 * 9/22/2000 Honor user given length
 	 */
 
-	if (copy_to_user(comp->data, iobuf, min (comp->len, sizeof(iobuf))))
+	if (copy_to_user(comp->data, iobuf,
+			 min(unsigned int, comp->len, sizeof(iobuf))))
 		return -EFAULT;
 	return 0;
 }
@@ -4057,7 +4056,8 @@
 
 		PC4500_readrid(dev->priv,ridcode,iobuf,sizeof(iobuf));
 
-		if (copy_to_user(comp->data,iobuf,min(comp->len,sizeof(iobuf))))
+		if (copy_to_user(comp->data, iobuf,
+				 min(unsigned int, comp->len, sizeof(iobuf))))
 			return -EFAULT;
 		return 0;
 

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