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]
Message-Id: <ce795dbddc83d8d4639c1ddc19bc5381c80f64c6.1463058396.git.jani.nikula@intel.com>
Date:	Thu, 12 May 2016 16:15:40 +0300
From:	Jani Nikula <jani.nikula@...el.com>
To:	Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org
Cc:	jani.nikula@...el.com
Subject: [PATCH 5/9] docproc: reduce unnecessary indentation

Improves clarity. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@...el.com>
---
 scripts/docproc.c | 93 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 47 insertions(+), 46 deletions(-)

diff --git a/scripts/docproc.c b/scripts/docproc.c
index 48abc01a920e..fb195f0ed0ef 100644
--- a/scripts/docproc.c
+++ b/scripts/docproc.c
@@ -445,52 +445,53 @@ static void parse_file(FILE *infile)
 	char line[MAXLINESZ];
 	char * s;
 	while (fgets(line, MAXLINESZ, infile)) {
-		if (line[0] == '!') {
-			s = line + 2;
-			switch (line[1]) {
-				case 'E':
-					while (*s && !isspace(*s)) s++;
-					*s = '\0';
-					externalfunctions(line+2);
-					break;
-				case 'I':
-					while (*s && !isspace(*s)) s++;
-					*s = '\0';
-					internalfunctions(line+2);
-					break;
-				case 'D':
-					while (*s && !isspace(*s)) s++;
-					*s = '\0';
-					symbolsonly(line+2);
-					break;
-				case 'F':
-					/* filename */
-					while (*s && !isspace(*s)) s++;
-					*s++ = '\0';
-					/* function names */
-					while (isspace(*s))
-						s++;
-					singlefunctions(line +2, s);
-					break;
-				case 'P':
-					/* filename */
-					while (*s && !isspace(*s)) s++;
-					*s++ = '\0';
-					/* DOC: section name */
-					while (isspace(*s))
-						s++;
-					docsection(line + 2, s);
-					break;
-				case 'C':
-					while (*s && !isspace(*s)) s++;
-					*s = '\0';
-					if (findall)
-						findall(line+2);
-					break;
-				default:
-					defaultline(line);
-			}
-		} else {
+		if (line[0] != '!') {
+			defaultline(line);
+			continue;
+		}
+
+		s = line + 2;
+		switch (line[1]) {
+		case 'E':
+			while (*s && !isspace(*s)) s++;
+			*s = '\0';
+			externalfunctions(line+2);
+			break;
+		case 'I':
+			while (*s && !isspace(*s)) s++;
+			*s = '\0';
+			internalfunctions(line+2);
+			break;
+		case 'D':
+			while (*s && !isspace(*s)) s++;
+			*s = '\0';
+			symbolsonly(line+2);
+			break;
+		case 'F':
+			/* filename */
+			while (*s && !isspace(*s)) s++;
+			*s++ = '\0';
+			/* function names */
+			while (isspace(*s))
+				s++;
+			singlefunctions(line +2, s);
+			break;
+		case 'P':
+			/* filename */
+			while (*s && !isspace(*s)) s++;
+			*s++ = '\0';
+			/* DOC: section name */
+			while (isspace(*s))
+				s++;
+			docsection(line + 2, s);
+			break;
+		case 'C':
+			while (*s && !isspace(*s)) s++;
+			*s = '\0';
+			if (findall)
+				findall(line+2);
+			break;
+		default:
 			defaultline(line);
 		}
 	}
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ