linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Video: fbdev: Remove impossible condition.
@ 2016-11-11 11:46 Shailendra Verma
  0 siblings, 0 replies; 4+ messages in thread
From: Shailendra Verma @ 2016-11-11 11:46 UTC (permalink / raw)
  To: Tomi Valkeinen, Michal Hocko, Dave Hansen, linux-kernel,
	Shailendra Verma, Shailendra Verma
  Cc: vidushi.koul

xoffset and yoffset of struct fb_var_screeninfo are unsigned and so
they can never be less than 0.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
 drivers/video/fbdev/pvr2fb.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c
index a2564ab..23ada1f 100644
--- a/drivers/video/fbdev/pvr2fb.c
+++ b/drivers/video/fbdev/pvr2fb.c
@@ -460,13 +460,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->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 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-08 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20170208153734epcas5p1f56516b023b93b77f4bc43d1ac997769@epcas5p1.samsung.com>
2016-11-11 12:24 ` [PATCH] Video: fbdev: Remove impossible condition Sachin Shukla
2016-11-11 14:49   ` Timur Tabi
2017-02-08 15:37   ` Bartlomiej Zolnierkiewicz
2016-11-11 11:46 Shailendra Verma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).