From patchwork Sat Feb 21 13:26:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5859661 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 559CE9F380 for ; Sat, 21 Feb 2015 13:26:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DF7E20585 for ; Sat, 21 Feb 2015 13:26:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 622E02053A for ; Sat, 21 Feb 2015 13:26:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323AbbBUN0U (ORCPT ); Sat, 21 Feb 2015 08:26:20 -0500 Received: from mout.web.de ([212.227.15.4]:65489 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbbBUN0T (ORCPT ); Sat, 21 Feb 2015 08:26:19 -0500 Received: from [192.168.1.2] ([78.48.68.131]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0Lg3bv-1Xk6oM1y3P-00pd9C; Sat, 21 Feb 2015 14:26:09 +0100 Message-ID: <54E8876A.9090108@users.sourceforge.net> Date: Sat, 21 Feb 2015 14:26:02 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jean-Christophe Plagniol-Villard , Thomas Winischhofer , Tomi Valkeinen , linux-fbdev@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] video: fbdev-SIS: Deletion of unnecessary checks before three function calls References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:JvsNSl0FpD/lJhhqcuQdZMaQS0zNmJ7i76VV3QXH6rUyC0gWS8u 8w5AgUyO1cOjtk4zL6MQEayGCV6IGsJ1F7nCu3yuLn/ecAtLLETpvH02f8f4hRnOUHwnFbo yClcglYwrOeZC9qY85B6/ZLtexdL+L+6vh/tAXezc6UZ8Tki7GqWyF7+mq3tHnqzO+M4YGm O98f42a3vKFRiDnyGg8Iw== X-UI-Out-Filterresults: notjunk:1; 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 From: Markus Elfring Date: Sat, 21 Feb 2015 14:14:56 +0100 The functions sisfb_search_crt2type(), sisfb_search_specialtiming() and sisfb_search_tvstd() test whether their argument is NULL and then return immediately. Thus the test around their calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/video/fbdev/sis/sis_main.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c index fcf610e..20ca80f 100644 --- a/drivers/video/fbdev/sis/sis_main.c +++ b/drivers/video/fbdev/sis/sis_main.c @@ -6605,12 +6605,9 @@ static int __init sisfb_init_module(void) sisfb_scalelcd = scalelcd ^ 1; /* Need to check crt2 type first for fstn/dstn */ + sisfb_search_crt2type(forcecrt2type); - if(forcecrt2type) - sisfb_search_crt2type(forcecrt2type); - - if(tvstandard) - sisfb_search_tvstd(tvstandard); + sisfb_search_tvstd(tvstandard); if(mode) sisfb_search_mode(mode, false); @@ -6656,9 +6653,7 @@ static int __init sisfb_init_module(void) sisfb_pdca = (pdc1 & 0x1f); sisfb_nocrt2rate = nocrt2rate; - - if(specialtiming) - sisfb_search_specialtiming(specialtiming); + sisfb_search_specialtiming(specialtiming); if((lvdshl >= 0) && (lvdshl <= 3)) sisfb_lvdshl = lvdshl;