提交 9dff89cd 编写于 作者: J Jiri Slaby 提交者: Linus Torvalds

[PATCH] Char: moxa, eliminate typedefs

Do not use typedefs, use directly struct <something> instead.
Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5ebb4078
...@@ -94,32 +94,32 @@ static struct pci_device_id moxa_pcibrds[] = { ...@@ -94,32 +94,32 @@ static struct pci_device_id moxa_pcibrds[] = {
MODULE_DEVICE_TABLE(pci, moxa_pcibrds); MODULE_DEVICE_TABLE(pci, moxa_pcibrds);
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
typedef struct _moxa_isa_board_conf { struct moxa_isa_board_conf {
int boardType; int boardType;
int numPorts; int numPorts;
unsigned long baseAddr; unsigned long baseAddr;
} moxa_isa_board_conf; };
static moxa_isa_board_conf moxa_isa_boards[] = static struct moxa_isa_board_conf moxa_isa_boards[] =
{ {
/* {MOXA_BOARD_C218_ISA,8,0xDC000}, */ /* {MOXA_BOARD_C218_ISA,8,0xDC000}, */
}; };
typedef struct _moxa_pci_devinfo { struct moxa_pci_devinfo {
ushort busNum; ushort busNum;
ushort devNum; ushort devNum;
struct pci_dev *pdev; struct pci_dev *pdev;
} moxa_pci_devinfo; };
typedef struct _moxa_board_conf { struct moxa_board_conf {
int boardType; int boardType;
int numPorts; int numPorts;
unsigned long baseAddr; unsigned long baseAddr;
int busType; int busType;
moxa_pci_devinfo pciInfo; struct moxa_pci_devinfo pciInfo;
} moxa_board_conf; };
static moxa_board_conf moxa_boards[MAX_BOARDS]; static struct moxa_board_conf moxa_boards[MAX_BOARDS];
static void __iomem *moxaBaseAddr[MAX_BOARDS]; static void __iomem *moxaBaseAddr[MAX_BOARDS];
static int loadstat[MAX_BOARDS]; static int loadstat[MAX_BOARDS];
...@@ -273,7 +273,8 @@ static struct timer_list moxaEmptyTimer[MAX_PORTS]; ...@@ -273,7 +273,8 @@ static struct timer_list moxaEmptyTimer[MAX_PORTS];
static DEFINE_SPINLOCK(moxa_lock); static DEFINE_SPINLOCK(moxa_lock);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf * board) static int moxa_get_PCI_conf(struct pci_dev *p, int board_type,
struct moxa_board_conf *board)
{ {
board->baseAddr = pci_resource_start (p, 2); board->baseAddr = pci_resource_start (p, 2);
board->boardType = board_type; board->boardType = board_type;
...@@ -1369,7 +1370,6 @@ struct mon_str { ...@@ -1369,7 +1370,6 @@ struct mon_str {
int rxcnt[MAX_PORTS]; int rxcnt[MAX_PORTS];
int txcnt[MAX_PORTS]; int txcnt[MAX_PORTS];
}; };
typedef struct mon_str mon_st;
#define DCD_changed 0x01 #define DCD_changed 0x01
#define DCD_oldstate 0x80 #define DCD_oldstate 0x80
...@@ -1386,7 +1386,7 @@ static char moxaDCDState[MAX_PORTS]; ...@@ -1386,7 +1386,7 @@ static char moxaDCDState[MAX_PORTS];
static char moxaLowChkFlag[MAX_PORTS]; static char moxaLowChkFlag[MAX_PORTS];
static int moxaLowWaterChk; static int moxaLowWaterChk;
static int moxaCard; static int moxaCard;
static mon_st moxaLog; static struct mon_str moxaLog;
static int moxaFuncTout = HZ / 2; static int moxaFuncTout = HZ / 2;
static ushort moxaBreakCnt[MAX_PORTS]; static ushort moxaBreakCnt[MAX_PORTS];
...@@ -1485,7 +1485,8 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port) ...@@ -1485,7 +1485,8 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
} }
switch (cmd) { switch (cmd) {
case MOXA_GET_CONF: case MOXA_GET_CONF:
if(copy_to_user(argp, &moxa_boards, MAX_BOARDS * sizeof(moxa_board_conf))) if(copy_to_user(argp, &moxa_boards, MAX_BOARDS *
sizeof(struct moxa_board_conf)))
return -EFAULT; return -EFAULT;
return (0); return (0);
case MOXA_INIT_DRIVER: case MOXA_INIT_DRIVER:
...@@ -1494,7 +1495,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port) ...@@ -1494,7 +1495,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
return (0); return (0);
case MOXA_GETDATACOUNT: case MOXA_GETDATACOUNT:
moxaLog.tick = jiffies; moxaLog.tick = jiffies;
if(copy_to_user(argp, &moxaLog, sizeof(mon_st))) if(copy_to_user(argp, &moxaLog, sizeof(struct mon_str)))
return -EFAULT; return -EFAULT;
return (0); return (0);
case MOXA_FLUSH_QUEUE: case MOXA_FLUSH_QUEUE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册