From patchwork Thu Jul 1 01:55:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12353377 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 B9282C11F66 for ; Thu, 1 Jul 2021 01:55:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 710B06141A for ; Thu, 1 Jul 2021 01:55:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 710B06141A 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 D190D8D026B; Wed, 30 Jun 2021 21:55:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C79C98D024F; Wed, 30 Jun 2021 21:55:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1AB48D026B; Wed, 30 Jun 2021 21:55:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 85F1E8D024F for ; Wed, 30 Jun 2021 21:55:42 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 58DE021960 for ; Thu, 1 Jul 2021 01:55:42 +0000 (UTC) X-FDA: 78312352524.39.ADE654C Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf02.hostedemail.com (Postfix) with ESMTP id 149307001773 for ; Thu, 1 Jul 2021 01:55:41 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 29C7B61420; Thu, 1 Jul 2021 01:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1625104541; bh=X3E4436PzFkfXdyT61o/JSkrqgwMOa6MEDcYQWSLNDY=; h=Date:From:To:Subject:In-Reply-To:From; b=jrzVdYCaTaK4RodLv+kJLhlbvTvQ4/tyWEKWX2FqZHsWEMuqnr1v7a4BwH5RZhJqK /FByUPCf/Fvok2E48AymaB6vykVs1H2foI7sElk0ocPHhR3wzz25R/kkIctH1xoOnj B8PGp/e4uZVbrZKU4MJWIjl/kEq+tyd4SasVxer8= Date: Wed, 30 Jun 2021 18:55:40 -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 160/192] seq_file: convert seq_escape() to use seq_escape_str() Message-ID: <20210701015540.8J5zoxl9V%akpm@linux-foundation.org> In-Reply-To: <20210630184624.9ca1937310b0dd5ce66b30e7@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=jrzVdYCa; spf=pass (imf02.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 149307001773 X-Stat-Signature: jc7jbit8swscjubhg3z9xj831h8bhaj5 X-HE-Tag: 1625104541-112837 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: seq_file: convert seq_escape() to use seq_escape_str() Convert seq_escape() to use seq_escape_str() rather than open coding it. Note, for now we leave it as an exported symbol due to some old code that can't tolerate ctype.h being (indirectly) included. Link: https://lkml.kernel.org/r/20210504180819.73127-14-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 --- fs/seq_file.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/fs/seq_file.c~seq_file-convert-seq_escape-to-use-seq_escape_str +++ a/fs/seq_file.c @@ -392,12 +392,7 @@ EXPORT_SYMBOL(seq_escape_mem); */ void seq_escape(struct seq_file *m, const char *s, const char *esc) { - char *buf; - size_t size = seq_get_buf(m, &buf); - int ret; - - ret = string_escape_str(s, buf, size, ESCAPE_OCTAL, esc); - seq_commit(m, ret < size ? ret : -1); + seq_escape_str(m, s, ESCAPE_OCTAL, esc); } EXPORT_SYMBOL(seq_escape);