diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2013-02-03 22:54:31 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-04 10:46:27 -0800 |
commit | 44e1312c68e71a25f9f88ada7d124f5bbeaf879e (patch) | |
tree | 198e97e8bd4b38fcf4575eeb009f102a1f4c3405 | |
parent | f2c22605c5a12c605a7164585c96f0835e9e591c (diff) | |
download | linux-44e1312c68e71a25f9f88ada7d124f5bbeaf879e.tar.bz2 |
staging/xgifb: Remove always false comparisons
This patch removes some comparisons that always evaluate to false since
xoffset and yoffset are defined as __u32 in fb_var_screeninfo in
include/linux/fb.h and thus can never be negative.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/xgifb/XGI_main_26.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index ca9f58338728..83f8a6a662c0 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -1333,12 +1333,6 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) /* Adapt RGB settings */ XGIfb_bpp_to_var(xgifb_info, var); - /* Sanity check for offsets */ - if (var->xoffset < 0) - var->xoffset = 0; - if (var->yoffset < 0) - var->yoffset = 0; - if (!XGIfb_ypan) { if (var->xres != var->xres_virtual) var->xres_virtual = var->xres; @@ -1373,8 +1367,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var, return -EINVAL; if (var->vmode & FB_VMODE_YWRAP) { - if (var->yoffset < 0 || var->yoffset >= info->var.yres_virtual - || var->xoffset) + if (var->yoffset >= info->var.yres_virtual || var->xoffset) return -EINVAL; } else if (var->xoffset + info->var.xres > info->var.xres_virtual || var->yoffset + info->var.yres |