From patchwork Thu Jan 31 02:53:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 157105 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6683738jaa; Wed, 30 Jan 2019 18:55:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN6mRbRyN0E70TqrLYFxkDguPuMoWSuUkUukfOaGaqPBG+EZ3AxTlQf9NFbPGz1KQjxONvh5 X-Received: by 2002:a63:6bc1:: with SMTP id g184mr30523711pgc.25.1548903330426; Wed, 30 Jan 2019 18:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548903330; cv=none; d=google.com; s=arc-20160816; b=XJjKe4t3pVfbL5cduqWt1MgvV57ZbZDaGsipA5CQ12HANgGmZIaNCR+q1ZvPhmiTe+ IbhFJvH9vDz1cOcFOZIKJJAx5412NpZWNzFF/aFl0lNTQjUsVEx3Obgx1mYwS71QiD5A HMUpMpX9PN3bGNq7wpvqrAQTz2dNatQjRljI5MCJVb76IU0iQFXUWqs5w20es8D0A4ZX ePtK+Dphh+H5W1yz0lU25/SlFqVirVedG72s2W765nkXM0BJWOV0M2jvgj4CP6IAXXfZ mmwTIP5HLlhxivesYWnnsMIWY3Tp3/cl9n6+Tp1pnWh+STh/YikTDqo56APt4lyNFWoQ 1ftg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=5uoBhSU0NECHQSXDysma0LK2UEd1UzpFB2egb+QJU5s=; b=FCSMDeqTQJzcz8B2yX554aX27MGqUgJclUttUkIZ8BwNpflp1TzLTyvIaacCCvmKBW 4GO1w3aZ3f1x0nkyw6X98CJezow9xRjJAyWsX1IW24B2ZQsPKjYJONdx9/PP9hhsbPeZ KUK9d3qbuJIEYizUpAF1xyY4844nRfBFw72WjKH6ClgoqLJFPySGpAmzT1yZSOLP9jIZ KwMlnvwAOQRLK5hQ7Zyot7eFfcqM8ZtNJg6IT/Rjvp6AGNtqcwp2KuaMfByFQbIGHSpt FNB8Q8jOLP9JOHLO6jYQ+Quxz3jRGCEWeP3z+Y19efnNp2a9swdBBoGSSt5fHBt0+s0e 84Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="KS/klICh"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10si3263583pls.76.2019.01.30.18.55.30; Wed, 30 Jan 2019 18:55:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="KS/klICh"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729975AbfAaCz2 (ORCPT + 31 others); Wed, 30 Jan 2019 21:55:28 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:25977 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfAaCz1 (ORCPT ); Wed, 30 Jan 2019 21:55:27 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x0V2rd64008650; Thu, 31 Jan 2019 11:53:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x0V2rd64008650 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1548903220; bh=5uoBhSU0NECHQSXDysma0LK2UEd1UzpFB2egb+QJU5s=; h=From:To:Cc:Subject:Date:From; b=KS/klIChkS3UtvxOk79uttMt3fcMy/mNvVZ8b50mZzyRGsikVuE0pN2ToUb1b0Pnl zdIGr0hSikUsUjWPWNjiUK8BacOmmfA1Zd2ez4gKqpIgAiRF/TH0J+NekAV3qSAAE9 PnXGVyCwm+mM8Qo0zRcwnIxljPIqHc54g9lSxBaE2ydIvcxjxwSEJNUsNnz1cCOdAS Fr9oERmof9ijbOsqR2zVs6dPPTP8koXPfkZJlB1IGaCMBFK0lV+j35jdOLNv8rbYud liI/K5sreO0MKOStd8bJv9H7We39Rtd0Y8WmSR77+GeJoYQhJCAocP/FTXG9AQ8S+P K6b8Fxs8s+FWQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman Cc: Masahiro Yamada , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Paul Mackerras , Mathieu Malaterre , "Aneesh Kumar K.V" Subject: [PATCH] powerpc/prom_init: add __init markers to all functions Date: Thu, 31 Jan 2019 11:53:19 +0900 Message-Id: <1548903199-32695-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is fragile to rely on the compiler's optimization to avoid the section mismatch. Some functions may not be necessarily inlined when the compiler's inlining heuristic changes. Add __init markers consistently. As for prom_getprop() and prom_getproplen(), they are marked as 'inline', so inlining is guaranteed because PowerPC never enables CONFIG_OPTIMIZE_INLINING. However, it would be better to leave the inlining decision to the compiler. I replaced 'inline' with __init. Signed-off-by: Masahiro Yamada --- arch/powerpc/kernel/prom_init.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index f33ff41..85b0719 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -501,19 +501,19 @@ static int __init prom_next_node(phandle *nodep) } } -static inline int prom_getprop(phandle node, const char *pname, +static int __init prom_getprop(phandle node, const char *pname, void *value, size_t valuelen) { return call_prom("getprop", 4, 1, node, ADDR(pname), (u32)(unsigned long) value, (u32) valuelen); } -static inline int prom_getproplen(phandle node, const char *pname) +static int __init prom_getproplen(phandle node, const char *pname) { return call_prom("getproplen", 2, 1, node, ADDR(pname)); } -static void add_string(char **str, const char *q) +static void __init add_string(char **str, const char *q) { char *p = *str; @@ -523,7 +523,7 @@ static void add_string(char **str, const char *q) *str = p; } -static char *tohex(unsigned int x) +static char __init *tohex(unsigned int x) { static const char digits[] __initconst = "0123456789abcdef"; static char result[9] __prombss; @@ -570,7 +570,7 @@ static int __init prom_setprop(phandle node, const char *nodename, #define islower(c) ('a' <= (c) && (c) <= 'z') #define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c)) -static unsigned long prom_strtoul(const char *cp, const char **endp) +static unsigned long __init prom_strtoul(const char *cp, const char **endp) { unsigned long result = 0, base = 10, value; @@ -595,7 +595,7 @@ static unsigned long prom_strtoul(const char *cp, const char **endp) return result; } -static unsigned long prom_memparse(const char *ptr, const char **retptr) +static unsigned long __init prom_memparse(const char *ptr, const char **retptr) { unsigned long ret = prom_strtoul(ptr, retptr); int shift = 0; @@ -2924,7 +2924,7 @@ static void __init fixup_device_tree_pasemi(void) prom_setprop(iob, name, "device_type", "isa", sizeof("isa")); } #else /* !CONFIG_PPC_PASEMI_NEMO */ -static inline void fixup_device_tree_pasemi(void) { } +static inline void __init fixup_device_tree_pasemi(void) { } #endif static void __init fixup_device_tree(void) @@ -2986,15 +2986,15 @@ static void __init prom_check_initrd(unsigned long r3, unsigned long r4) #ifdef CONFIG_PPC64 #ifdef CONFIG_RELOCATABLE -static void reloc_toc(void) +static void __init reloc_toc(void) { } -static void unreloc_toc(void) +static void __init unreloc_toc(void) { } #else -static void __reloc_toc(unsigned long offset, unsigned long nr_entries) +static void __init __reloc_toc(unsigned long offset, unsigned long nr_entries) { unsigned long i; unsigned long *toc_entry; @@ -3008,7 +3008,7 @@ static void __reloc_toc(unsigned long offset, unsigned long nr_entries) } } -static void reloc_toc(void) +static void __init reloc_toc(void) { unsigned long offset = reloc_offset(); unsigned long nr_entries = @@ -3019,7 +3019,7 @@ static void reloc_toc(void) mb(); } -static void unreloc_toc(void) +static void __init unreloc_toc(void) { unsigned long offset = reloc_offset(); unsigned long nr_entries =