patch-2.4.10 linux/drivers/usb/serial/digi_acceleport.c

Next file: linux/drivers/usb/serial/empeg.c
Previous file: linux/drivers/usb/serial/cyberjack.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/usb/serial/digi_acceleport.c linux/drivers/usb/serial/digi_acceleport.c
@@ -409,11 +409,6 @@
 #define DIGI_READ_INPUT_SIGNALS_DCD		128
 
 
-/* macros */
-#define MAX(a,b)	(((a)>(b))?(a):(b))
-#define MIN(a,b)	(((a)<(b))?(a):(b))
-
-
 /* Structures */
 
 typedef struct digi_serial {
@@ -675,7 +670,7 @@
 		}
 
 		/* len must be a multiple of 4, so commands are not split */
-		len = MIN( count, oob_port->bulk_out_size );
+		len = min(count, oob_port->bulk_out_size );
 		if( len > 4 )
 			len &= ~3;
 
@@ -752,7 +747,7 @@
 		/* len must be a multiple of 4 and small enough to */
 		/* guarantee the write will send buffered data first, */
 		/* so commands are in order with data and not split */
-		len = MIN( count, port->bulk_out_size-2-priv->dp_out_buf_len );
+		len = min(count, port->bulk_out_size-2-priv->dp_out_buf_len );
 		if( len > 4 )
 			len &= ~3;
 
@@ -956,7 +951,7 @@
 	spin_lock_irqsave( &priv->dp_port_lock, flags );
 
 	/* send any buffered chars from throttle time on to tty subsystem */
-	len = MIN( priv->dp_in_buf_len, TTY_FLIPBUF_SIZE - tty->flip.count );
+	len = min(priv->dp_in_buf_len, TTY_FLIPBUF_SIZE - tty->flip.count );
 	if( len > 0 ) {
 		memcpy( tty->flip.char_buf_ptr, priv->dp_in_buf, len );
 		memcpy( tty->flip.flag_buf_ptr, priv->dp_in_flag_buf, len );
@@ -1277,7 +1272,8 @@
 priv->dp_port_num, count, from_user, in_interrupt() );
 
 	/* copy user data (which can sleep) before getting spin lock */
-	count = MIN( 64, MIN( count, port->bulk_out_size-2 ) );
+	count = min( count, port->bulk_out_size-2 );
+	count = min( 64, count);
 	if( from_user && copy_from_user( user_buf, buf, count ) ) {
 		return( -EFAULT );
 	}
@@ -1308,7 +1304,7 @@
 
 	/* allow space for any buffered data and for new data, up to */
 	/* transfer buffer size - 2 (for command and length bytes) */
-	new_len = MIN( count, port->bulk_out_size-2-priv->dp_out_buf_len );
+	new_len = min(count, port->bulk_out_size-2-priv->dp_out_buf_len);
 	data_len = new_len + priv->dp_out_buf_len;
 
 	if( data_len == 0 ) {
@@ -1934,7 +1930,7 @@
 
 		if( throttled ) {
 
-			len = MIN( len,
+			len = min( len,
 				DIGI_IN_BUF_SIZE - priv->dp_in_buf_len );
 
 			if( len > 0 ) {
@@ -1947,7 +1943,7 @@
 
 		} else {
 
-			len = MIN( len, TTY_FLIPBUF_SIZE - tty->flip.count );
+			len = min( len, TTY_FLIPBUF_SIZE - tty->flip.count );
 
 			if( len > 0 ) {
 				memcpy( tty->flip.char_buf_ptr, data, len );
@@ -2096,6 +2092,7 @@
 
 MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
+MODULE_LICENSE("GPL");
 
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Debug enabled or not");

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