docproc: reduce unnecessary indentation
authorJani Nikula <jani.nikula@intel.com>
Thu, 12 May 2016 13:15:40 +0000 (16:15 +0300)
committerJonathan Corbet <corbet@lwn.net>
Sat, 14 May 2016 15:56:41 +0000 (09:56 -0600)
Improves clarity. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/docproc.c

index 48abc01a920e0cc002b4910852036a4acae5eff8..fb195f0ed0ef3833ab016c08a5db2953b509acc5 100644 (file)
@@ -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);
                }
        }