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-next>] [day] [month] [year] [list]
Date: Sat, 24 Feb 2024 14:28:32 -0800
From: Joe Perches <joe@...ches.com>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: linux-mips@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: sibyte: pointless if tests

A checkpatch modification was suggested privately about
braces around an if test like

	if (foo)
		;

so I thought I'd see how many of these possibly pointless
if tests exist.  There aren't many.

Here are a couple in sibyte:

Maybe this should be documented as:

	"well, don't know what to do here"

$ cat if_semi.cocci
@@
expression e;
@@

*	if (e) ;

$ spatch --very-quiet -sp-file if_semi.cocci .
diff -u -p ./arch/mips/sibyte/common/cfe_console.c /tmp/nothing/arch/mips/sibyte/common/cfe_console.c
--- ./arch/mips/sibyte/common/cfe_console.c
+++ /tmp/nothing/arch/mips/sibyte/common/cfe_console.c
@@ -22,8 +22,6 @@ static void cfe_console_write(struct con
 		if (str[i] == '\n') {
 			do {
 				written = cfe_write(cfe_cons_handle, &str[last], i-last);
-				if (written < 0)
-					;
 				last += written;
 			} while (last < i);
 			while (cfe_write(cfe_cons_handle, "\r", 1) <= 0)
@@ -33,8 +31,6 @@ static void cfe_console_write(struct con
 	if (last != count) {
 		do {
 			written = cfe_write(cfe_cons_handle, &str[last], count-last);
-			if (written < 0)
-				;
 			last += written;
 		} while (last < count);
 	}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ