lib/string_helpers: drop indentation level in string_escape_mem()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 1 Jul 2021 01:55:11 +0000 (18:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Jul 2021 18:06:04 +0000 (11:06 -0700)
The only one conditional is left on the upper level, move the rest to the
same level and drop indentation level.  No functional changes.

Link: https://lkml.kernel.org/r/20210504180819.73127-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/string_helpers.c

index b10a18b4663ba57176de1867964e0bff616a0d74..e3ef9f86cc3417c45d7b2df65a12d2ef4bbf0dcc 100644 (file)
@@ -515,29 +515,29 @@ int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz,
                 * In these cases we just pass through a character to the
                 * output buffer.
                 */
-               if (is_dict && !strchr(only, c)) {
-                       /* do nothing */
-               } else {
-                       if (isprint(c) &&
-                           flags & ESCAPE_NP && escape_passthrough(c, &p, end))
-                               continue;
+               if (is_dict && !strchr(only, c) &&
+                                         escape_passthrough(c, &p, end))
+                       continue;
 
-                       if (flags & ESCAPE_SPACE && escape_space(c, &p, end))
-                               continue;
+               if (isprint(c) &&
+                   flags & ESCAPE_NP && escape_passthrough(c, &p, end))
+                       continue;
 
-                       if (flags & ESCAPE_SPECIAL && escape_special(c, &p, end))
-                               continue;
+               if (flags & ESCAPE_SPACE && escape_space(c, &p, end))
+                       continue;
 
-                       if (flags & ESCAPE_NULL && escape_null(c, &p, end))
-                               continue;
+               if (flags & ESCAPE_SPECIAL && escape_special(c, &p, end))
+                       continue;
 
-                       /* ESCAPE_OCTAL and ESCAPE_HEX always go last */
-                       if (flags & ESCAPE_OCTAL && escape_octal(c, &p, end))
-                               continue;
+               if (flags & ESCAPE_NULL && escape_null(c, &p, end))
+                       continue;
 
-                       if (flags & ESCAPE_HEX && escape_hex(c, &p, end))
-                               continue;
-               }
+               /* ESCAPE_OCTAL and ESCAPE_HEX always go last */
+               if (flags & ESCAPE_OCTAL && escape_octal(c, &p, end))
+                       continue;
+
+               if (flags & ESCAPE_HEX && escape_hex(c, &p, end))
+                       continue;
 
                escape_passthrough(c, &p, end);
        }