[PATCH] video: fbdev-SIS: Deletion of unnecessary checks before three function calls

SF Markus Elfring
2015-02-21T13:26:22Z

From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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