From patchwork Mon May 1 16:54:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13227637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C04BC7EE29 for ; Mon, 1 May 2023 16:55:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 813F3900004; Mon, 1 May 2023 12:55:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C443900002; Mon, 1 May 2023 12:55:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66513900004; Mon, 1 May 2023 12:55:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 57FE9900002 for ; Mon, 1 May 2023 12:55:14 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0488BA0739 for ; Mon, 1 May 2023 16:55:13 +0000 (UTC) X-FDA: 80742286548.19.1C5F5E5 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf12.hostedemail.com (Postfix) with ESMTP id 34D574001D for ; Mon, 1 May 2023 16:55:11 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=2YKjiLNW; spf=pass (imf12.hostedemail.com: domain of 37e5PZAYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=37e5PZAYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682960111; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tgVoyGNNM2CEwgGlnNhwRO5zW+BCSfKlhykn/JkHIoY=; b=gWXPUTIGomXOM6MVjeRM5MfW/dYo2LT/fX6TnA+Z9WaJUgFwbr8Orw6Quj+6GkfpWWmUDV nskwEjhq5ozIZS5FRN2mnmNHSXTRm/j4BxAaLrZ+OsD2uQfVvi2BwXBL5T86gGtxMD+3Jf 4wHMZiN2fVBAGA1UhB+dOGwzZ2T57iw= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=2YKjiLNW; spf=pass (imf12.hostedemail.com: domain of 37e5PZAYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=37e5PZAYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682960111; a=rsa-sha256; cv=none; b=U1DTLA5GnHJvJxne6WDrCtirEMmf0TPGpf9B4O6CX4dSlg4hHDySIePJIGYuLt9369vAck aCEzYOFa5qz1JXfYR1cxI7//8Sxl2SaHcHGO9L5LxSuNlcTrSLvnpgTFn2gLtRf2icPc/p A9WPagWeqTtLZzPzVceovjjPqHm1IiE= Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-24df9b0ed7aso1439414a91.3 for ; Mon, 01 May 2023 09:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682960110; x=1685552110; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=tgVoyGNNM2CEwgGlnNhwRO5zW+BCSfKlhykn/JkHIoY=; b=2YKjiLNW+kfuA2PzlgEprNmYD56U2DvqAYUQT3SxKi2Wkcms/FURL1MvVV4lKJqj8O 6/Ns7jrOtbP8ic5/FVYS4laNGQMz7H1sQUQlCcm/XRw/h77Gbtg2COyXGd2xvroS0fJn qwWPXD+NTjhYN8F2PIhFlV9xM7/YRbLeL8oWUbHvCo0bmT2YG7Au7XFXE7JF9tMEE+O2 Razpx64/yqsX3p0ZTAuL1qwvem7fqbeaFnGoyPVJo12mzY/mv/yC7mdLiyEupHVMtu6T xYmQq3px4UJy+E+76my+C+5ib12oMdQjlgTcOmFRh/w96xFVezYHyxkBpY3bPmKf/8tt YK/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682960110; x=1685552110; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=tgVoyGNNM2CEwgGlnNhwRO5zW+BCSfKlhykn/JkHIoY=; b=UWnhy0fgl1ZggHyvqxiOIdoQXjUt50JZ3vezsiW0L87kMO2hJpgwf5UibQ89PI+3Rn EkEz2n7d3c+awBNwKcofJduVNcuaM4XTq8gAXw/KY+tc6JjKl3OaHBpQiaxyzbYTx0p/ cxKsjoQ/vYwpYLo39E5U+jwd1SMgPw/Zx/KrjJ9f9oqoaqRz3LfEq9u4ChSYAqOKkHDK TmxTDbdRxydGlLu+AAmw4HGOuj13rOZ72pdk+hzCLAks5Y7eLAfA9Qx8kmfvDzCqIs3V M1Om3qfRxQKZTpzbif0GgFMZ7Nwldi5P2yBPhQQccYO13garEDu07W01/WApttN/dxy8 tNHg== X-Gm-Message-State: AC+VfDyXGuopTOID63IXBRXcvng3UMvUxbQuENMq2bFqio3saIUa5Uhx 1OBLxOaREbH4kqZKFMSLpWznrfYVF1w= X-Google-Smtp-Source: ACHHUZ4eBSTFzzY/h621MY7B4DCDMh7rr4Q0GpDOy2/h5VKYZfljnAlN4rMUCg0PfIpVagexBlmQ2RgWd74= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:6d24:3efd:facc:7ac4]) (user=surenb job=sendgmr) by 2002:a17:90a:390d:b0:246:66d6:f24e with SMTP id y13-20020a17090a390d00b0024666d6f24emr3850182pjb.2.1682960109840; Mon, 01 May 2023 09:55:09 -0700 (PDT) Date: Mon, 1 May 2023 09:54:11 -0700 In-Reply-To: <20230501165450.15352-1-surenb@google.com> Mime-Version: 1.0 References: <20230501165450.15352-1-surenb@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230501165450.15352-2-surenb@google.com> Subject: [PATCH 01/40] lib/string_helpers: Drop space in string_get_size's output From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Andy Shevchenko , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "Michael S. Tsirkin" , Jason Wang , " =?utf-8?q?Noralf_Tr=C3=B8nnes?= " X-Rspamd-Queue-Id: 34D574001D X-Stat-Signature: j1jtu4u86ddr9zyx9t98tzaxiiuteuyu X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1682960111-972321 X-HE-Meta: U2FsdGVkX18YKGapKfmIOdWCGutMw16PXe3k7PeDr1MELMOQAh7xhQrkSCoEQ3jFnVSr/22cDlmf+cDmkZWbZNeMf0NvtN+s91QueLF2/PFwZaXwaP/YJ6BmEiUmerXRtmJo0gxNSu8uOyvT5G8a6TnZp9x1y74NsMzh+Fht72dN6jwfFUGJct9IpP8WKFsyii8f088fu13Cbgj6FoFwIILc+TAgyj8Qnt6hd2QF0l7C9K3vrAPnIwIW0PXp5qqeKR1rfLPzcraQdTk6CayVvKfeN58ffUBtMDeB7QjRNHSz952AtFCRZb5EOYaDFLkgPUCNfg950e9ulukWuzzeoiqvrRuDXHh5HoYt6uHiQdNzJugnBCRS99XggGNEt7+s4GNXUUzGyW/d2ilZcNiXeYg0n4qvGFvsxNt1xYk9W9x/OIbAAbERudd3Ml0oAT5jVzuusnCDKBpcjDFeui1YdoTCmL60R1ZDrgm4Uy8HHxyu7qQRF3UsnDYPP3VzL8O/NMBTNKkyr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ycuCcxnVglNA7G24WS/Ufai2SanzswAzYJ+1kZZVdSGfqI25FGznyKLbuOCZIQdWVMD+uuWW7B0CmkrTOyzRc/XSruV/ExBVnBbTsIZZItZZF3q2Q1h/2+/ior4J7nTo7O1netjK1J8X64ZcpCxxKsmVBFsVGs7MUS6E45hJQMZVirsTE+jiYCKAID47P/xTtC1WmfzTPbkVBWywy52Kimxz+ktLDRUdOLceptDkcd6uKtIBz3+K7dZcrXlMgxdfPX3PQOalL8Xi+D6VLbL4+wH9CEanfl7tCNCJEgTtRCuUQeJkZlv2hlqmEXISo98uHg7jh97tE/uG/KphD0zEISyWUta9gYFkqmiN8ux1zmJ lUjnNlOJ TJI/058+XUc= 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: Kent Overstreet Previously, string_get_size() outputted a space between the number and the units, i.e. 9.88 MiB This changes it to 9.88MiB which allows it to be parsed correctly by the 'sort -h' command. Signed-off-by: Kent Overstreet Signed-off-by: Suren Baghdasaryan Cc: Andy Shevchenko Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: "Noralf Trønnes" Cc: Jens Axboe --- lib/string_helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 230020a2e076..593b29fece32 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -126,8 +126,7 @@ void string_get_size(u64 size, u64 blk_size, const enum string_size_units units, else unit = units_str[units][i]; - snprintf(buf, len, "%u%s %s", (u32)size, - tmp, unit); + snprintf(buf, len, "%u%s%s", (u32)size, tmp, unit); } EXPORT_SYMBOL(string_get_size);