From: "Antonino A. Daplas" Instead of manually filling up the fields in struct fb_var_screeninfo, use the display_to_var() helper. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton --- drivers/video/console/fbcon.c | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff -puN drivers/video/console/fbcon.c~fbcon-use-helper-function-when-filling-out-var-structure drivers/video/console/fbcon.c --- devel/drivers/video/console/fbcon.c~fbcon-use-helper-function-when-filling-out-var-structure 2005-10-18 19:12:04.000000000 -0700 +++ devel-akpm/drivers/video/console/fbcon.c 2005-10-18 19:12:05.000000000 -0700 @@ -1886,24 +1886,11 @@ static int fbcon_resize(struct vc_data * mode = fb_find_best_mode(&var, &info->modelist); if (mode == NULL) return -EINVAL; + display_to_var(&var, p); fb_videomode_to_var(&var, mode); + if (width > var.xres/fw || height > var.yres/fh) return -EINVAL; - /* - * The following can probably have any value... Do we need to - * set all of them? - */ - var.bits_per_pixel = p->bits_per_pixel; - var.xres_virtual = p->xres_virtual; - var.yres_virtual = p->yres_virtual; - var.accel_flags = p->accel_flags; - var.width = p->width; - var.height = p->height; - var.red = p->red; - var.green = p->green; - var.blue = p->blue; - var.transp = p->transp; - var.nonstd = p->nonstd; DPRINTK("resize now %ix%i\n", var.xres, var.yres); if (CON_IS_VISIBLE(vc)) { _