From patchwork Fri Nov 5 20:40:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605571 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A68EC433F5 for ; Fri, 5 Nov 2021 20:40:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 541A1611C0 for ; Fri, 5 Nov 2021 20:40:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 541A1611C0 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=kvack.org Received: by kanga.kvack.org (Postfix) id E20E9940064; Fri, 5 Nov 2021 16:40:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD359940049; Fri, 5 Nov 2021 16:40:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBFEF940064; Fri, 5 Nov 2021 16:40:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id BA447940049 for ; Fri, 5 Nov 2021 16:40:07 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 80AFD70016 for ; Fri, 5 Nov 2021 20:40:07 +0000 (UTC) X-FDA: 78776043654.34.F47D267 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP id 1C05070000B0 for ; Fri, 5 Nov 2021 20:40:07 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B18C6056B; Fri, 5 Nov 2021 20:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636144806; bh=d6gn+ixdceP9Bxg3VhLYYjfPb4KMkyQcz6rHhqmc4ZA=; h=Date:From:To:Subject:In-Reply-To:From; b=zdS0Bpnw4kvPHLVKiVS44SpbfPLKuYAxeKHEDyWkPltx6SBxVctSvzIXfONeSW7tc B8ZDYjz4ta1OOJTs8Kzjg3cmUF0Kka6MXP75ZnkrU0eqSeIE6TFd/K7V+w/5GzhYA6 VStJj0D9PDHo2pz3JRydgNg2aA0M2TtdN6kIe2cY= Date: Fri, 05 Nov 2021 13:40:05 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, linmiaohe@huawei.com, linux-mm@kvack.org, mgorman@techsingularity.net, mm-commits@vger.kernel.org, peterz@infradead.org, sfr@canb.auug.org.au, torvalds@linux-foundation.org, vbabka@suse.cz Subject: [patch 104/262] mm/page_alloc.c: simplify the code by using macro K() Message-ID: <20211105204005.x38Vwho4S%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1C05070000B0 X-Stat-Signature: di4xqu6gy6sinfxmmrm86ejtt4hfq3b4 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=zdS0Bpnw; spf=pass (imf27.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-HE-Tag: 1636144807-949989 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: Miaohe Lin Subject: mm/page_alloc.c: simplify the code by using macro K() Use helper macro K() to convert the pages to the corresponding size. Minor readability improvement. Link: https://lkml.kernel.org/r/20210902121242.41607-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Mel Gorman Reviewed-by: David Hildenbrand Cc: Peter Zijlstra Cc: Stephen Rothwell Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/page_alloc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) --- a/mm/page_alloc.c~mm-page_allocc-simplify-the-code-by-using-macro-k +++ a/mm/page_alloc.c @@ -8130,8 +8130,7 @@ unsigned long free_reserved_area(void *s } if (pages && s) - pr_info("Freeing %s memory: %ldK\n", - s, pages << (PAGE_SHIFT - 10)); + pr_info("Freeing %s memory: %ldK\n", s, K(pages)); return pages; } @@ -8176,14 +8175,13 @@ void __init mem_init_print_info(void) ", %luK highmem" #endif ")\n", - nr_free_pages() << (PAGE_SHIFT - 10), - physpages << (PAGE_SHIFT - 10), + K(nr_free_pages()), K(physpages), codesize >> 10, datasize >> 10, rosize >> 10, (init_data_size + init_code_size) >> 10, bss_size >> 10, - (physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10), - totalcma_pages << (PAGE_SHIFT - 10) + K(physpages - totalram_pages() - totalcma_pages), + K(totalcma_pages) #ifdef CONFIG_HIGHMEM - , totalhigh_pages() << (PAGE_SHIFT - 10) + , K(totalhigh_pages()) #endif ); }