From: Adrian Bunk - remove MIN/MAN - remove (unused) userspace program/conffile locations - remove a check that compares an ushort witha value it never has on Linux 25-akpm/drivers/char/digi/dgap/dgap_driver.h | 19 ------------------- 25-akpm/drivers/char/digi/dgap/dgap_tty.c | 15 ++++++--------- 2 files changed, 6 insertions(+), 28 deletions(-) diff -puN drivers/char/digi/dgap/dgap_driver.h~dgap-cleanups drivers/char/digi/dgap/dgap_driver.h --- 25/drivers/char/digi/dgap/dgap_driver.h~dgap-cleanups Mon Sep 15 15:45:11 2003 +++ 25-akpm/drivers/char/digi/dgap/dgap_driver.h Mon Sep 15 15:45:11 2003 @@ -215,7 +215,6 @@ #define MYFLIPLEN N_TTY_BUF_SIZE #define SBREAK_TIME 0x25 -#define USHRT_MAX 65535 #define U2BSIZE 0x400 #define dgap_jiffies_from_ms(a) (((a) * HZ) / 1000) @@ -231,10 +230,6 @@ # define DIGI_DGAP_MAJOR 22 #endif -/* The default location of the config script. */ -#define DGAP_CONFIG_PROGRAM "/usr/sbin/dgap_config" -#define DGAP_CONFIG_FILE "/etc/dgap.conf" - /* * The parameters we use to define the periods of the moving averages. */ @@ -274,20 +269,6 @@ #endif /* - * Only define these in case they are not present in the kernel headers. - * A grep of /usr/src/linux-/include/linux - * show others worry about this as well. - */ -#if !defined(MIN) -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#if !defined(MAX) -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - - -/* * All the possible states the driver can be while being loaded. */ enum { diff -puN drivers/char/digi/dgap/dgap_tty.c~dgap-cleanups drivers/char/digi/dgap/dgap_tty.c --- 25/drivers/char/digi/dgap/dgap_tty.c~dgap-cleanups Mon Sep 15 15:45:11 2003 +++ 25-akpm/drivers/char/digi/dgap/dgap_tty.c Mon Sep 15 15:45:11 2003 @@ -1278,8 +1278,8 @@ void dgap_input(struct channel_t *ch) flip_len = TTY_FLIPBUF_SIZE - tp->flip.count; } - len = MIN(data_len, flip_len); - len = MIN(len, (N_TTY_BUF_SIZE - 1) - tp->read_cnt); + len = min(data_len, flip_len); + len = min(len, (N_TTY_BUF_SIZE - 1) - tp->read_cnt); if (len <= 0) { writeb(1, &(bs->idata)); @@ -1315,7 +1315,7 @@ void dgap_input(struct channel_t *ch) while (n) { s = ((head >= tail) ? head : ch->ch_rsize) - tail; - s = MIN(s, n); + s = min(s, n); if (s <= 0) break; @@ -2513,7 +2513,7 @@ static int maxcps_room(struct tty_struct cps_limit = 0; } - bytes_available = MIN(cps_limit, bytes_available); + bytes_available = min(cps_limit, bytes_available); } return (bytes_available); @@ -2705,7 +2705,7 @@ static int dgap_tty_write(struct tty_str * Take minimum of what the user wants to send, and the * space available in the FEP buffer. */ - count = MIN(count, bufcount); + count = min(count, bufcount); /* * Bail if no space left. @@ -2743,7 +2743,7 @@ static int dgap_tty_write(struct tty_str goto out; } - count = MIN(count, WRITEBUFLEN); + count = min(count, WRITEBUFLEN); /* * copy_from_user() returns the number @@ -3230,9 +3230,6 @@ static int dgap_tty_digiseta(struct tty_ if (ch->ch_digi.digi_bufsize < 10) ch->ch_digi.digi_bufsize = 10; - if (ch->ch_digi.digi_bufsize > 100000) - ch->ch_digi.digi_bufsize = MIN(100000, USHRT_MAX); - if (ch->ch_digi.digi_maxchar < 1) ch->ch_digi.digi_maxchar = 1; _