linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info
@ 2014-03-05 15:56 Wang YanQing
  2014-03-06  9:32 ` Tomi Valkeinen
  0 siblings, 1 reply; 2+ messages in thread
From: Wang YanQing @ 2014-03-05 15:56 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: plagnioj, fengguang.wu, linux-fbdev, linux-kernel

Because uvesafb_vbe_init will fail when get zero avaiable modes,
and we have checked the return value of uvesafb_vbe_init_mode,
so it is impossible to pass NULL as mode into uvesafb_init_info.

[ This patch fix warning report by fengguang.wu@intel.com
  "drivers/video/fbdev/uvesafb.c:1509 uvesafb_init_info()
   error: we previously assumed 'mode' could be null" ]

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 18352b2..509d452 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1474,12 +1474,7 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
 	 *                 used video mode, i.e. the minimum amount of
 	 *                 memory we need.
 	 */
-	if (mode != NULL) {
-		size_vmode = info->var.yres * mode->bytes_per_scan_line;
-	} else {
-		size_vmode = info->var.yres * info->var.xres *
-			     ((info->var.bits_per_pixel + 7) >> 3);
-	}
+	size_vmode = info->var.yres * mode->bytes_per_scan_line;
 
 	/*
 	 *   size_total -- all video memory we have. Used for mtrr
-- 
1.8.3.4.8.g69490f3.dirty

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

end of thread, other threads:[~2014-03-06  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 15:56 [PATCH] video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info Wang YanQing
2014-03-06  9:32 ` Tomi Valkeinen

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).