From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53A76C11F69 for ; Thu, 1 Jul 2021 01:55:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0322B61469 for ; Thu, 1 Jul 2021 01:55:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0322B61469 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 80F476B00C4; Wed, 30 Jun 2021 21:55:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7991C6B00C6; Wed, 30 Jun 2021 21:55:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6211F6B00C4; Wed, 30 Jun 2021 21:55:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id 3828D6B00C4 for ; Wed, 30 Jun 2021 21:55:13 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 13C9E253D3 for ; Thu, 1 Jul 2021 01:55:13 +0000 (UTC) X-FDA: 78312351306.25.C42BC01 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id B0BDA6001A84 for ; Thu, 1 Jul 2021 01:55:12 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A827161468; Thu, 1 Jul 2021 01:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1625104512; bh=4Mpa2rwdbCPvVFcSJxxOL9nBYSlpttWLrsHinkDW53g=; h=Date:From:To:Subject:In-Reply-To:From; b=NUjnVtaNlp8LJUGPeCs9AYMLZayDhZfDLSQVWiBs8BGKLoepO4gzbChIIh/m+/arv sUCfTvJbiNP+n6ucbpNqIPzuhoUrm4/N38gwWIiMDBB4Skc07LfC+Ph5TVIyX5M4Ei TBX4C4+KPlIfBJmP8NJGGdAfS9gZgkwn2sDmcLzM= Date: Wed, 30 Jun 2021 18:55:11 -0700 From: Andrew Morton To: akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, bfields@fieldses.org, chuck.lever@oracle.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk Subject: [patch 150/192] lib/string_helpers: drop indentation level in string_escape_mem() Message-ID: <20210701015511.sGCCmfpPg%akpm@linux-foundation.org> In-Reply-To: <20210630184624.9ca1937310b0dd5ce66b30e7@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B0BDA6001A84 X-Stat-Signature: k1s8pj7ah1m8xhgf58mdwbp4jim1qi5h Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=NUjnVtaN; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1625104512-380733 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andy Shevchenko Subject: 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.com Signed-off-by: Andy Shevchenko Cc: Alexander Viro Cc: Chuck Lever Cc: "J. Bruce Fields" Signed-off-by: Andrew Morton --- lib/string_helpers.c | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) --- a/lib/string_helpers.c~lib-string_helpers-drop-indentation-level-in-string_escape_mem +++ a/lib/string_helpers.c @@ -515,29 +515,29 @@ int string_escape_mem(const char *src, s * 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 (flags & ESCAPE_SPACE && escape_space(c, &p, end)) - continue; - - if (flags & ESCAPE_SPECIAL && escape_special(c, &p, end)) - continue; - - if (flags & ESCAPE_NULL && escape_null(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; - } + if (is_dict && !strchr(only, c) && + escape_passthrough(c, &p, end)) + continue; + + if (isprint(c) && + flags & ESCAPE_NP && escape_passthrough(c, &p, end)) + continue; + + if (flags & ESCAPE_SPACE && escape_space(c, &p, end)) + continue; + + if (flags & ESCAPE_SPECIAL && escape_special(c, &p, end)) + continue; + + if (flags & ESCAPE_NULL && escape_null(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); } _