Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: fbdev: amiga: Simplify amifb_pan_display()

The fb_pan_display() function in the core already takes care of
validating most panning parameters before calling the driver's
.fb_pan_display() callback, and of updating the panning state
afterwards, so there is no need to repeat that in the driver.

Remove the duplicate code.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Geert Uytterhoeven and committed by
Helge Deller
2194f957 ff699273

+2 -13
+2 -13
drivers/video/fbdev/amifb.c
··· 2540 2540 static int amifb_pan_display(struct fb_var_screeninfo *var, 2541 2541 struct fb_info *info) 2542 2542 { 2543 - if (var->vmode & FB_VMODE_YWRAP) { 2544 - if (var->yoffset < 0 || 2545 - var->yoffset >= info->var.yres_virtual || var->xoffset) 2546 - return -EINVAL; 2547 - } else { 2543 + if (!(var->vmode & FB_VMODE_YWRAP)) { 2548 2544 /* 2549 2545 * TODO: There will be problems when xpan!=1, so some columns 2550 2546 * on the right side will never be seen 2551 2547 */ 2552 2548 if (var->xoffset + info->var.xres > 2553 - upx(16 << maxfmode, info->var.xres_virtual) || 2554 - var->yoffset + info->var.yres > info->var.yres_virtual) 2549 + upx(16 << maxfmode, info->var.xres_virtual)) 2555 2550 return -EINVAL; 2556 2551 } 2557 2552 ami_pan_var(var, info); 2558 - info->var.xoffset = var->xoffset; 2559 - info->var.yoffset = var->yoffset; 2560 - if (var->vmode & FB_VMODE_YWRAP) 2561 - info->var.vmode |= FB_VMODE_YWRAP; 2562 - else 2563 - info->var.vmode &= ~FB_VMODE_YWRAP; 2564 2553 return 0; 2565 2554 } 2566 2555