LinuxPPC-Dev Archive on 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 17/20] powerpc/83xx: Add __init attribute to eligible functions
Date: Wed, 15 Dec 2021 11:12:40 -0500	[thread overview]
Message-ID: <20211215161243.16396-18-nick.child@ibm.com> (raw)
In-Reply-To: <20211215161243.16396-1-nick.child@ibm.com>

Some functions defined in 'arch/powerpc/platforms/83xx' are deserving of an
`__init` macro attribute. These functions 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/platforms/83xx/km83xx.c      | 2 +-
 arch/powerpc/platforms/83xx/mpc834x_mds.c | 2 +-
 arch/powerpc/platforms/83xx/mpc837x_mds.c | 2 +-
 arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 +-
 arch/powerpc/platforms/83xx/mpc83xx.h     | 6 +++---
 arch/powerpc/platforms/83xx/usb.c         | 6 +++---
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 108e1e4d2683..d9eed0decb28 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -39,7 +39,7 @@
 
 #define SVR_REV(svr)    (((svr) >>  0) & 0xFFFF) /* Revision field */
 
-static void quirk_mpc8360e_qe_enet10(void)
+static void __init quirk_mpc8360e_qe_enet10(void)
 {
 	/*
 	 * handle mpc8360E Erratum QE_ENET10:
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 6d91bdce0a18..0713deffb40c 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -35,7 +35,7 @@
 #include "mpc83xx.h"
 
 #define BCSR5_INT_USB		0x02
-static int mpc834xemds_usb_cfg(void)
+static int __init mpc834xemds_usb_cfg(void)
 {
 	struct device_node *np;
 	void __iomem *bcsr_regs = NULL;
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index f28d166ea7db..fc88ab97f6e3 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -23,7 +23,7 @@
 #define BCSR12_USB_SER_PIN	0x80
 #define BCSR12_USB_SER_DEVICE	0x02
 
-static int mpc837xmds_usb_cfg(void)
+static int __init mpc837xmds_usb_cfg(void)
 {
 	struct device_node *np;
 	const void *phy_type, *mode;
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 7fb7684c256b..5d48c6842098 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -18,7 +18,7 @@
 
 #include "mpc83xx.h"
 
-static void mpc837x_rdb_sd_cfg(void)
+static void __init mpc837x_rdb_sd_cfg(void)
 {
 	void __iomem *im;
 
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index a30d30588cf6..06ca2687b974 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -68,9 +68,9 @@
 
 extern void __noreturn mpc83xx_restart(char *cmd);
 extern long mpc83xx_time_init(void);
-extern int mpc837x_usb_cfg(void);
-extern int mpc834x_usb_cfg(void);
-extern int mpc831x_usb_cfg(void);
+extern int mpc837x_usb_cfg(void) __init;
+extern int mpc834x_usb_cfg(void) __init;
+extern int mpc831x_usb_cfg(void) __init;
 extern void mpc83xx_ipic_init_IRQ(void);
 
 #ifdef CONFIG_PCI
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 3d247d726ed5..b0bda20aaccf 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -20,7 +20,7 @@
 
 
 #ifdef CONFIG_PPC_MPC834x
-int mpc834x_usb_cfg(void)
+int __init mpc834x_usb_cfg(void)
 {
 	unsigned long sccr, sicrl, sicrh;
 	void __iomem *immap;
@@ -96,7 +96,7 @@ int mpc834x_usb_cfg(void)
 #endif /* CONFIG_PPC_MPC834x */
 
 #ifdef CONFIG_PPC_MPC831x
-int mpc831x_usb_cfg(void)
+int __init mpc831x_usb_cfg(void)
 {
 	u32 temp;
 	void __iomem *immap, *usb_regs;
@@ -209,7 +209,7 @@ int mpc831x_usb_cfg(void)
 #endif /* CONFIG_PPC_MPC831x */
 
 #ifdef CONFIG_PPC_MPC837x
-int mpc837x_usb_cfg(void)
+int __init mpc837x_usb_cfg(void)
 {
 	void __iomem *immap;
 	struct device_node *np = NULL;
-- 
2.25.1


  parent reply	other threads:[~2021-12-16  8:21 UTC|newest]

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

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=20211215161243.16396-18-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox