From patchwork Wed Sep 14 11:57:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: haoxin X-Patchwork-Id: 12976061 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 1AD15ECAAD3 for ; Wed, 14 Sep 2022 11:57:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7ABE940008; Wed, 14 Sep 2022 07:57:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A02D8940007; Wed, 14 Sep 2022 07:57:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CBF1940008; Wed, 14 Sep 2022 07:57:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 788D2940007 for ; Wed, 14 Sep 2022 07:57:34 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 503F512046C for ; Wed, 14 Sep 2022 11:57:34 +0000 (UTC) X-FDA: 79910541228.17.9255A3C Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by imf24.hostedemail.com (Postfix) with ESMTP id E04B21800C8 for ; Wed, 14 Sep 2022 11:57:32 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VPnFGbQ_1663156646; Received: from localhost.localdomain(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0VPnFGbQ_1663156646) by smtp.aliyun-inc.com; Wed, 14 Sep 2022 19:57:27 +0800 From: Xin Hao To: sj@kernel.org Cc: akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xhao@linux.alibaba.com Subject: [PATCH] mm/hugetlbfs: use macro SZ_1K to replace 1024 Date: Wed, 14 Sep 2022 19:57:23 +0800 Message-Id: <20220914115723.38271-1-xhao@linux.alibaba.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf24.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.54 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663156654; a=rsa-sha256; cv=none; b=c7KBfrS/fzXIY/xKKy+vyhfaTEg9BdTtWtps2ECjkp7tPzIB5LyhLjkMw7Z7KDhnNx2TAO cnDNRzTUj6cwVeOge4qha8RJJ3HEy00ZP6Pgh6NJ2DlkytFbGoaWEEGsKDoSemFob1hWXU BnrBOw9E1inQq7TNWkGsttCM2mwwp5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663156654; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=OQWQTwt1Ktmj4SCtO6TIuoaFNxoHiMOfI2QSFb7hlKI=; b=2N74hDO7mnYBvzpxAajCc8e0bRyKWCr63P+ygnXKO8MPgO6DZ+UZzwMxBcqveOpMJtuWnJ Lz9ui3xUv/TngMqY2u4Rw340Il9Cp0K3AcDd15pWoD0NVfrIfeSpkO3ZnQpf4Rde6PL9GD do4NRouNl/lvs4BPfuMyun8P0Ai1HCc= X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf24.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.54 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E04B21800C8 X-Stat-Signature: y6cs7cs94tody7tyu7nzxpjf4spm8hhk X-HE-Tag: 1663156652-858231 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: Using macro SZ_1K in hugetlbfs_show_options() has no any functional changes, just makes code more readable. Signed-off-by: Xin Hao Reviewed-by: SeongJae Park --- fs/hugetlbfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.31.0 diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index f7a5b5124d8a..9b9784ffe8de 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1023,10 +1023,10 @@ static int hugetlbfs_show_options(struct seq_file *m, struct dentry *root) if (sbinfo->max_inodes != -1) seq_printf(m, ",nr_inodes=%lu", sbinfo->max_inodes); - hpage_size /= 1024; + hpage_size /= SZ_1K; mod = 'K'; - if (hpage_size >= 1024) { - hpage_size /= 1024; + if (hpage_size >= SZ_1K) { + hpage_size /= SZ_1K; mod = 'M'; } seq_printf(m, ",pagesize=%lu%c", hpage_size, mod);