Commit 11324edd authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: moxa, macros cleanup

Remove yet defined or unused macros and whitespace cleanup around the rest.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9dff89cd
...@@ -51,12 +51,9 @@ ...@@ -51,12 +51,9 @@
#define MOXAMAJOR 172 #define MOXAMAJOR 172
#define MOXACUMAJOR 173 #define MOXACUMAJOR 173
#define put_to_user(arg1, arg2) put_user(arg1, (unsigned long *)arg2)
#define get_from_user(arg1, arg2) get_user(arg1, (unsigned int *)arg2)
#define MAX_BOARDS 4 /* Don't change this value */ #define MAX_BOARDS 4 /* Don't change this value */
#define MAX_PORTS_PER_BOARD 32 /* Don't change this value */ #define MAX_PORTS_PER_BOARD 32 /* Don't change this value */
#define MAX_PORTS 128 /* Don't change this value */ #define MAX_PORTS (MAX_BOARDS * MAX_PORTS_PER_BOARD)
/* /*
* Define the Moxa PCI vendor and device IDs. * Define the Moxa PCI vendor and device IDs.
...@@ -157,13 +154,8 @@ static struct mxser_mstatus GMStatus[MAX_PORTS]; ...@@ -157,13 +154,8 @@ static struct mxser_mstatus GMStatus[MAX_PORTS];
#define SERIAL_DO_RESTART #define SERIAL_DO_RESTART
#define SERIAL_TYPE_NORMAL 1
#define WAKEUP_CHARS 256 #define WAKEUP_CHARS 256
#define PORTNO(x) ((x)->index)
static int verbose = 0; static int verbose = 0;
static int ttymajor = MOXAMAJOR; static int ttymajor = MOXAMAJOR;
/* Variables for insmod */ /* Variables for insmod */
...@@ -461,7 +453,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) ...@@ -461,7 +453,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
int port; int port;
int retval; int retval;
port = PORTNO(tty); port = tty->index;
if (port == MAX_PORTS) { if (port == MAX_PORTS) {
return (0); return (0);
} }
...@@ -499,7 +491,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp) ...@@ -499,7 +491,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
struct moxa_str *ch; struct moxa_str *ch;
int port; int port;
port = PORTNO(tty); port = tty->index;
if (port == MAX_PORTS) { if (port == MAX_PORTS) {
return; return;
} }
...@@ -663,7 +655,7 @@ static int moxa_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -663,7 +655,7 @@ static int moxa_tiocmget(struct tty_struct *tty, struct file *file)
int port; int port;
int flag = 0, dtr, rts; int flag = 0, dtr, rts;
port = PORTNO(tty); port = tty->index;
if ((port != MAX_PORTS) && (!ch)) if ((port != MAX_PORTS) && (!ch))
return (-EINVAL); return (-EINVAL);
...@@ -689,7 +681,7 @@ static int moxa_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -689,7 +681,7 @@ static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
int port; int port;
int dtr, rts; int dtr, rts;
port = PORTNO(tty); port = tty->index;
if ((port != MAX_PORTS) && (!ch)) if ((port != MAX_PORTS) && (!ch))
return (-EINVAL); return (-EINVAL);
...@@ -714,7 +706,7 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file, ...@@ -714,7 +706,7 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int retval; int retval;
port = PORTNO(tty); port = tty->index;
if ((port != MAX_PORTS) && (!ch)) if ((port != MAX_PORTS) && (!ch))
return (-EINVAL); return (-EINVAL);
...@@ -1361,9 +1353,6 @@ static void receive_data(struct moxa_str *ch) ...@@ -1361,9 +1353,6 @@ static void receive_data(struct moxa_str *ch)
/* /*
* Query * Query
*/ */
#define QueryPort MAX_PORTS
struct mon_str { struct mon_str {
int tick; int tick;
...@@ -1475,7 +1464,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port) ...@@ -1475,7 +1464,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
int MoxaPortTxQueue(int), MoxaPortRxQueue(int); int MoxaPortTxQueue(int), MoxaPortRxQueue(int);
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
if (port == QueryPort) { if (port == MAX_PORTS) {
if ((cmd != MOXA_GET_CONF) && (cmd != MOXA_INIT_DRIVER) && if ((cmd != MOXA_GET_CONF) && (cmd != MOXA_INIT_DRIVER) &&
(cmd != MOXA_LOAD_BIOS) && (cmd != MOXA_FIND_BOARD) && (cmd != MOXA_LOAD_C320B) && (cmd != MOXA_LOAD_BIOS) && (cmd != MOXA_FIND_BOARD) && (cmd != MOXA_LOAD_C320B) &&
(cmd != MOXA_LOAD_CODE) && (cmd != MOXA_GETDATACOUNT) && (cmd != MOXA_LOAD_CODE) && (cmd != MOXA_GETDATACOUNT) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment