[PATCH 17/76] ip2, cleanup globals

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Sunday, October 5, 2008 - 9:06 am

From: Jiri Slaby <jirislaby@gmail.com>

- do not init .bss zeroed data to zero again (by memset or
  explicit assignment)
- use char [] instead of char * for string constants

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@redhat.com>
---

 drivers/char/ip2/ip2main.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 79bca61..1d46284 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -150,12 +150,12 @@ static int ip2_read_proc(char *, char **, off_t, int, int *, void * );
 /*************/
 
 /* String constants to identify ourselves */
-static char *pcName    = "Computone IntelliPort Plus multiport driver";
-static char *pcVersion = "1.2.14";
+static const char pcName[] = "Computone IntelliPort Plus multiport driver";
+static const char pcVersion[] = "1.2.14";
 
 /* String constants for port names */
-static char *pcDriver_name   = "ip2";
-static char *pcIpl    		 = "ip2ipl";
+static const char pcDriver_name[] = "ip2";
+static const char pcIpl[] = "ip2ipl";
 
 /***********************/
 /* Function Prototypes */
@@ -237,8 +237,8 @@ static const struct file_operations ip2_ipl = {
 	.open		= ip2_ipl_open,
 }; 
 
-static unsigned long irq_counter = 0;
-static unsigned long bh_counter = 0;
+static unsigned long irq_counter;
+static unsigned long bh_counter;
 
 // Use immediate queue to service interrupts
 #define USE_IQI
@@ -286,7 +286,7 @@ MODULE_AUTHOR("Doug McNash");
 MODULE_DESCRIPTION("Computone IntelliPort Plus Driver");
 MODULE_LICENSE("GPL");
 
-static int poll_only = 0;
+static int poll_only;
 
 static int Eisa_irq;
 static int Eisa_slot;
@@ -615,10 +615,6 @@ static int ip2_loadmain(void)
 	/* Initialise the iiEllis subsystem. */
 	iiEllisInit();
 
-	/* Initialize arrays. */
-	memset( i2BoardPtrTable, 0, sizeof i2BoardPtrTable );
-	memset( DevTable, 0, sizeof DevTable );
-
 	/* Initialise all the boards we can find (up to the maximum). */
 	for ( i = 0; i < IP2_MAX_BOARDS; ++i ) {
 		switch ( ip2config.addr[i] ) { 

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/76] Queued TTY Patches, Alan Cox, (Sun Oct 5, 9:04 am)
[PATCH 04/76] epca: call tty_port_init, Alan Cox, (Sun Oct 5, 9:05 am)
[PATCH 05/76] 8250: Remove NR_IRQ usage, Alan Cox, (Sun Oct 5, 9:05 am)
[PATCH 16/76] Char: merge ip2main and ip2base, Alan Cox, (Sun Oct 5, 9:06 am)
[PATCH 17/76] ip2, cleanup globals, Alan Cox, (Sun Oct 5, 9:06 am)
[PATCH 18/76] ip2, fix sparse warnings, Alan Cox, (Sun Oct 5, 9:07 am)
[PATCH 19/76] ip2, init/deinit cleanup, Alan Cox, (Sun Oct 5, 9:07 am)
[PATCH 26/76] tty: Add a kref count, Alan Cox, (Sun Oct 5, 9:08 am)
[PATCH 28/76] Char: cyclades. remove bogus iomap, Alan Cox, (Sun Oct 5, 9:08 am)
[PATCH 29/76] Char: sx, fix io unmapping, Alan Cox, (Sun Oct 5, 9:08 am)
[PATCH 32/76] tty: ipw need reworking, Alan Cox, (Sun Oct 5, 9:09 am)
[PATCH 33/76] tty: Add termiox, Alan Cox, (Sun Oct 5, 9:09 am)
[PATCH 35/76] tty: compare the tty winsize, Alan Cox, (Sun Oct 5, 9:10 am)
[PATCH 38/76] tty: usb-serial krefs, Alan Cox, (Sun Oct 5, 9:11 am)
[PATCH 40/76] stallion: Use krefs, Alan Cox, (Sun Oct 5, 9:13 am)
[PATCH 41/76] mxser: Switch to kref tty, Alan Cox, (Sun Oct 5, 9:14 am)
[PATCH 42/76] tty: the vhangup syscall is racy, Alan Cox, (Sun Oct 5, 9:15 am)
[PATCH 43/76] tty: Redo current tty locking, Alan Cox, (Sun Oct 5, 9:15 am)
[PATCH 46/76] vt: remove bogus lock dropping, Alan Cox, (Sun Oct 5, 9:18 am)
[PATCH 47/76] tty: shutdown method, Alan Cox, (Sun Oct 5, 9:18 am)
[PATCH 51/76] tty: kref the tty driver object, Alan Cox, (Sun Oct 5, 9:20 am)
[PATCH 52/76] tty: More driver operations, Alan Cox, (Sun Oct 5, 9:20 am)
[PATCH 55/76] Move tty lookup/reopen to caller, Alan Cox, (Sun Oct 5, 9:21 am)
[PATCH 57/76] Simplify devpts_get_tty(), Alan Cox, (Sun Oct 5, 9:21 am)
[PATCH 58/76] Simplify devpts_pty_new(), Alan Cox, (Sun Oct 5, 9:21 am)
[PATCH 59/76] Simplify devpts_pty_kill, Alan Cox, (Sun Oct 5, 9:21 am)
[PATCH 60/76] pty: Coding style and polish, Alan Cox, (Sun Oct 5, 9:22 am)
[PATCH 62/76] pty: simplify unix98 allocation, Alan Cox, (Sun Oct 5, 9:22 am)
[PATCH 63/76] tty: simplify ktermios allocation, Alan Cox, (Sun Oct 5, 9:22 am)
[PATCH 66/76] tty: fix up gigaset a bit, Alan Cox, (Sun Oct 5, 9:23 am)
[PATCH 67/76] tty: Remove lots of NULL checks, Alan Cox, (Sun Oct 5, 9:23 am)
[PATCH 74/76] tty: tty_io.c shadows sparse fix, Alan Cox, (Sun Oct 5, 9:25 am)
[PATCH 75/76] usb: fix pl2303 initialization, Alan Cox, (Sun Oct 5, 9:25 am)
Re: [PATCH 38/76] tty: usb-serial krefs, Greg KH, (Sun Oct 5, 10:36 pm)
Re: [PATCH 67/76] tty: Remove lots of NULL checks, Geert Uytterhoeven, (Mon Oct 6, 1:58 am)
Re: [PATCH 38/76] tty: usb-serial krefs, Alan Cox, (Mon Oct 6, 2:02 am)
Re: [PATCH 26/76] tty: Add a kref count, Louis Rilling, (Mon Oct 6, 3:20 am)
Re: [PATCH 36/76] tty: Make get_current_tty use a kref, Louis Rilling, (Mon Oct 6, 3:35 am)
Re: [PATCH 26/76] tty: Add a kref count, Alan Cox, (Mon Oct 6, 3:52 am)
Re: [PATCH 38/76] tty: usb-serial krefs, Greg KH, (Mon Oct 6, 9:13 pm)
Re: [PATCH 43/76] tty: Redo current tty locking, Derek Fawcus, (Thu Oct 9, 6:21 am)