Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1797586pxv; Sat, 26 Jun 2021 00:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBsHkzYa87VK0l+3xlbO7pAY04oug2AHqq45zSkJaivoe2bjYTgzp+hvw1r+VOL8A29inK X-Received: by 2002:a05:6402:5114:: with SMTP id m20mr415624edd.174.1624692556328; Sat, 26 Jun 2021 00:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624692556; cv=none; d=google.com; s=arc-20160816; b=oJWgZvfabiPI2yS/vDB3XJX42Bwga94u2iqaM9Udgz8xgMRnNDdwCKnmCRbliK50xO rfD1zEFvt+STlc3ZcQq7n+26l+UXuSxbwwAGao37eyoF0hg67vWNkHRSDxnMxhmqFsfd 64gd0crnSHpzH1UCt+Kph0NwD67o6NYZdEaupGXIRpFF2dl6gEvG3b6w6ZR3kJz84DRv EM0NZ6DSjJtpz4ZbrlfRlytpAhmtyvHukkKuSTLfDQAbDlvZDQNVsY+XprRz/qf6MAdN ecbxtuONKhz1kG1yWFCWmNNWjM9yyQh5YyvDEzIYGZ7QkJkExu2iEIbt7Tad4ht5yMUE 3OrQ== 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=Rf2lTvTWgzRvO7Mnwp3kgQXEhUzRnolQefFGUOndpws=; b=q2xaGtokm7FVrpotyAIvUwcl4QX/zalwMnG9eXv9StwfeyCbd/I1nAcWogE6+sV7K1 TLZWOYlwdhmeVllWFuP4wYFpmRkNEA6zR8Hr8VrZCMQDMkTay5UxxLQwFDqmumCnWs7r HRt4HKWUM56NgJwcW3/ala8pR6eGCAy9D2fSyjUJD4JDAbAeL8SzCsHAgWXD54TcjOYr sg7D2VI/eB6S8HlU7ZgQGYf0hjxvBnWvro8Uxzq5EZIrUq78zdzJ/jmCmDQdQyhHxSAf uK4W8kwDsg8rfGyXv7vSlk82i6jCoGSaI0VCpjq602EuVOgVbV0sbRWbp+5Z2KM/Gd90 iCIw== 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 hh4si8784659ejb.79.2021.06.26.00.28.53; Sat, 26 Jun 2021 00:29:16 -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 S230135AbhFZH3n (ORCPT + 99 others); Sat, 26 Jun 2021 03:29:43 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5434 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhFZH3Z (ORCPT ); Sat, 26 Jun 2021 03:29:25 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GBljC6Wc4z74VK; Sat, 26 Jun 2021 15:23:43 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 15:27:01 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 15:27:01 +0800 From: Kefeng Wang To: Arnd Bergmann , , CC: Kefeng Wang , Michael Ellerman , Benjamin Herrenschmidt , "Paul Mackerras" , Subject: [PATCH 8/9] powerpc/mm: Use is_kernel_text() and is_kernel_inittext() helper Date: Sat, 26 Jun 2021 15:34:38 +0800 Message-ID: <20210626073439.150586-9-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210626073439.150586-1-wangkefeng.wang@huawei.com> References: <20210626073439.150586-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use is_kernel_text() and is_kernel_inittext() helper to simplify code, also drop etext, _stext, _sinittext, _einittext declaration which already declared in section.h. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Kefeng Wang --- arch/powerpc/mm/pgtable_32.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index dcf5ecca19d9..13c798308c2e 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c @@ -33,8 +33,6 @@ #include -extern char etext[], _stext[], _sinittext[], _einittext[]; - static u8 early_fixmap_pagetable[FIXMAP_PTE_SIZE] __page_aligned_data; notrace void __init early_ioremap_init(void) @@ -104,14 +102,13 @@ static void __init __mapin_ram_chunk(unsigned long offset, unsigned long top) { unsigned long v, s; phys_addr_t p; - int ktext; + bool ktext; s = offset; v = PAGE_OFFSET + s; p = memstart_addr + s; for (; s < top; s += PAGE_SIZE) { - ktext = ((char *)v >= _stext && (char *)v < etext) || - ((char *)v >= _sinittext && (char *)v < _einittext); + ktext = (is_kernel_text(v) || is_kernel_inittext(v)); map_kernel_page(v, p, ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL); v += PAGE_SIZE; p += PAGE_SIZE; -- 2.26.2