Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4069230rwb; Tue, 6 Sep 2022 01:53:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BY8UWr2+O+Zsruyo7+dPcN61ECbdBBdb79BlhfeLhNNPrpw0fsr4EvPUfTBlVnH+pnbzj X-Received: by 2002:a17:906:9b89:b0:73d:6a55:c489 with SMTP id dd9-20020a1709069b8900b0073d6a55c489mr39217226ejc.406.1662454434101; Tue, 06 Sep 2022 01:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662454434; cv=none; d=google.com; s=arc-20160816; b=K1EAd9uxCN6eMFsBOZSngJNDg5LiQPDz+ERitnvAQ8AkEMaAGtexrZ55IkFINkOetH Rg74G+Nb9n3AlMJ4FmJgYR7TA0bQtgwcSROzn+d0O5J0NLUdc17Ulj9C89Q+Gnus/QXJ 0apCM5CT+OAexOGykuOTrfQgeVqy13wLFkzb3rKYJ97Z9XjNPfSbd9mwkWAiwM05wNMQ TndL8vAdYUqoyy7Xsx1+tzI4sh8Ui+YKT+auMw0gBN9uAcqnuDDsgvtHLhOoncJN4Lef zkuH2ode/DuTAFWH1gAuEFxLmsSKK29oJ5WKJtsvQr1mLc9pFEeJFwxVFu2cvfm9PUwR FDNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=Jp5IsISywbMo4Q9CaGlb+os0kNENydXAxSe1ObTrr54=; b=bz9nn72S4Z7o8sgAf/PvHDX0CTaDmHNnPYR7AvWkEMQuHmL1GA8ommWCnjC7blTVwE IO8emEXeMCTFuX//RPh5qUE+ACqlPKkL5bT5vZF1X+lxIVtMDqNN5diwATlc09TnDCxc 9zEZ11PjqnWnqjgy70qLTnAZAaPChJ+ez637OR3OIrj5+uQchCO5QdPkZ5n1bwb4tJG9 iEtNtJWxOtmDL2CWiMlPT/bMetOE9jNt8Nx0OfcFIiGpVvQ7ZaZi/fIudVxtWPRG8dDw WanSRRw7gGYdh/rcly7nNnNqebNIVIVkYnrOTJ/HazW0psSoy8DI5Zs5nqrhfNpeXFC9 ksIQ== 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 r6-20020a50d686000000b00447b4fdc29fsi9913656edi.82.2022.09.06.01.53.28; Tue, 06 Sep 2022 01:53:54 -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 S238810AbiIFH4n (ORCPT + 99 others); Tue, 6 Sep 2022 03:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238646AbiIFH4l (ORCPT ); Tue, 6 Sep 2022 03:56:41 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38E426C766 for ; Tue, 6 Sep 2022 00:56:39 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MMHfJ2dTVzZcl3; Tue, 6 Sep 2022 15:52:08 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 6 Sep 2022 15:56:37 +0800 From: Xiu Jianfeng To: CC: , Subject: [PATCH -next] mm/rodata_test: use PAGE_ALIGNED() helper Date: Tue, 6 Sep 2022 15:53:12 +0800 Message-ID: <20220906075312.166595-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 Use PAGE_ALIGNED() helper instead of open-coding operation, no functional changes here. Signed-off-by: Xiu Jianfeng --- mm/rodata_test.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/rodata_test.c b/mm/rodata_test.c index 2613371945b7..6d783436951f 100644 --- a/mm/rodata_test.c +++ b/mm/rodata_test.c @@ -9,13 +9,13 @@ #include #include +#include #include static const int rodata_test_data = 0xC3; void rodata_test(void) { - unsigned long start, end; int zero = 0; /* test 1: read the value */ @@ -39,13 +39,11 @@ void rodata_test(void) } /* test 4: check if the rodata section is PAGE_SIZE aligned */ - start = (unsigned long)__start_rodata; - end = (unsigned long)__end_rodata; - if (start & (PAGE_SIZE - 1)) { + if (!PAGE_ALIGNED(__start_rodata)) { pr_err("start of .rodata is not page size aligned\n"); return; } - if (end & (PAGE_SIZE - 1)) { + if (!PAGE_ALIGNED(__end_rodata)) { pr_err("end of .rodata is not page size aligned\n"); return; } -- 2.17.1