Commit 7e5969ae authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds

lib/string_helpers: drop indentation level in string_escape_mem()

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.comSigned-off-by: default avatarAndy 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 62519b88
...@@ -515,29 +515,29 @@ int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, ...@@ -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 * In these cases we just pass through a character to the
* output buffer. * output buffer.
*/ */
if (is_dict && !strchr(only, c)) { if (is_dict && !strchr(only, c) &&
/* do nothing */ escape_passthrough(c, &p, end))
} else { continue;
if (isprint(c) &&
flags & ESCAPE_NP && escape_passthrough(c, &p, end))
continue;
if (flags & ESCAPE_SPACE && escape_space(c, &p, end)) if (isprint(c) &&
continue; flags & ESCAPE_NP && escape_passthrough(c, &p, end))
continue;
if (flags & ESCAPE_SPECIAL && escape_special(c, &p, end)) if (flags & ESCAPE_SPACE && escape_space(c, &p, end))
continue; continue;
if (flags & ESCAPE_NULL && escape_null(c, &p, end)) if (flags & ESCAPE_SPECIAL && escape_special(c, &p, end))
continue; continue;
/* ESCAPE_OCTAL and ESCAPE_HEX always go last */ if (flags & ESCAPE_NULL && escape_null(c, &p, end))
if (flags & ESCAPE_OCTAL && escape_octal(c, &p, end)) continue;
continue;
if (flags & ESCAPE_HEX && escape_hex(c, &p, end)) /* ESCAPE_OCTAL and ESCAPE_HEX always go last */
continue; 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); escape_passthrough(c, &p, end);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment