From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751581AbbBUN0W (ORCPT ); Sat, 21 Feb 2015 08:26:22 -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 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> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.3.0