lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Feb 2015 14:26:02 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Thomas Winischhofer <thomas@...ischhofer.net>,
	Tomi Valkeinen <tomi.valkeinen@...com>,
	linux-fbdev@...r.kernel.org
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] video: fbdev-SIS: Deletion of unnecessary checks before three
 function calls

From: Markus Elfring <elfring@...rs.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@...rs.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ