From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>, <support@moxa.com.tw>
Subject: [PATCH 1/4] Char: mxser_new, kill unneeded memsets
Date: Sun, 1 Oct 2006 00:33:38 +0200 (CEST) [thread overview]
Message-ID: <81721356982173@wsc.cz> (raw)
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>
---
commit e3d57eae41e172fbd6195a78532f3325b2441450
tree b1c17a897e53fa8fa217f1ea809659b9ff462718
parent 309f84ccd85a12c363b7ceb60139bcf2fabefbd7
author Jiri Slaby <jirislaby@gmail.com> Sat, 30 Sep 2006 00:10:08 +0200
committer Jiri Slaby <xslaby@anemoi.localdomain> 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 */
reply other threads:[~2006-09-30 22:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81721356982173@wsc.cz \
--to=jirislaby@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=support@moxa.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.