patch-2.4.10 linux/drivers/net/wan/sdla_fr.c

Next file: linux/drivers/net/wan/sdla_ft1.c
Previous file: linux/drivers/net/wan/sdla_chdlc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/net/wan/sdla_fr.c linux/drivers/net/wan/sdla_fr.c
@@ -138,6 +138,7 @@
 * Jan 02, 1997	Gene Kozin	Initial version.
 *****************************************************************************/
 
+#include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>	/* printk(), and other useful stuff */
 #include <linux/stddef.h>	/* offsetof(), etc. */
@@ -548,10 +549,10 @@
 	/* Adjust configuration */
 	conf->mtu += FR_HEADER_LEN;
 	conf->mtu = (conf->mtu >= MIN_LGTH_FR_DATA_CFG) ?
-			min(unsigned int, conf->mtu, FR_MAX_NO_DATA_BYTES_IN_FRAME) :
+			min_t(unsigned int, conf->mtu, FR_MAX_NO_DATA_BYTES_IN_FRAME) :
                         FR_CHANNEL_MTU + FR_HEADER_LEN;
      
-	conf->bps = min(unsigned int, conf->bps, 2048000);
+	conf->bps = min_t(unsigned int, conf->bps, 2048000);
 
 	/* Initialze the configuration structure sent to the board to zero */
 	memset(&u.cfg, 0, sizeof(u.cfg));
@@ -618,7 +619,7 @@
 		 * command in fr_configure() routine. 
 		 */
 
-		card->u.f.dlci_num  = min(unsigned int, max(unsigned int, conf->u.fr.dlci_num, 1), 100);
+		card->u.f.dlci_num  = min_t(unsigned int, max_t(unsigned int, conf->u.fr.dlci_num, 1), 100);
 	
 		for ( i = 0; i < card->u.f.dlci_num; i++) {
 
@@ -635,27 +636,27 @@
 		u.cfg.port |= 0x0002;
 
 	if (conf->u.fr.t391)
-		u.cfg.t391 = min(unsigned int, conf->u.fr.t391, 30);
+		u.cfg.t391 = min_t(unsigned int, conf->u.fr.t391, 30);
 	else
 		u.cfg.t391 = 5;
 
 	if (conf->u.fr.t392)
-		u.cfg.t392 = min(unsigned int, conf->u.fr.t392, 30);
+		u.cfg.t392 = min_t(unsigned int, conf->u.fr.t392, 30);
 	else
 		u.cfg.t392 = 15;
 
 	if (conf->u.fr.n391)
-		u.cfg.n391 = min(unsigned int, conf->u.fr.n391, 255);
+		u.cfg.n391 = min_t(unsigned int, conf->u.fr.n391, 255);
 	else
 		u.cfg.n391 = 2;
 
 	if (conf->u.fr.n392)
-		u.cfg.n392 = min(unsigned int, conf->u.fr.n392, 10);
+		u.cfg.n392 = min_t(unsigned int, conf->u.fr.n392, 10);
 	else
 		u.cfg.n392 = 3;	
 
 	if (conf->u.fr.n393)
-		u.cfg.n393 = min(unsigned int, conf->u.fr.n393, 10);
+		u.cfg.n393 = min_t(unsigned int, conf->u.fr.n393, 10);
 	else
 		u.cfg.n393 = 4;
 
@@ -952,8 +953,8 @@
          */
 	if (conf->cir) {
 
-		chan->cir = max(unsigned int, 1,
-				min(unsigned int, conf->cir, 512));
+		chan->cir = max_t(unsigned int, 1,
+				min_t(unsigned int, conf->cir, 512));
 		chan->cir_status = CIR_ENABLED; 
 
 		
@@ -964,8 +965,8 @@
 		chan->bc = chan->cir;
 
 		if (conf->be){
-			chan->be = max(unsigned int,
-				       0, min(unsigned int, conf->be, 511));
+			chan->be = max_t(unsigned int,
+				       0, min_t(unsigned int, conf->be, 511));
 		}else{	
 			conf->be = 0;
 		}
@@ -5475,5 +5476,6 @@
 
 	
 
+MODULE_LICENSE("GPL");
 
 /****** End *****************************************************************/

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