Commit f1ba9b94 authored by Nick Child's avatar Nick Child Committed by Michael Ellerman

powerpc/ps3: Add __init attribute to eligible functions

Some functions defined in 'arch/powerpc/platforms/ps3' 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: default avatarNick Child <nick.child@ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211216220035.605465-14-nick.child@ibm.com
parent e14ff96d
...@@ -113,7 +113,7 @@ static int unmap_dma_mem(int bus_id, int dev_id, u64 bus_addr, size_t len) ...@@ -113,7 +113,7 @@ static int unmap_dma_mem(int bus_id, int dev_id, u64 bus_addr, size_t len)
return lv1_free_device_dma_region(bus_id, dev_id, real_bus_addr); return lv1_free_device_dma_region(bus_id, dev_id, real_bus_addr);
} }
static void gelic_debug_init(void) static void __init gelic_debug_init(void)
{ {
s64 result; s64 result;
u64 v2; u64 v2;
......
...@@ -41,7 +41,7 @@ enum { ...@@ -41,7 +41,7 @@ enum {
PAGE_SHIFT_16M = 24U, PAGE_SHIFT_16M = 24U,
}; };
static unsigned long make_page_sizes(unsigned long a, unsigned long b) static unsigned long __init make_page_sizes(unsigned long a, unsigned long b)
{ {
return (a << 56) | (b << 48); return (a << 56) | (b << 48);
} }
...@@ -215,7 +215,7 @@ notrace void ps3_mm_vas_destroy(void) ...@@ -215,7 +215,7 @@ notrace void ps3_mm_vas_destroy(void)
} }
} }
static int ps3_mm_get_repository_highmem(struct mem_region *r) static int __init ps3_mm_get_repository_highmem(struct mem_region *r)
{ {
int result; int result;
......
...@@ -501,7 +501,7 @@ static int db_set_64(struct os_area_db *db, const struct os_area_db_id *id, ...@@ -501,7 +501,7 @@ static int db_set_64(struct os_area_db *db, const struct os_area_db_id *id,
return -1; return -1;
} }
static int db_get_64(const struct os_area_db *db, static int __init db_get_64(const struct os_area_db *db,
const struct os_area_db_id *id, uint64_t *value) const struct os_area_db_id *id, uint64_t *value)
{ {
struct db_iterator i; struct db_iterator i;
...@@ -517,7 +517,7 @@ static int db_get_64(const struct os_area_db *db, ...@@ -517,7 +517,7 @@ static int db_get_64(const struct os_area_db *db,
return -1; return -1;
} }
static int db_get_rtc_diff(const struct os_area_db *db, int64_t *rtc_diff) static int __init db_get_rtc_diff(const struct os_area_db *db, int64_t *rtc_diff)
{ {
return db_get_64(db, &os_area_db_id_rtc_diff, (uint64_t*)rtc_diff); return db_get_64(db, &os_area_db_id_rtc_diff, (uint64_t*)rtc_diff);
} }
......
...@@ -35,7 +35,7 @@ void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq); ...@@ -35,7 +35,7 @@ void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq);
/* smp */ /* smp */
void smp_init_ps3(void); void __init smp_init_ps3(void);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
void ps3_smp_cleanup_cpu(int cpu); void ps3_smp_cleanup_cpu(int cpu);
#else #else
...@@ -134,9 +134,9 @@ struct ps3_repository_device { ...@@ -134,9 +134,9 @@ struct ps3_repository_device {
int ps3_repository_find_device(struct ps3_repository_device *repo); int ps3_repository_find_device(struct ps3_repository_device *repo);
int ps3_repository_find_device_by_id(struct ps3_repository_device *repo, int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
u64 bus_id, u64 dev_id); u64 bus_id, u64 dev_id);
int ps3_repository_find_devices(enum ps3_bus_type bus_type, int __init ps3_repository_find_devices(enum ps3_bus_type bus_type,
int (*callback)(const struct ps3_repository_device *repo)); int (*callback)(const struct ps3_repository_device *repo));
int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from, int __init ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
unsigned int *bus_index); unsigned int *bus_index);
int ps3_repository_find_interrupt(const struct ps3_repository_device *repo, int ps3_repository_find_interrupt(const struct ps3_repository_device *repo,
enum ps3_interrupt_type intr_type, unsigned int *interrupt_id); enum ps3_interrupt_type intr_type, unsigned int *interrupt_id);
...@@ -211,8 +211,8 @@ static inline int ps3_repository_delete_highmem_info(unsigned int region_index) ...@@ -211,8 +211,8 @@ static inline int ps3_repository_delete_highmem_info(unsigned int region_index)
int ps3_repository_read_num_be(unsigned int *num_be); int ps3_repository_read_num_be(unsigned int *num_be);
int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id); int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
int ps3_repository_read_be_id(u64 node_id, u64 *be_id); int ps3_repository_read_be_id(u64 node_id, u64 *be_id);
int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq); int __init ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq); int __init ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
/* repository performance monitor info */ /* repository performance monitor info */
...@@ -247,7 +247,7 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index, ...@@ -247,7 +247,7 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index,
/* repository vuart info */ /* repository vuart info */
int ps3_repository_read_vuart_av_port(unsigned int *port); int __init ps3_repository_read_vuart_av_port(unsigned int *port);
int ps3_repository_read_vuart_sysmgr_port(unsigned int *port); int __init ps3_repository_read_vuart_sysmgr_port(unsigned int *port);
#endif #endif
...@@ -413,7 +413,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo, ...@@ -413,7 +413,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
return 0; return 0;
} }
int ps3_repository_find_devices(enum ps3_bus_type bus_type, int __init ps3_repository_find_devices(enum ps3_bus_type bus_type,
int (*callback)(const struct ps3_repository_device *repo)) int (*callback)(const struct ps3_repository_device *repo))
{ {
int result = 0; int result = 0;
...@@ -455,7 +455,7 @@ int ps3_repository_find_devices(enum ps3_bus_type bus_type, ...@@ -455,7 +455,7 @@ int ps3_repository_find_devices(enum ps3_bus_type bus_type,
return result; return result;
} }
int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from, int __init ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
unsigned int *bus_index) unsigned int *bus_index)
{ {
unsigned int i; unsigned int i;
...@@ -908,7 +908,7 @@ int ps3_repository_read_boot_dat_size(unsigned int *size) ...@@ -908,7 +908,7 @@ int ps3_repository_read_boot_dat_size(unsigned int *size)
return result; return result;
} }
int ps3_repository_read_vuart_av_port(unsigned int *port) int __init ps3_repository_read_vuart_av_port(unsigned int *port)
{ {
int result; int result;
u64 v1 = 0; u64 v1 = 0;
...@@ -923,7 +923,7 @@ int ps3_repository_read_vuart_av_port(unsigned int *port) ...@@ -923,7 +923,7 @@ int ps3_repository_read_vuart_av_port(unsigned int *port)
return result; return result;
} }
int ps3_repository_read_vuart_sysmgr_port(unsigned int *port) int __init ps3_repository_read_vuart_sysmgr_port(unsigned int *port)
{ {
int result; int result;
u64 v1 = 0; u64 v1 = 0;
...@@ -1005,7 +1005,7 @@ int ps3_repository_read_be_id(u64 node_id, u64 *be_id) ...@@ -1005,7 +1005,7 @@ int ps3_repository_read_be_id(u64 node_id, u64 *be_id)
be_id, NULL); be_id, NULL);
} }
int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq) int __init ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq)
{ {
return read_node(PS3_LPAR_ID_PME, return read_node(PS3_LPAR_ID_PME,
make_first_field("be", 0), make_first_field("be", 0),
...@@ -1015,7 +1015,7 @@ int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq) ...@@ -1015,7 +1015,7 @@ int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq)
tb_freq, NULL); tb_freq, NULL);
} }
int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq) int __init ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq)
{ {
int result; int result;
u64 node_id; u64 node_id;
...@@ -1178,7 +1178,7 @@ int ps3_repository_delete_highmem_info(unsigned int region_index) ...@@ -1178,7 +1178,7 @@ int ps3_repository_delete_highmem_info(unsigned int region_index)
#if defined(DEBUG) #if defined(DEBUG)
int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo) int __init ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
{ {
int result = 0; int result = 0;
unsigned int res_index; unsigned int res_index;
...@@ -1231,7 +1231,7 @@ int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo) ...@@ -1231,7 +1231,7 @@ int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
return result; return result;
} }
static int dump_stor_dev_info(struct ps3_repository_device *repo) static int __init dump_stor_dev_info(struct ps3_repository_device *repo)
{ {
int result = 0; int result = 0;
unsigned int num_regions, region_index; unsigned int num_regions, region_index;
...@@ -1279,7 +1279,7 @@ static int dump_stor_dev_info(struct ps3_repository_device *repo) ...@@ -1279,7 +1279,7 @@ static int dump_stor_dev_info(struct ps3_repository_device *repo)
return result; return result;
} }
static int dump_device_info(struct ps3_repository_device *repo, static int __init dump_device_info(struct ps3_repository_device *repo,
unsigned int num_dev) unsigned int num_dev)
{ {
int result = 0; int result = 0;
...@@ -1323,7 +1323,7 @@ static int dump_device_info(struct ps3_repository_device *repo, ...@@ -1323,7 +1323,7 @@ static int dump_device_info(struct ps3_repository_device *repo,
return result; return result;
} }
int ps3_repository_dump_bus_info(void) int __init ps3_repository_dump_bus_info(void)
{ {
int result = 0; int result = 0;
struct ps3_repository_device repo; struct ps3_repository_device repo;
......
...@@ -112,7 +112,7 @@ static struct smp_ops_t ps3_smp_ops = { ...@@ -112,7 +112,7 @@ static struct smp_ops_t ps3_smp_ops = {
.kick_cpu = smp_generic_kick_cpu, .kick_cpu = smp_generic_kick_cpu,
}; };
void smp_init_ps3(void) void __init smp_init_ps3(void)
{ {
DBG(" -> %s\n", __func__); DBG(" -> %s\n", __func__);
smp_ops = &ps3_smp_ops; smp_ops = &ps3_smp_ops;
......
...@@ -137,7 +137,7 @@ u64 ps3_get_spe_id(void *arg) ...@@ -137,7 +137,7 @@ u64 ps3_get_spe_id(void *arg)
} }
EXPORT_SYMBOL_GPL(ps3_get_spe_id); EXPORT_SYMBOL_GPL(ps3_get_spe_id);
static unsigned long get_vas_id(void) static unsigned long __init get_vas_id(void)
{ {
u64 id; u64 id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment