void register_console(struct console * console) 
void register_console(struct console *console) 
void register_console(struct console * console){	int     i;	unsigned long flags;	if (preferred_console < 0)		preferred_console = selected_console;	/*	 *	See if we want to use this console driver. If we	 *	didn't select a console we take the first one	 *	that registers here.	 */	if (preferred_console < 0) {		if (console->index < 0)			console->index = 0;		if (console->setup == NULL ||		    console->setup(console, NULL) == 0) {			console->flags |= CON_ENABLED | CON_CONSDEV;			preferred_console = 0;		}	}	/*	 *	See if this console matches one we selected on	 *	the command line.	 */	for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) {		if (strcmp(console_cmdline[i].name, console->name) != 0)			continue;		if (console->index >= 0 &&		    console->index != console_cmdline[i].index)			continue;		if (console->index < 0)			console->index = console_cmdline[i].index;		if (console->setup &&		    console->setup(console, console_cmdline[i].options) != 0)			break;		console->flags |= CON_ENABLED;		console->index = console_cmdline[i].index;		if (i == selected_console) {			console->flags |= CON_CONSDEV;			preferred_console = selected_console;		}		break;	}	if (!(console->flags & CON_ENABLED))		return;	if (console_drivers && (console_drivers->flags & CON_BOOT)) {		unregister_console(console_drivers);		console->flags &= ~CON_PRINTBUFFER;	}	/*	 *	Put this console in the list - keep the	 *	preferred driver at the head of the list.	 */	acquire_console_sem();	if ((console->flags & CON_CONSDEV) || console_drivers == NULL) {		console->next = console_drivers;		console_drivers = console;		if (console->next)			console->next->flags &= ~CON_CONSDEV;	} else {		console->next = console_drivers->next;		console_drivers->next = console;	}	if (console->flags & CON_PRINTBUFFER) {		/*		 * release_console_sem() will print out the buffered messages		 * for us.		 */		spin_lock_irqsave(&logbuf_lock, flags);		con_start = log_start;		spin_unlock_irqrestore(&logbuf_lock, flags);	}	release_console_sem();}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/40dc565122ed1e180a0637f88cdfca734d33db78/printk.c/buggy/kernel/printk.c