From patchwork Mon Apr 14 08:09:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3977831 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1CB87BFF02 for ; Mon, 14 Apr 2014 08:12:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D59A201DC for ; Mon, 14 Apr 2014 08:12:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DA4020160 for ; Mon, 14 Apr 2014 08:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751235AbaDNIMS (ORCPT ); Mon, 14 Apr 2014 04:12:18 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:19166 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbaDNIMO (ORCPT ); Mon, 14 Apr 2014 04:12:14 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3E89VLP013364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Apr 2014 08:09:32 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3E89Uls011534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Apr 2014 08:09:30 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s3E89T6E009486; Mon, 14 Apr 2014 08:09:29 GMT Received: from mwanda (/41.202.240.3) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 14 Apr 2014 01:09:28 -0700 Date: Mon, 14 Apr 2014 11:09:29 +0300 From: Dan Carpenter To: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen , Jingoo Han , "Jett.Zhou" , Zhou Zhu , Jing Xiang , linux-fbdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] video: mmpfb: cleanup some static checker warnings in probe() Message-ID: <20140414080929.GB13372@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Sparse complains about using zero instead of NULL for pointers. Probably, if we enabled the warning, then GCC would complain about the unused initializers. I've just removed them. Smatch complains that we first check if "fbi" is NULL and then dereference it in the error handling. It turns out that "fbi" can't be NULL so I've removed the check. Signed-off-by: Dan Carpenter Reviewed-by: Jingoo Han --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c index 7ab31eb..910fcc6 100644 --- a/drivers/video/fbdev/mmp/fb/mmpfb.c +++ b/drivers/video/fbdev/mmp/fb/mmpfb.c @@ -554,8 +554,8 @@ static void fb_info_clear(struct fb_info *info) static int mmpfb_probe(struct platform_device *pdev) { struct mmp_buffer_driver_mach_info *mi; - struct fb_info *info = 0; - struct mmpfb_info *fbi = 0; + struct fb_info *info; + struct mmpfb_info *fbi; int ret, modes_num; mi = pdev->dev.platform_data; @@ -569,10 +569,6 @@ static int mmpfb_probe(struct platform_device *pdev) if (info == NULL) return -ENOMEM; fbi = info->par; - if (!fbi) { - ret = -EINVAL; - goto failed; - } /* init fb */ fbi->fb_info = info; @@ -667,7 +663,6 @@ failed_free_buff: fbi->fb_start_dma); failed_destroy_mutex: mutex_destroy(&fbi->access_ok); -failed: dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); framebuffer_release(info);