All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] Char: moxa, macros cleanup
@ 2007-01-05 17:10 Jiri Slaby
  2007-01-05 17:10 ` [PATCH 2/7] Char: moxa, use del_timer_sync Jiri Slaby
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Jiri Slaby @ 2007-01-05 17:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

moxa, macros cleanup

Remove yet defined or unused macros and whitespace cleanup around the rest.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit 49a3eb961ed6dca0e44778f26910e9e4ed6fd491
tree 4821c6a4d633c3421c0636d245209a8019b88f73
parent a2336fb414c46f0eaf7e6868141ab26b143ed4ce
author Jiri Slaby <jirislaby@gmail.com> Wed, 03 Jan 2007 12:25:16 +0059
committer Jiri Slaby <jirislaby@gmail.com> Fri, 05 Jan 2007 17:38:42 +0059

 drivers/char/moxa.c |   37 +++++++++++++------------------------
 1 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 42de5bf..da2a1d1 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -46,23 +46,20 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
-#define		MOXA_VERSION		"5.1k"
+#define MOXA_VERSION		"5.1k"
 
-#define MOXAMAJOR       172
-#define MOXACUMAJOR     173
+#define MOXAMAJOR		172
+#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 		128	/* Don't change this value */
+#define MAX_PORTS		(MAX_BOARDS * MAX_PORTS_PER_BOARD)
 
 /*
  *    Define the Moxa PCI vendor and device IDs.
  */
-#define MOXA_BUS_TYPE_ISA		0
-#define MOXA_BUS_TYPE_PCI		1
+#define MOXA_BUS_TYPE_ISA	0
+#define MOXA_BUS_TYPE_PCI	1
 
 enum {
 	MOXA_BOARD_C218_PCI = 1,
@@ -157,13 +154,8 @@ static struct mxser_mstatus GMStatus[MAX_PORTS];
 
 #define SERIAL_DO_RESTART
 
-
-#define SERIAL_TYPE_NORMAL	1
-
 #define WAKEUP_CHARS		256
 
-#define PORTNO(x)		((x)->index)
-
 static int verbose = 0;
 static int ttymajor = MOXAMAJOR;
 /* Variables for insmod */
@@ -461,7 +453,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
 	int port;
 	int retval;
 
-	port = PORTNO(tty);
+	port = tty->index;
 	if (port == MAX_PORTS) {
 		return (0);
 	}
@@ -499,7 +491,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
 	struct moxa_str *ch;
 	int port;
 
-	port = PORTNO(tty);
+	port = tty->index;
 	if (port == MAX_PORTS) {
 		return;
 	}
@@ -663,7 +655,7 @@ static int moxa_tiocmget(struct tty_struct *tty, struct file *file)
 	int port;
 	int flag = 0, dtr, rts;
 
-	port = PORTNO(tty);
+	port = tty->index;
 	if ((port != MAX_PORTS) && (!ch))
 		return (-EINVAL);
 
@@ -689,7 +681,7 @@ static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
 	int port;
 	int dtr, rts;
 
-	port = PORTNO(tty);
+	port = tty->index;
 	if ((port != MAX_PORTS) && (!ch))
 		return (-EINVAL);
 
@@ -714,7 +706,7 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
 	void __user *argp = (void __user *)arg;
 	int retval;
 
-	port = PORTNO(tty);
+	port = tty->index;
 	if ((port != MAX_PORTS) && (!ch))
 		return (-EINVAL);
 
@@ -1361,9 +1353,6 @@ static void receive_data(struct moxa_str *ch)
 /*
  *    Query
  */
-#define QueryPort	MAX_PORTS
-
-
 
 struct mon_str {
 	int tick;
@@ -1475,7 +1464,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 	int MoxaPortTxQueue(int), MoxaPortRxQueue(int);
 	void __user *argp = (void __user *)arg;
 
-	if (port == QueryPort) {
+	if (port == MAX_PORTS) {
 		if ((cmd != MOXA_GET_CONF) && (cmd != MOXA_INIT_DRIVER) &&
 		    (cmd != MOXA_LOAD_BIOS) && (cmd != MOXA_FIND_BOARD) && (cmd != MOXA_LOAD_C320B) &&
 		 (cmd != MOXA_LOAD_CODE) && (cmd != MOXA_GETDATACOUNT) &&

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-05 17:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-05 17:10 [PATCH 1/7] Char: moxa, macros cleanup Jiri Slaby
2007-01-05 17:10 ` [PATCH 2/7] Char: moxa, use del_timer_sync Jiri Slaby
2007-01-05 17:11 ` [PATCH 3/7] Char: moxa, remove moxa_pci_devinfo Jiri Slaby
2007-01-05 17:11 ` [PATCH 4/7] Char: moxa, variables cleanup Jiri Slaby
2007-01-05 17:11 ` [PATCH 5/7] Char: moxa, remove useless vairables Jiri Slaby
2007-01-05 17:12 ` [PATCH 6/7] Char: moxa, pci_probing prepare Jiri Slaby
2007-01-05 17:12 ` [PATCH 7/7] Char: moxa, pci probing Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.