All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Child <nnac123@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nick Child <nick.child@ibm.com>, dja@axtens.net
Subject: [PATCH v2 10/20] powerpc/powermac: Add __init attribute to eligible functions
Date: Thu, 16 Dec 2021 17:00:25 -0500	[thread overview]
Message-ID: <20211216220035.605465-11-nick.child@ibm.com> (raw)
In-Reply-To: <20211216220035.605465-1-nick.child@ibm.com>

Some functions defined in 'arch/powerpc/platforms/powermac` are only
called by other initialization functions and therefore should inherit
the attribute.
Also, change function declarations in header files to include `__init`.

Signed-off-by: Nick Child <nick.child@ibm.com>
---
 arch/powerpc/include/asm/smu.h               | 2 +-
 arch/powerpc/include/asm/udbg.h              | 2 +-
 arch/powerpc/platforms/powermac/feature.c    | 2 +-
 arch/powerpc/platforms/powermac/nvram.c      | 2 +-
 arch/powerpc/platforms/powermac/pfunc_base.c | 6 +++---
 arch/powerpc/platforms/powermac/setup.c      | 2 +-
 arch/powerpc/platforms/powermac/smp.c        | 4 ++--
 arch/powerpc/platforms/powermac/udbg_scc.c   | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/include/asm/smu.h b/arch/powerpc/include/asm/smu.h
index 4b30a0205c93..2ac6ab903023 100644
--- a/arch/powerpc/include/asm/smu.h
+++ b/arch/powerpc/include/asm/smu.h
@@ -456,7 +456,7 @@ extern void smu_poll(void);
 /*
  * Init routine, presence check....
  */
-extern int smu_init(void);
+int __init smu_init(void);
 extern int smu_present(void);
 struct platform_device;
 extern struct platform_device *smu_get_ofdev(void);
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
index 5aec53f2dae0..b4aa0d88ce2c 100644
--- a/arch/powerpc/include/asm/udbg.h
+++ b/arch/powerpc/include/asm/udbg.h
@@ -30,7 +30,7 @@ void __init udbg_uart_setup(unsigned int speed, unsigned int clock);
 unsigned int __init udbg_probe_uart_speed(unsigned int clock);
 
 struct device_node;
-extern void udbg_scc_init(int force_scc);
+void __init udbg_scc_init(int force_scc);
 extern int udbg_adb_init(int force_btext);
 extern void udbg_adb_init_early(void);
 
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 5c77b9a24c0e..e67c624f35a2 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1530,7 +1530,7 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
  * This takes the second CPU off the bus on dual CPU machines
  * running UP
  */
-void g5_phy_disable_cpu1(void)
+void __init g5_phy_disable_cpu1(void)
 {
 	if (uninorth_maj == 3)
 		UN_OUT(U3_API_PHY_CONFIG_1, 0);
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index 853ccc4480e2..de8fcb607290 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -258,7 +258,7 @@ static u32 core99_calc_adler(u8 *buffer)
 	return (high << 16) | low;
 }
 
-static u32 core99_check(u8* datas)
+static u32 __init core99_check(u8 *datas)
 {
 	struct core99_header* hdr99 = (struct core99_header*)datas;
 
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index f5422506d4b0..9c2947a3edd5 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -93,7 +93,7 @@ static struct pmf_handlers macio_gpio_handlers = {
 	.delay		= macio_do_delay,
 };
 
-static void macio_gpio_init_one(struct macio_chip *macio)
+static void __init macio_gpio_init_one(struct macio_chip *macio)
 {
 	struct device_node *gparent, *gp;
 
@@ -265,7 +265,7 @@ static struct pmf_handlers macio_mmio_handlers = {
 	.delay			= macio_do_delay,
 };
 
-static void macio_mmio_init_one(struct macio_chip *macio)
+static void __init macio_mmio_init_one(struct macio_chip *macio)
 {
 	DBG("Installing MMIO functions for macio %pOF\n",
 	    macio->of_node);
@@ -294,7 +294,7 @@ static struct pmf_handlers unin_mmio_handlers = {
 	.delay			= macio_do_delay,
 };
 
-static void uninorth_install_pfunc(void)
+static void __init uninorth_install_pfunc(void)
 {
 	struct device_node *np;
 
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 13e8a8a9841c..f7661b81db18 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -194,7 +194,7 @@ int find_via_pmu(void)
 #endif
 
 #ifndef CONFIG_PMAC_SMU
-int smu_init(void)
+int __init smu_init(void)
 {
 	/* should check and warn if SMU is present */
 	return 0;
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 3256a316e884..da1efdc30d6c 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -186,7 +186,7 @@ static const struct irq_domain_ops psurge_host_ops = {
 	.map	= psurge_host_map,
 };
 
-static int psurge_secondary_ipi_init(void)
+static int __init psurge_secondary_ipi_init(void)
 {
 	int rc = -ENOMEM;
 
@@ -875,7 +875,7 @@ static int smp_core99_cpu_online(unsigned int cpu)
 
 static void __init smp_core99_bringup_done(void)
 {
-	extern void g5_phy_disable_cpu1(void);
+	extern void __init g5_phy_disable_cpu1(void);
 
 	/* Close i2c bus if it was used for tb sync */
 	if (pmac_tb_clock_chip_host)
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c
index f286bdfe8346..965827ac2e9c 100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
@@ -62,7 +62,7 @@ static unsigned char scc_inittab[] = {
     3,  0xc1,		/* rx enable, 8 bits */
 };
 
-void udbg_scc_init(int force_scc)
+void __init udbg_scc_init(int force_scc)
 {
 	const u32 *reg;
 	unsigned long addr;
-- 
2.25.1


  parent reply	other threads:[~2021-12-16 22:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 22:00 [PATCH v2 00/20] powerpc: Define eligible functions as __init Nick Child
2021-12-16 22:00 ` [PATCH v2 01/20] powerpc/kernel: Add __init attribute to eligible functions Nick Child
2021-12-16 22:00 ` [PATCH v2 02/20] powerpc/lib: " Nick Child
2021-12-16 22:00 ` [PATCH v2 03/20] powerpc/mm: " Nick Child
2021-12-16 22:00 ` [PATCH v2 04/20] powerpc/perf: " Nick Child
2021-12-16 22:00 ` [PATCH v2 05/20] powerpc/sysdev: " Nick Child
2021-12-16 22:00 ` [PATCH v2 06/20] powerpc/xmon: " Nick Child
2021-12-16 22:00 ` [PATCH v2 07/20] powerpc/cell: " Nick Child
2021-12-16 22:00 ` [PATCH v2 08/20] powerpc/chrp: " Nick Child
2021-12-16 22:00 ` [PATCH v2 09/20] powerpc/pasemi: " Nick Child
2021-12-16 22:00 ` Nick Child [this message]
2021-12-16 22:00 ` [PATCH v2 11/20] powerpc/powernv: " Nick Child
2021-12-16 22:00 ` [PATCH v2 12/20] powerpc/pseries: " Nick Child
2021-12-16 22:00 ` [PATCH v2 13/20] powerpc/ps3: " Nick Child
2021-12-16 22:00 ` [PATCH v2 14/20] powerpc/4xx: " Nick Child
2021-12-16 22:00 ` [PATCH v2 15/20] powerpc/44x: " Nick Child
2021-12-16 22:00 ` [PATCH v2 16/20] powerpc/embedded6xx: " Nick Child
2021-12-16 22:00 ` [PATCH v2 17/20] powerpc/83xx: " Nick Child
2021-12-16 22:00 ` [PATCH v2 18/20] powerpc/85xx: " Nick Child
2021-12-16 22:00 ` [PATCH v2 19/20] powerpc/512x: " Nick Child
2021-12-16 22:00 ` [PATCH v2 20/20] cuda/pmu: Make find_via_cuda/pmu init functions Nick Child
2021-12-17  6:29 ` [PATCH v2 00/20] powerpc: Define eligible functions as __init Christophe Leroy
2021-12-23 11:44   ` Michael Ellerman
2021-12-26 21:52 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216220035.605465-11-nick.child@ibm.com \
    --to=nnac123@gmail.com \
    --cc=dja@axtens.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nick.child@ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.