Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1740828rwb; Wed, 26 Jul 2023 18:21:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIleoZC2qUNkdsr0/uTkF4+1OflnAeCatD6lkIvuNsTEqThJ0djI/IPAyYQnOjDYNHRXQc X-Received: by 2002:a17:902:ecd1:b0:1b9:e091:8037 with SMTP id a17-20020a170902ecd100b001b9e0918037mr3965375plh.30.1690420899535; Wed, 26 Jul 2023 18:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690420899; cv=none; d=google.com; s=arc-20160816; b=oxw6YbRBz7oZhewzGSy5XW49TMVNFO41NHOxP4f7PFULTM6ISwX/uFfEFYBdWrJYYV SqeukhGqwKsa7yIDV7vm7aTsUt+M6ay84QuB0EMxfkfyab/MW7E4cooqIuuw+fTw1UzN ESJSX7aa4m8jthFJNbfjQVhTpoZjxTYlpAChCRLWra44oQ7JVXw/G05XhVAAMH/e5L3W GyaDEY+53grpGSXs3/WbX5r+QmkY2BlX8PZN/vesTrSsoYrRAsdiYjQwOpSDfYyiVCjc dNDVjVmDuSWYBDZCetLTb6slyWesyX/RA5fXzdKVtp51n1+9m6j+mQQjbek4optbeUFi mJjQ== 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=Qr170MEKVVrnU+3V9UPTmGiI7GCaB3XFhNvWhXebk90=; fh=v9wYe9VT0TbAN61FdyevhEThUjofuva2Dd+9j50U/es=; b=bRmolTnsC3VVqyd+eWkwspSSs1qU5RVt134OjxogW1RYInM+m7DoZugZ47Qc/uMJv5 i6Cmt6suTxbfVK6Wpwq1yr5uF8zMIe99kxH8DAVv8aWYz2txfBIoxMT+xeJdz4o9brSO ZhDH235AlXRQdfIMmm6vHF9DisCt4zCjH5wGPFLkDLpo/RcL5L/rthcl8vSGR7gMwVgt Cv5I4xofkWzlN+HN4jfGfNrUwnzD7IBNifaJb+xaTKsaKWphnaSf2kvQc/jneNAIiElu PfLfrKdLQq9+AX9DlTELzTI8y11tI+QcXUgQX5br3O3FbztEBJJq4byF/kyLlw9hFwWg Fa1Q== 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 ka15-20020a170903334f00b001b892a54da5si307576plb.37.2023.07.26.18.21.26; Wed, 26 Jul 2023 18:21:39 -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 S231295AbjG0BQZ (ORCPT + 99 others); Wed, 26 Jul 2023 21:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230072AbjG0BQW (ORCPT ); Wed, 26 Jul 2023 21:16:22 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A168C270D for ; Wed, 26 Jul 2023 18:16:21 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RBCS81PHgzNmcJ; Thu, 27 Jul 2023 09:12:56 +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:18 +0800 From: Peng Zhang To: , CC: , , , , , , , ZhangPeng Subject: [PATCH 1/3] mm: kmsan: use helper function page_size() Date: Thu, 27 Jul 2023 09:16:10 +0800 Message-ID: <20230727011612.2721843-2-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 function page_size() to improve code readability. No functional modification involved. Signed-off-by: ZhangPeng --- mm/kmsan/hooks.c | 2 +- mm/kmsan/shadow.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kmsan/hooks.c b/mm/kmsan/hooks.c index ec0da72e65aa..4e3c3e60ba97 100644 --- a/mm/kmsan/hooks.c +++ b/mm/kmsan/hooks.c @@ -117,7 +117,7 @@ void kmsan_kfree_large(const void *ptr) page = virt_to_head_page((void *)ptr); KMSAN_WARN_ON(ptr != page_address(page)); kmsan_internal_poison_memory((void *)ptr, - PAGE_SIZE << compound_order(page), + page_size(page), GFP_KERNEL, KMSAN_POISON_CHECK | KMSAN_POISON_FREE); kmsan_leave_runtime(); diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index b8bb95eea5e3..c7de991f6d7f 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -210,7 +210,7 @@ void kmsan_free_page(struct page *page, unsigned int order) return; kmsan_enter_runtime(); kmsan_internal_poison_memory(page_address(page), - PAGE_SIZE << compound_order(page), + page_size(page), GFP_KERNEL, KMSAN_POISON_CHECK | KMSAN_POISON_FREE); kmsan_leave_runtime(); -- 2.25.1