Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3639150pxb; Mon, 30 Aug 2021 07:12:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0PfQKkI/dlvQWK7ZHNUwvHkiKSDGTIhfkUFmj3f+wlZW9+FmwGKSH0hcpm3k6lgIFZLbX X-Received: by 2002:a05:600c:299:: with SMTP id 25mr20211109wmk.107.1630332775556; Mon, 30 Aug 2021 07:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630332775; cv=none; d=google.com; s=arc-20160816; b=Nvm9Phh8xudRkFFHX9ph9t3sOK4JWkpOXqhiTXmeEQtXdG8RvlKwqNCG1dkFDvLyup s9Pe3+RgHGlD00cHgItsJKTcXpuauhCKgGbHAZR4HBO3JCdOPUAqv+5lVsSl9yRKa3tB UkM9e4/1wvrWvUzTRD73fcLgIjlNsCO/YRESj4frZPZNSLpiZVLRb0cdmZiu7naNO+wj oIWhbKPbwK20OWGdUhn6Q/NK47QK3rvBrM7YmRb+iSLt+Q0zyQl9WLTCrROk+Txz0QS9 tRZf9d7aor2mVGMrMuZ7pGyj0v7JeGg6++1zxIMKFFxoBjC/n8/cYDv6dz0hFvcUv7Xw 8QnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bTlBGAMsoibccerBDTk1NrMAJA9xbzeII4D+Q0cXlRU=; b=RxSoyO9msA1VBBXzyzBRaUcrboAuRABsQZa3KDXh4NzkjXNr8i+/nzvXTvdr/bGOuE Fb79vaXla/EQWMIwSdoJdA3uaJNhh8wiJlTVw9TVw0VK/OdHIT9m6TP0M9jkAHTVNmb5 hD07GvjLARKKEKHIRKoob2copm/YudQmiMv3Ja/jkP95VXMueyYSzzJU/iC0mtpfsLBH a6Cz6hJo3M8SQF8cuvCp6E6xRWcIWcC7VC5qMLw0wnNpzlQWjXOld/buXgISWgAwskwo IL9EYDhUAI6Fri87BaPjRgEThWtmiSwo0eDaOPdqWt1ot0kQqmh2dp+BR+Y9bBqjwNyP T3PA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si5301153eds.290.2021.08.30.07.12.19; Mon, 30 Aug 2021 07:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237024AbhH3OL0 (ORCPT + 99 others); Mon, 30 Aug 2021 10:11:26 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:15232 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236970AbhH3OLS (ORCPT ); Mon, 30 Aug 2021 10:11:18 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Gysdf3Pk2z1DF7l; Mon, 30 Aug 2021 22:09:42 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Mon, 30 Aug 2021 22:10:21 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH 2/6] mm/page_alloc.c: simplify the code by using macro K() Date: Mon, 30 Aug 2021 22:10:47 +0800 Message-ID: <20210830141051.64090-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210830141051.64090-1-linmiaohe@huawei.com> References: <20210830141051.64090-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use helper macro K() to convert the pages to the corresponding size. Minor readability improvement. Signed-off-by: Miaohe Lin --- mm/page_alloc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index dbb3338d9287..d3983244f56f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8134,8 +8134,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char } 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; } @@ -8180,14 +8179,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 ); } -- 2.23.0