patch-2.4.10 linux/drivers/isdn/icn/icn.c

Next file: linux/drivers/isdn/icn/icn.h
Previous file: linux/drivers/isdn/hisax/st5481_usb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/isdn/icn/icn.c linux/drivers/isdn/icn/icn.c
@@ -1,4 +1,4 @@
-/* $Id: icn.c,v 1.65.6.6 2001/07/13 09:20:12 kai Exp $
+/* $Id: icn.c,v 1.65.6.7 2001/08/17 12:34:27 kai Exp $
 
  * ISDN low-level module for the ICN active ISDN-Card.
  *
@@ -34,7 +34,7 @@
 #undef MAP_DEBUG
 
 static char
-*revision = "$Revision: 1.65.6.6 $";
+*revision = "$Revision: 1.65.6.7 $";
 
 static int icn_addcard(int, char *, char *);
 
@@ -607,7 +607,7 @@
 	int left;
 	u_char c;
 	int ch;
-	int flags;
+	long flags;
 	int i;
 	u_char *p;
 	isdn_ctrl cmd;
@@ -930,7 +930,9 @@
 	restore_flags(flags);
 	while (left) {
 		if (sbfree) {   /* If there is a free buffer...  */
-			cnt = MIN(256, left);
+			cnt = left;
+			if (cnt > 256)
+				cnt = 256;
 			if (copy_from_user(codebuf, p, cnt)) {
 				icn_maprelease_channel(card, 0);
 				return -EFAULT;
@@ -1029,7 +1031,6 @@
 icn_writecmd(const u_char * buf, int len, int user, icn_card * card)
 {
 	int mch = card->secondhalf ? 2 : 0;
-	int avail;
 	int pp;
 	int i;
 	int count;
@@ -1046,8 +1047,9 @@
 	ocount = 1;
 	xcount = loop = 0;
 	while (len) {
-		avail = cmd_free;
-		count = MIN(avail, len);
+		count = cmd_free;
+		if (count > len)
+			count = len;
 		if (user)
 			copy_from_user(msg, buf, count);
 		else

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