Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1741061rwb; Wed, 26 Jul 2023 18:22:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlF3qT5jLZ3YqyAPHYOIyU2qzpCmthrq7P8j29wkS6GXBX95lbWFlri6ICA3jCURi39cYwsj X-Received: by 2002:a05:6a20:6a04:b0:134:d4d3:f09a with SMTP id p4-20020a056a206a0400b00134d4d3f09amr4834777pzk.58.1690420921101; Wed, 26 Jul 2023 18:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690420921; cv=none; d=google.com; s=arc-20160816; b=rJZUDSXVoIiM+A2eo6fCYA2Rsk9I3DH3h4DgC5UJgl3MKDiJZfyha2d6PSQoBDWshT uw3EVHGXNm8nzU5TMI67NkvT5/DWirNF0IarYpd35UheAyuLjyrteJA0clqIrGaeQprk PnHvrlIYCoejdkma3rAjmXthNxkqAEYT5ykJWrUf/mQMnQXzG8O7QXJD6PIDHeh1BsJ9 ZA8RN9XvNKnIT4B3HeLU33A8/g+xBz+GoInmtQ2+VKsskBULh/pDcdusijC/xIPvAgX8 NfwpltgGTolVLCDhZA7lyTPw6XycNJnRFipkVHyqPgeKYVdqdFhfzcUBtrBcpNT93zwB /3/A== 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=wdDnXuOYCY6a9cM1iZrK6XAJpPM+qYFvR+jg6Bi7Xzc=; fh=v9wYe9VT0TbAN61FdyevhEThUjofuva2Dd+9j50U/es=; b=zxat1AwRX5LF3dz1tjlfnWR9pxM76BKWCOK7+Dn/IxkSZIjIQ2Vd4o5jmjnY/6f6o2 0NzmgQsraLqsYv/hq0vnSfOTO09x7D/zKTqT/IAnN62NISRrlkhZGiaUNKL8no54wtuG CVGdgXr+s3jslajKzxluqzGlknb6SPtDjjkEH//TMaq0RlysANtSKF1/vZXmMlX1PAIt jvbfMsHx8H/dH2hPAn+0Oo6avr0/flO/983oM9hhf85tSbYaL8UnAMCBbo2iZz6CE7AE XoUExK+APUDjAJIJ5sg0ENbAnnz0ApPYat4MOrL7xiv2swKTttpMHFrEjw70InKgZ5Rv UqcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a056a00168800b0068632b6bc90si373944pfc.114.2023.07.26.18.21.48; Wed, 26 Jul 2023 18:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbjG0BQa (ORCPT + 99 others); Wed, 26 Jul 2023 21:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231293AbjG0BQX (ORCPT ); Wed, 26 Jul 2023 21:16:23 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A7C2709 for ; Wed, 26 Jul 2023 18:16:23 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RBCSL0RfCztRjs; Thu, 27 Jul 2023 09:13:06 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 27 Jul 2023 09:16:20 +0800 From: Peng Zhang To: , CC: , , , , , , , ZhangPeng Subject: [PATCH 3/3] mm: kmsan: use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN Date: Thu, 27 Jul 2023 09:16:12 +0800 Message-ID: <20230727011612.2721843-4-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230727011612.2721843-1-zhangpeng362@huawei.com> References: <20230727011612.2721843-1-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: ZhangPeng Use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN to improve code readability. No functional modification involved. Signed-off-by: ZhangPeng --- mm/kmsan/shadow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index 966994268a01..87318f9170f1 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -281,8 +281,8 @@ void __init kmsan_init_alloc_meta_for_range(void *start, void *end) struct page *page; u64 size; - start = (void *)ALIGN_DOWN((u64)start, PAGE_SIZE); - size = ALIGN((u64)end - (u64)start, PAGE_SIZE); + start = (void *)PAGE_ALIGN_DOWN((u64)start); + size = PAGE_ALIGN((u64)end - (u64)start); shadow = memblock_alloc(size, PAGE_SIZE); origin = memblock_alloc(size, PAGE_SIZE); for (u64 addr = 0; addr < size; addr += PAGE_SIZE) { -- 2.25.1