From patchwork Wed Mar 5 15:56:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wang yanqing X-Patchwork-Id: 3777211 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D9F029F383 for ; Wed, 5 Mar 2014 15:57:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9329C20220 for ; Wed, 5 Mar 2014 15:57:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCBF82020F for ; Wed, 5 Mar 2014 15:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754149AbaCEP5V (ORCPT ); Wed, 5 Mar 2014 10:57:21 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:59381 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752815AbaCEP5U (ORCPT ); Wed, 5 Mar 2014 10:57:20 -0500 Received: by mail-pa0-f48.google.com with SMTP id hz1so1264937pad.35 for ; Wed, 05 Mar 2014 07:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=jPRZKCvKOoLXtg5KUpE/JpZqIsIKWS4PPHIj8oKmMtA=; b=uVDEyDrlSQB8JlWLi7sq/NnFTMYXh15/RM4lkmjb6VZ5pNrh0U/fgsydz8lMKrCqXf xfOhKj69DDvlENz6B3DCCHvZglhPERJ8qGEqOcXRjeLqV+Rw33/SKz8l6eFA0FHaS1+h b6S5ToQIJ8WMDLQnCJhFq4oMddg5o2mSfqi36epc0c+xyAtKQvnkzo9YZCfLfOEwUdCH Gs0Zp/LFUMcBeZ5qevaIIIhEKJ+XnkfcUDP8HXEku3oHFgj5WGrc+omo859zFYCm0c3Q qPG5WSDGhvJ3I6zgxYSjiSD6GzSFZ9oW4zGwwNsjkygnVzsG3m1EDrm727mB06Fk0BOK cFkg== X-Received: by 10.68.254.103 with SMTP id ah7mr7619427pbd.159.1394035039587; Wed, 05 Mar 2014 07:57:19 -0800 (PST) Received: from udknight.localhost ([117.30.98.13]) by mx.google.com with ESMTPSA id c7sm9812670pbt.0.2014.03.05.07.57.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Mar 2014 07:57:18 -0800 (PST) Received: from udknight.localhost (udknight.localhost [127.0.0.1]) by udknight.localhost (8.14.4/8.14.4) with ESMTP id s25FuLEp032201; Wed, 5 Mar 2014 23:56:26 +0800 Received: (from root@localhost) by udknight.localhost (8.14.4/8.14.4/Submit) id s25FuJ6B032200; Wed, 5 Mar 2014 23:56:19 +0800 Date: Wed, 5 Mar 2014 23:56:19 +0800 From: Wang YanQing To: tomi.valkeinen@ti.com Cc: plagnioj@jcrosoft.com, fengguang.wu@intel.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info Message-ID: <20140305155619.GA32166@udknight> Mail-Followup-To: Wang YanQing , tomi.valkeinen@ti.com, plagnioj@jcrosoft.com, fengguang.wu@intel.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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