Skip to content

Commit

Permalink
[PATCH] Char: mxser_new, kill unneeded memsets
Browse files Browse the repository at this point in the history
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 <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Dec 8, 2006
1 parent 7a7a5c3 commit 06cc86b
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/char/mxser_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit 06cc86b

Please sign in to comment.