From: Jiri Slaby Date: Fri, 8 Dec 2006 10:38:17 +0000 (-0800) Subject: [PATCH] Char: mxser_new, kill unneeded memsets X-Git-Tag: v2.6.20-rc1~34^2~233 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=06cc86b5bd4edcf5e7d68624f7d5c9951916f3d1;p=linux-2.6-omap-h63xx.git [PATCH] Char: mxser_new, kill unneeded memsets mxser_new, kill unneeded memsets There is no need to re-zero static global variables' memory, hence memsets doing this are useless. alloc_tty_struct also zeroes allocated memory: another candidate for removing. This fixes also a bug -- global structures are cleaned up after initialization of some its parts. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index 5a4c80d38c6..4ca97c4401d 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c @@ -704,7 +704,6 @@ static int __init mxser_init(void) MXSER_VERSION); /* Initialize the tty_driver structure */ - memset(mxvar_sdriver, 0, sizeof(struct tty_driver)); mxvar_sdriver->magic = TTY_DRIVER_MAGIC; mxvar_sdriver->name = "ttyM"; mxvar_sdriver->major = ttymajor; @@ -721,12 +720,6 @@ static int __init mxser_init(void) mxvar_sdriver->termios_locked = mxvar_termios_locked; mxvar_diagflag = 0; - memset(mxser_boards, 0, sizeof(mxser_boards)); - memset(&mxvar_log, 0, sizeof(struct mxser_log)); - - memset(&mxser_msr, 0, sizeof(unsigned char) * (MXSER_PORTS + 1)); - memset(&mon_data_ext, 0, sizeof(struct mxser_mon_ext)); - memset(&mxser_set_baud_method, 0, sizeof(int) * (MXSER_PORTS + 1)); m = 0; /* Start finding ISA boards here */