[PATCH 2/8] Char: moxa, do not initialize global static
- From: Jiri Slaby <jirislaby@xxxxxxxxx>
- Date: Sun, 31 Dec 2006 02:04:30 +0100 (CET)
moxa, do not initialize global static
Remove useless initialization of variables a) statically b) dynamically
at module_init c) dynamically after kzalloc (those with '= 0/NULL')
Signed-off-by: Jiri Slaby <jirislaby@xxxxxxxxx>
---
commit bc5dff44602d67db9d08ae1735e6f29162264704
tree 02ad9d888e7a5f274d04214a52bb176b3c3ec89a
parent fdcf97c855168c011b18ff68930bcc93e6c625c6
author Jiri Slaby <jirislaby@xxxxxxxxx> Sun, 31 Dec 2006 01:37:23 +0059
committer Jiri Slaby <jirislaby@xxxxxxxxx> Sun, 31 Dec 2006 01:37:23 +0059
drivers/char/moxa.c | 24 ++++--------------------
1 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 4db1dc4..80a2bdf 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -194,9 +194,9 @@ static int verbose = 0;
static int ttymajor = MOXAMAJOR;
/* Variables for insmod */
#ifdef MODULE
-static int baseaddr[] = {0, 0, 0, 0};
-static int type[] = {0, 0, 0, 0};
-static int numports[] = {0, 0, 0, 0};
+static int baseaddr[4];
+static int type[4];
+static int numports[4];
#endif
MODULE_AUTHOR("William Chen");
@@ -348,10 +348,7 @@ static int __init moxa_init(void)
moxaDriver->type = TTY_DRIVER_TYPE_SERIAL;
moxaDriver->subtype = SERIAL_TYPE_NORMAL;
moxaDriver->init_termios = tty_std_termios;
- moxaDriver->init_termios.c_iflag = 0;
- moxaDriver->init_termios.c_oflag = 0;
moxaDriver->init_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
- moxaDriver->init_termios.c_lflag = 0;
moxaDriver->init_termios.c_ispeed = 9600;
moxaDriver->init_termios.c_ospeed = 9600;
moxaDriver->flags = TTY_DRIVER_REAL_RAW;
@@ -361,25 +358,13 @@ static int __init moxa_init(void)
ch->type = PORT_16550A;
ch->port = i;
INIT_WORK(&ch->tqueue, do_moxa_softint);
- ch->tty = NULL;
ch->close_delay = 5 * HZ / 10;
ch->closing_wait = 30 * HZ;
- ch->count = 0;
- ch->blocked_open = 0;
ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
init_waitqueue_head(&ch->open_wait);
init_waitqueue_head(&ch->close_wait);
}
- for (i = 0; i < MAX_BOARDS; i++) {
- moxa_boards[i].boardType = 0;
- moxa_boards[i].numPorts = 0;
- moxa_boards[i].baseAddr = 0;
- moxa_boards[i].busType = 0;
- moxa_boards[i].pciInfo.busNum = 0;
- moxa_boards[i].pciInfo.devNum = 0;
- }
- MoxaDriverInit();
printk("Tty devices major number = %d\n", ttymajor);
if (tty_register_driver(moxaDriver)) {
@@ -391,7 +376,6 @@ static int __init moxa_init(void)
init_timer(&moxaEmptyTimer[i]);
moxaEmptyTimer[i].function = check_xmit_empty;
moxaEmptyTimer[i].data = (unsigned long) & moxaChannels[i];
- moxaEmptyTimer_on[i] = 0;
}
init_timer(&moxaTimer);
@@ -1470,7 +1454,7 @@ static char moxaLowChkFlag[MAX_PORTS];
static int moxaLowWaterChk;
static int moxaCard;
static mon_st moxaLog;
-static int moxaFuncTout;
+static int moxaFuncTout = HZ / 2;
static ushort moxaBreakCnt[MAX_PORTS];
static void moxadelay(int);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 1/8] Char: moxa, remove unused allocated page
- From: Jiri Slaby
- [PATCH 1/8] Char: moxa, remove unused allocated page
- Prev by Date: [PATCH 6/8] Char: moxa, devids cleanup
- Next by Date: [PATCH 4/8] Char: moxa, remove hangup bottomhalf
- Previous by thread: [PATCH 6/8] Char: moxa, devids cleanup
- Next by thread: [PATCH 4/8] Char: moxa, remove hangup bottomhalf
- Index(es):
Relevant Pages
- DVB: tda10086: make the 22kHz tone for DISEQC a config option
... (backported from commit ea75baf4b0f117564bd50827a49c4b14d61d24e9) ... Some cards
need the diseqc signal modulated, ... static int tda10086_init ... static u8 read_pwm(struct
budget* budget) ... (Linux-Kernel) - [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done"
... commit 6f5391c283d7fdcf24bf40786ea79061919d1e1d ... struct scsi_cmnd
*cmd; ... static int sr_remove; ... + * It will be notified on the end of a SCSI
read / write, ... (Linux-Kernel) - [PATCH 8/11] Char: cyclades, cy_init error handling
... commit 8c76c370ee1c1efa31f64807162c15922fae1e3a ... tree 19fe12eba568aece1d0b406a4d735f393f2cd3dd
... parent b1b13ea51dcaef72c5298a04d233b92206adf978 ... static int __init
cy_init ... (Linux-Kernel) - Kernel Compile issue
... function definition not being a prototype in wpaul@'s subr_ndis.c commit. ...
lerlaptop# diff -u subr_ndis.c.old subr_ndis.c ... +my_strcasecmp(const char
*s1, const char *s2, int len) ... (freebsd-current) - [PATCH 2.6.19] tg3: replace kmalloc+memset with kzalloc
... Replace kmalloc+memset with kzalloc ... static int tg3_alloc_consistent(struct
tg3 *tp) ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
(Linux-Kernel)