[PATCH 8/14] hvc_console: Statically initialize the vtermnos array

Anton Blanchard anton at samba.org
Thu Jul 7 01:55:22 EST 2005


From: Milton Miller <miltonm at bga.com>

Statically initialize the vtermnos array.

Signed-off-by: Milton Miller <miltonm at bga.com>
Signed-off-by: Anton Blanchard <anton at samba.org>

diff -puN drivers/char/hvc_console.c~hvc-console-static-init drivers/char/hvc_console.c
--- gr_work_udbg/drivers/char/hvc_console.c~hvc-console-static-init	2005-02-08 00:43:04.837874744 -0600
+++ gr_work_udbg-miltonm/drivers/char/hvc_console.c	2005-02-08 00:43:04.847873158 -0600
@@ -144,8 +144,8 @@ struct hvc_struct *hvc_get_by_index(int 
  * console interfaces but can still be used as a tty device.  This has to be
  * static because kmalloc will not work during early console init.
  */
-static uint32_t vtermnos[MAX_NR_HVC_CONSOLES];
-
+static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
+	{[0 ... MAX_NR_HVC_CONSOLES - 1] = -1};
 
 /*
  * Console APIs, NOT TTY.  These APIs are available immediately when
@@ -213,10 +213,6 @@ struct console hvc_con_driver = {
 /* Early console initialization.  Preceeds driver initialization. */
 static int __init hvc_console_init(void)
 {
-	int i;
-
-	for (i=0; i<MAX_NR_HVC_CONSOLES; i++)
-		vtermnos[i] = -1;
 	hvc_find_vtys();
 	register_console(&hvc_con_driver);
 	return 0;
_



More information about the Linuxppc64-dev mailing list