[PATCH 1/4] Char: mxser_new, kill unneeded memsets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

---
commit e3d57eae41e172fbd6195a78532f3325b2441450
tree b1c17a897e53fa8fa217f1ea809659b9ff462718
parent 309f84ccd85a12c363b7ceb60139bcf2fabefbd7
author Jiri Slaby <[email protected]> Sat, 30 Sep 2006 00:10:08 +0200
committer Jiri Slaby <[email protected]> Sat, 30 Sep 2006 00:10:08 +0200

 drivers/char/mxser_new.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index f93d438..1a6a3aa 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -697,7 +697,6 @@ static int 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;
@@ -714,12 +713,6 @@ static int 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 */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux