From patchwork Tue Aug 25 07:36:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7068961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CE0EC05AC for ; Tue, 25 Aug 2015 07:39:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84A5620890 for ; Tue, 25 Aug 2015 07:39:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB1412088F for ; Tue, 25 Aug 2015 07:39:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZU8nG-0005dZ-Pc; Tue, 25 Aug 2015 07:37:18 +0000 Received: from mail-pd0-x22e.google.com ([2607:f8b0:400e:c02::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZU8nE-0005an-MJ for linux-arm-kernel@lists.infradead.org; Tue, 25 Aug 2015 07:37:17 +0000 Received: by pdbmi9 with SMTP id mi9so63432571pdb.3 for ; Tue, 25 Aug 2015 00:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=xAj/uuMnEgQ50WNMU+M8OjkPTkc6aZzYxg0ScUp3Dms=; b=KjwAflHVNqt2dUWIhh1lmba7DiCOdIQQ0HP5wugyTLYAbfimDyWABGXkO0lExuVDvT b8/Npox4ghvN4pJKR/A52DzQJzGpP7bo+1ymPJw1cTuGFEYKe+FOhRgSV6GAEi4MISRu PlJFFlwkieHQDwUERoPUnIlZLvCbGcG1kb8+Uel6cKJlZAZAqkX2G/vzQcEPfu65NDH/ iVaBA4w3LAc6DmG8kkaDFnIRZJT4ifnUcIpumAis0tfFVjARu0W4PrVn8TH0I6s6SmNK 4z0pXkHfjSPMze6DU+xyzGxfwiAiUmHw9/ePtEs9gpwl6PUEFduD/HEksJGa50bdSA5E M+Xw== X-Received: by 10.70.47.232 with SMTP id g8mr53750132pdn.67.1440488215515; Tue, 25 Aug 2015 00:36:55 -0700 (PDT) Received: from ubuntu.localdomain ([17.87.20.100]) by smtp.googlemail.com with ESMTPSA id dh9sm5770846pdb.67.2015.08.25.00.36.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Aug 2015 00:36:54 -0700 (PDT) From: yalin wang To: linux@arm.linux.org.uk, nico@linaro.org, catalin.marinas@arm.com, keescook@chromium.org, yalin.wang2010@gmail.com, ard.biesheuvel@linaro.org, m.szyprowski@samsung.com, ggdavisiv@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC] arm: change some function and data to init section Date: Tue, 25 Aug 2015 15:36:13 +0800 Message-Id: <1440488173-28825-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150825_003716_761241_1F0EA528 X-CRM114-Status: GOOD ( 12.75 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch change some function and the related data to init section, they are only called by free_initmem(), can be freed safely after boot up. Signed-off-by: yalin wang Acked-by: Nicolas Pitre --- arch/arm/mm/init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8a63b4c..7b505de 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -577,7 +577,7 @@ struct section_perm { pmdval_t clear; }; -static struct section_perm nx_perms[] = { +static struct section_perm nx_perms[] __initdata = { /* Make pages tables, etc before _stext RW (set NX). */ { .start = PAGE_OFFSET, @@ -680,7 +680,7 @@ static inline bool arch_has_strict_perms(void) } \ } -static inline void fix_kernmem_perms(void) +static void __init fix_kernmem_perms(void) { set_section_perms(nx_perms, prot); } @@ -706,7 +706,7 @@ void set_kernel_text_ro(void) static inline void fix_kernmem_perms(void) { } #endif /* CONFIG_ARM_KERNMEM_PERMS */ -void free_tcmmem(void) +static void __init free_tcmmem(void) { #ifdef CONFIG_HAVE_TCM extern char __tcm_start, __tcm_end; @@ -716,7 +716,7 @@ void free_tcmmem(void) #endif } -void free_initmem(void) +void __init_refok free_initmem(void) { fix_kernmem_perms(); free_tcmmem(); @@ -728,9 +728,9 @@ void free_initmem(void) #ifdef CONFIG_BLK_DEV_INITRD -static int keep_initrd; +static int keep_initrd __initdata; -void free_initrd_mem(unsigned long start, unsigned long end) +void __init free_initrd_mem(unsigned long start, unsigned long end) { if (!keep_initrd) { if (start == initrd_start)