From nobody Mon Apr 6 15:45:13 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A96DEECAAA1 for ; Tue, 6 Sep 2022 07:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238690AbiIFH4o (ORCPT ); Tue, 6 Sep 2022 03:56:44 -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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 @@ =20 #include #include +#include #include =20 static const int rodata_test_data =3D 0xC3; =20 void rodata_test(void) { - unsigned long start, end; int zero =3D 0; =20 /* test 1: read the value */ @@ -39,13 +39,11 @@ void rodata_test(void) } =20 /* test 4: check if the rodata section is PAGE_SIZE aligned */ - start =3D (unsigned long)__start_rodata; - end =3D (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; } --=20 2.17.1