while (old_origin < vc->vc_scr_end) { scr_memcpyw((unsigned short *) new_origin, (unsigned short *) old_origin, rlth); 
while (old_origin < end) { scr_memcpyw((unsigned short *) new_origin, (unsigned short *) old_origin, rlth); 
int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines){	unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;	unsigned int old_cols, old_rows, old_row_size, old_screen_size;	unsigned int new_cols, new_rows, new_row_size, new_screen_size;	unsigned short *newscreen;	WARN_CONSOLE_UNLOCKED();	if (!vc)		return -ENXIO;	if (cols > VC_RESIZE_MAXCOL || lines > VC_RESIZE_MAXROW)		return -EINVAL;	new_cols = (cols ? cols : vc->vc_cols);	new_rows = (lines ? lines : vc->vc_rows);	new_row_size = new_cols << 1;	new_screen_size = new_row_size * new_rows;	if (new_cols == vc->vc_cols && new_rows == vc->vc_rows)		return 0;	newscreen = (unsigned short *) kmalloc(new_screen_size, GFP_USER);	if (!newscreen)		return -ENOMEM;	old_rows = vc->vc_rows;	old_cols = vc->vc_cols;	old_row_size = vc->vc_size_row;	old_screen_size = vc->vc_screenbuf_size;	err = resize_screen(vc, new_cols, new_rows);	if (err) {		kfree(newscreen);		return err;	}	vc->vc_rows = new_rows;	vc->vc_cols = new_cols;	vc->vc_size_row = new_row_size;	vc->vc_screenbuf_size = new_screen_size;	rlth = min(old_row_size, new_row_size);	rrem = new_row_size - rlth;	old_origin = vc->vc_origin;	new_origin = (long) newscreen;	new_scr_end = new_origin + new_screen_size;	if (new_rows < old_rows)		old_origin += (old_rows - new_rows) * old_row_size;	update_attr(vc);	while (old_origin < vc->vc_scr_end) {		scr_memcpyw((unsigned short *) new_origin, (unsigned short *) old_origin, rlth);		if (rrem)			scr_memsetw((void *)(new_origin + rlth), vc->vc_video_erase_char, rrem);		old_origin += old_row_size;		new_origin += new_row_size;	}	if (new_scr_end > new_origin)		scr_memsetw((void *)new_origin, vc->vc_video_erase_char, new_scr_end - new_origin);	if (vc->vc_kmalloced)		kfree(vc->vc_screenbuf);	vc->vc_screenbuf = newscreen;	vc->vc_kmalloced = 1;	vc->vc_screenbuf_size = new_screen_size;	set_origin(vc);	/* do part of a reset_terminal() */	vc->vc_top = 0;	vc->vc_bottom = vc->vc_rows;	gotoxy(vc, vc->vc_x, vc->vc_y);	save_cur(vc);	if (vc->vc_tty) {		struct winsize ws, *cws = &vc->vc_tty->winsize;		memset(&ws, 0, sizeof(ws));		ws.ws_row = vc->vc_rows;		ws.ws_col = vc->vc_cols;		ws.ws_ypixel = vc->vc_scan_lines;		if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&		    vc->vc_tty->pgrp > 0)			kill_pg(vc->vc_tty->pgrp, SIGWINCH, 1);		*cws = ws;	}	if (CON_IS_VISIBLE(vc))		update_screen(vc);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3b41dc1a3c7839a765ffa560a5ae07aa5d253cc8/vt.c/clean/drivers/char/vt.c