diff options
author | Gustavo A. R. Silva | 2019-07-22 15:33:58 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz | 2019-08-19 15:52:23 +0200 |
commit | dbb4a75b9c405dbd0a53698a6d21626145138193 (patch) | |
tree | cdd4f9694f73ffb2cd1f43a5dc3ef65e28f8f05b /drivers/video | |
parent | 51677dfcc17f88ed754143df670ff064eae67f84 (diff) |
video: fbdev: pvr2fb: remove unnecessary comparison of unsigned integer with < 0
There is no need to compare *var->xoffset* or *var->yoffset* with < 0
because such variables are of type unsigned, making it impossible to
hold a negative value.
Fix this by removing such comparisons.
Addresses-Coverity-ID: 1451964 ("Unsigned compared against 0")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722203358.GA29111@embeddedor
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/pvr2fb.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index 7ff4b6b84282..0a3b2b7c7891 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -458,13 +458,11 @@ static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) set_color_bitfields(var); if (var->vmode & FB_VMODE_YWRAP) { - if (var->xoffset || var->yoffset < 0 || - var->yoffset >= var->yres_virtual) { + if (var->xoffset || var->yoffset >= var->yres_virtual) { var->xoffset = var->yoffset = 0; } else { if (var->xoffset > var->xres_virtual - var->xres || - var->yoffset > var->yres_virtual - var->yres || - var->xoffset < 0 || var->yoffset < 0) + var->yoffset > var->yres_virtual - var->yres) var->xoffset = var->yoffset = 0; } } else { |