powerpc: Define eligible functions as __init
Subsystems (11)
v2 cover powerpc: Define eligible functions as __init
Hello all,
This patchset focuses on redefining/declaring functions that could be labeled with the macro __init. From my understanding, an initialization function is one which is only needed during the initial phases of booting, after which it's resources can be freed. I figure that any function which is only called by other initialization functions may also be labeled as an initialization function. There are several (mostly static) functions which can and should be labeled as __init. I created some scripts to help identify these functions. It scans all functions defined in arch/powerpc and, if it is only called by functions with the __init attribute, it will go on to adjust the prototype and definition to include the __init declaration. This patchset hopes to solve related issue #282:
https://github.com/linuxppc/issues/issues/282
Some notes about the scripts:
1. Trying to handle things like functions assigned to macros and function pointers proved to be a bit too complicated to track. I ended up just halting the investigation of these functions. In the future, I would like to be able to attempt to __init them but for now we leave them alone.
2. The proper syntax for adding the __init macro is followed as it is defined in include/linux/init.h.
3. There are some odd looking functions that look something like:
char *__init foo(.... I have found that this happens in many other places in the kernel source prior to running the scripts. Additionally, after running the scripts. I have successfully built all powerpc defconfigs without error. For these reasons, I assume the odd syntax is valid but I am interested in other opinions on this.
5. I have run my scripts on the Dec 14, 2021 merge branch
(specifically 798527287598)
After running my script for 3 rounds, they have identified about 250 functions so I tried to break the patches up into related platforms and subdirectories. There are only two functions with a prototype outside of arch/powerpc, these are find_via_cuda and find_via_pmu. I put those in their own patch.
Other than building all the ppc defconfigs, I have tested the changes by building kernels with and without the patches using defconfigs ppc64le_guest, powernv and pseries_le. There were no size differences reported in the boot logs. However, when using readelf -t we see the following differences in the size of the .text section:
ppc64le_guest -> .text decreased in size by 12.8k, init.text unchanged powernv -> .text decreased in size by 7.7k, init.text unchanged pseries_le -> .text decreased in size by 9.6k, init.text increased 65.5k
I figured the size differences (or lack of) in .init.text might have something to do with the requirement that the .init.text "section ends on a page boundary", as described in arch/powerpc/kernel/vmlinux.lds.S.
I am excited to say this is my first attempt at kernel development. I know this patchset is in no way important but I figured it was a good starting point. Please let me know if there is anything I am doing wrong or if I can do anything to help meet the kernel contribution guidelines.
Special thanks to Daniel Axtens for mentoring me and helping me get my first patchset out!
Changes in v2:
- add __init in prototypes right before the funtion name instead of at the end.
- respond to ./scripts/checkpatch feedback
- reference the related github issue in cover letter
- fix date in cover letter
- rebase onto latest merge
v1:
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=277093&state=
Nick Child (20):
powerpc/kernel: Add __init attribute to eligible functions powerpc/lib: Add __init attribute to eligible functions powerpc/mm: Add __init attribute to eligible functions powerpc/perf: Add __init attribute to eligible functions powerpc/sysdev: Add __init attribute to eligible functions powerpc/xmon: Add __init attribute to eligible functions powerpc/cell: Add __init attribute to eligible functions powerpc/chrp: Add __init attribute to eligible functions powerpc/pasemi: Add __init attribute to eligible functions powerpc/powermac: Add __init attribute to eligible functions powerpc/powernv: Add __init attribute to eligible functions powerpc/pseries: Add __init attribute to eligible functions powerpc/ps3: Add __init attribute to eligible functions powerpc/4xx: Add __init attribute to eligible functions powerpc/44x: Add __init attribute to eligible functions powerpc/embedded6xx: Add __init attribute to eligible functions powerpc/83xx: Add __init attribute to eligible functions powerpc/85xx: Add __init attribute to eligible functions powerpc/512x: Add __init attribute to eligible functions cuda/pmu: Make find_via_cuda/pmu init functions
arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- arch/powerpc/include/asm/btext.h | 10 ++-- arch/powerpc/include/asm/cpm2.h | 6 +-- arch/powerpc/include/asm/cpuidle.h | 2 +- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/include/asm/fadump-internal.h | 6 +-- arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/i8259.h | 2 +- arch/powerpc/include/asm/iommu.h | 2 +- arch/powerpc/include/asm/ipic.h | 2 +- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/include/asm/kvm_guest.h | 2 +- arch/powerpc/include/asm/mmu_context.h | 2 +- arch/powerpc/include/asm/mpic.h | 2 +- arch/powerpc/include/asm/opal.h | 2 +- arch/powerpc/include/asm/pci.h | 2 +- arch/powerpc/include/asm/perf_event_server.h | 2 +- arch/powerpc/include/asm/setup.h | 8 +-- arch/powerpc/include/asm/smu.h | 2 +- arch/powerpc/include/asm/udbg.h | 10 ++-- arch/powerpc/include/asm/xics.h | 4 +- arch/powerpc/include/asm/xmon.h | 2 +- arch/powerpc/kernel/btext.c | 12 ++--- arch/powerpc/kernel/dt_cpu_ftrs.c | 2 +- arch/powerpc/kernel/eeh_cache.c | 2 +- arch/powerpc/kernel/fadump.c | 18 +++---- arch/powerpc/kernel/nvram_64.c | 6 +-- arch/powerpc/kernel/pci-common.c | 2 +- arch/powerpc/kernel/pci_32.c | 4 +- arch/powerpc/kernel/prom.c | 4 +- arch/powerpc/kernel/prom_init.c | 12 ++--- arch/powerpc/kernel/rtasd.c | 6 +-- arch/powerpc/kernel/security.c | 4 +- arch/powerpc/kernel/setup_64.c | 2 +- arch/powerpc/kernel/smp.c | 5 +- arch/powerpc/kernel/sysfs.c | 10 ++-- arch/powerpc/kernel/udbg_16550.c | 10 ++-- arch/powerpc/kexec/core.c | 2 +- arch/powerpc/lib/code-patching.c | 2 +- arch/powerpc/lib/feature-fixups.c | 26 +++++----- arch/powerpc/mm/book3s32/mmu.c | 2 +- arch/powerpc/mm/book3s64/hash_utils.c | 6 +-- arch/powerpc/mm/book3s64/hugetlbpage.c | 2 +- arch/powerpc/mm/book3s64/mmu_context.c | 2 +- arch/powerpc/mm/book3s64/pkeys.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 4 +- arch/powerpc/mm/nohash/44x.c | 4 +- arch/powerpc/mm/nohash/fsl_book3e.c | 2 +- arch/powerpc/mm/nohash/tlb.c | 4 +- arch/powerpc/mm/numa.c | 6 +-- arch/powerpc/mm/ptdump/ptdump.c | 2 +- arch/powerpc/perf/core-book3s.c | 2 +- arch/powerpc/perf/generic-compat-pmu.c | 2 +- arch/powerpc/perf/internal.h | 18 +++---- arch/powerpc/perf/power10-pmu.c | 2 +- arch/powerpc/perf/power5+-pmu.c | 2 +- arch/powerpc/perf/power5-pmu.c | 2 +- arch/powerpc/perf/power6-pmu.c | 2 +- arch/powerpc/perf/power7-pmu.c | 2 +- arch/powerpc/perf/power8-pmu.c | 2 +- arch/powerpc/perf/power9-pmu.c | 2 +- arch/powerpc/perf/ppc970-pmu.c | 2 +- arch/powerpc/platforms/44x/fsp2.c | 4 +- arch/powerpc/platforms/4xx/cpm.c | 4 +- arch/powerpc/platforms/4xx/pci.c | 2 +- arch/powerpc/platforms/512x/clock-commonclk.c | 52 +++++++++---------- arch/powerpc/platforms/512x/mpc512x.h | 4 +- arch/powerpc/platforms/512x/mpc512x_shared.c | 4 +- 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 +-- arch/powerpc/platforms/85xx/ge_imp3a.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 2 +- .../platforms/85xx/socrates_fpga_pic.c | 2 +- .../platforms/85xx/socrates_fpga_pic.h | 2 +- arch/powerpc/platforms/85xx/xes_mpc85xx.c | 4 +- arch/powerpc/platforms/cell/cbe_regs.c | 2 +- arch/powerpc/platforms/cell/iommu.c | 14 ++--- arch/powerpc/platforms/cell/spu_base.c | 6 +-- arch/powerpc/platforms/cell/spu_manage.c | 16 +++--- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- arch/powerpc/platforms/chrp/pegasos_eth.c | 2 +- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 4 +- arch/powerpc/platforms/embedded6xx/hlwd-pic.h | 2 +- arch/powerpc/platforms/embedded6xx/holly.c | 2 +- .../platforms/embedded6xx/usbgecko_udbg.c | 4 +- arch/powerpc/platforms/embedded6xx/wii.c | 2 +- arch/powerpc/platforms/pasemi/msi.c | 2 +- arch/powerpc/platforms/pasemi/pasemi.h | 2 +- arch/powerpc/platforms/pasemi/pci.c | 2 +- arch/powerpc/platforms/pasemi/setup.c | 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 | 6 +-- arch/powerpc/platforms/powermac/smp.c | 4 +- arch/powerpc/platforms/powermac/udbg_scc.c | 2 +- arch/powerpc/platforms/powernv/idle.c | 6 +-- arch/powerpc/platforms/powernv/opal-core.c | 6 +-- arch/powerpc/platforms/powernv/opal-fadump.c | 2 +- arch/powerpc/platforms/powernv/opal-msglog.c | 4 +- arch/powerpc/platforms/powernv/opal-power.c | 2 +- .../powerpc/platforms/powernv/opal-powercap.c | 2 +- arch/powerpc/platforms/powernv/opal-rtc.c | 2 +- .../platforms/powernv/opal-sensor-groups.c | 4 +- arch/powerpc/platforms/powernv/opal.c | 8 +-- arch/powerpc/platforms/powernv/pci-ioda.c | 4 +- arch/powerpc/platforms/powernv/powernv.h | 4 +- arch/powerpc/platforms/powernv/rng.c | 2 +- arch/powerpc/platforms/powernv/setup.c | 6 +-- arch/powerpc/platforms/ps3/gelic_udbg.c | 2 +- arch/powerpc/platforms/ps3/mm.c | 4 +- arch/powerpc/platforms/ps3/os-area.c | 4 +- arch/powerpc/platforms/ps3/platform.h | 14 ++--- arch/powerpc/platforms/ps3/repository.c | 20 +++---- arch/powerpc/platforms/ps3/smp.c | 2 +- arch/powerpc/platforms/ps3/spu.c | 2 +- .../powerpc/platforms/pseries/event_sources.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 2 +- arch/powerpc/platforms/pseries/lpar.c | 6 +-- arch/powerpc/platforms/pseries/pseries.h | 2 +- arch/powerpc/platforms/pseries/rtas-fadump.c | 6 +-- arch/powerpc/platforms/pseries/setup.c | 4 +- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 6 +-- arch/powerpc/sysdev/cpm2.c | 6 +-- arch/powerpc/sysdev/dart_iommu.c | 2 +- arch/powerpc/sysdev/fsl_mpic_err.c | 4 +- arch/powerpc/sysdev/fsl_pci.c | 2 +- arch/powerpc/sysdev/fsl_pci.h | 2 +- arch/powerpc/sysdev/i8259.c | 2 +- arch/powerpc/sysdev/ipic.c | 2 +- arch/powerpc/sysdev/mpic.c | 2 +- arch/powerpc/sysdev/mpic.h | 10 ++-- arch/powerpc/sysdev/mpic_msi.c | 6 +-- arch/powerpc/sysdev/mpic_timer.c | 6 +-- arch/powerpc/sysdev/mpic_u3msi.c | 2 +- arch/powerpc/sysdev/tsi108_pci.c | 2 +- arch/powerpc/sysdev/udbg_memcons.c | 2 +- arch/powerpc/sysdev/xics/icp-hv.c | 2 +- arch/powerpc/sysdev/xics/icp-opal.c | 2 +- arch/powerpc/sysdev/xics/xics-common.c | 2 +- arch/powerpc/sysdev/xive/native.c | 4 +- arch/powerpc/sysdev/xive/spapr.c | 6 +-- arch/powerpc/xmon/xmon.c | 2 +- include/linux/cuda.h | 2 +- include/linux/pmu.h | 2 +- 150 files changed, 335 insertions(+), 334 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/20 powerpc/kernel: Add __init attribute to eligible functions
Some functions defined in arch/powerpc/kernel (and one in arch/powerpc/ kexec) 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.
--- arch/powerpc/include/asm/btext.h | 10 +++++----- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/include/asm/fadump-internal.h | 6 +++--- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/include/asm/kvm_guest.h | 2 +- arch/powerpc/include/asm/pci.h | 2 +- arch/powerpc/include/asm/setup.h | 4 ++-- arch/powerpc/include/asm/udbg.h | 8 ++++---- arch/powerpc/kernel/btext.c | 12 ++++++------ arch/powerpc/kernel/dt_cpu_ftrs.c | 2 +- arch/powerpc/kernel/eeh_cache.c | 2 +- arch/powerpc/kernel/fadump.c | 18 +++++++++--------- arch/powerpc/kernel/nvram_64.c | 6 +++--- arch/powerpc/kernel/pci-common.c | 2 +- arch/powerpc/kernel/pci_32.c | 4 ++-- arch/powerpc/kernel/prom.c | 4 ++-- arch/powerpc/kernel/prom_init.c | 12 ++++++------ arch/powerpc/kernel/rtasd.c | 6 +++--- arch/powerpc/kernel/security.c | 4 ++-- arch/powerpc/kernel/setup_64.c | 2 +- arch/powerpc/kernel/smp.c | 5 +++-- arch/powerpc/kernel/sysfs.c | 10 +++++----- arch/powerpc/kernel/udbg_16550.c | 10 +++++----- arch/powerpc/kexec/core.c | 2 +- 24 files changed, 69 insertions(+), 68 deletions(-)
arch/powerpc/include/asm/btext.h +5 -5
@@ -23,12 +23,12 @@ extern void btext_unmap(void);extern void btext_drawchar (char c);extern void btext_drawstring (const char *str); -extern void btext_drawhex (unsigned long v); -extern void btext_drawtext (const char *c,unsigned int len); +void __init btext_drawhex (unsigned long v); +void __init btext_drawtext (const char *c,unsigned int len); -extern void btext_clearscreen (void ); -extern void btext_flushscreen (void ); -extern void btext_flushline (void ); +void __init btext_clearscreen (void ); +void __init btext_flushscreen (void ); +void __init btext_flushline (void );#endif /* __KERNEL__ */ #endif /* __PPC_BTEXT_H */
arch/powerpc/include/asm/eeh.h +1 -1
@@ -460,7 +460,7 @@ static inline void eeh_readsl(const volatile void __iomem *addr, void * buf, } -void eeh_cache_debugfs_init (void ); +void __init eeh_cache_debugfs_init (void );#endif /* CONFIG_PPC64 */ #endif /* __KERNEL__ */
arch/powerpc/include/asm/fadump-internal.h +3 -3
@@ -137,10 +137,10 @@ struct fadump_ops { };/* Helper functions */ -s32 fadump_setup_cpu_notes_buf (u32 num_cpus); +s32 __init fadump_setup_cpu_notes_buf (u32 num_cpus);void fadump_free_cpu_notes_buf (void ); -u32 *fadump_regs_to_elf_notes (u32 *buf,struct pt_regs *regs); -void fadump_update_elfcore_header (char *bufp); +u32 *__init fadump_regs_to_elf_notes (u32 *buf,struct pt_regs *regs); +void __init fadump_update_elfcore_header (char *bufp);bool is_fadump_boot_mem_contiguous (void );bool is_fadump_reserved_mem_contiguous (void );
arch/powerpc/include/asm/kexec.h +1 -1
@@ -84,7 +84,7 @@ extern int crash_shutdown_register(crash_shutdown_t handler);extern int crash_shutdown_unregister (crash_shutdown_t handler);extern void crash_kexec_secondary (struct pt_regs *regs); -extern int overlaps_crashkernel (unsigned long start,unsigned long size); +int __init overlaps_crashkernel (unsigned long start,unsigned long size);extern void reserve_crashkernel (void );extern void machine_kexec_mask_interrupts (void );
arch/powerpc/include/asm/kvm_guest.h +1 -1
@@ -16,7 +16,7 @@ static inline bool is_kvm_guest(void) return static_branch_unlikely(&kvm_guest); } -int check_kvm_guest (void ); +int __init check_kvm_guest (void );#else static inline bool is_kvm_guest (void ) {return false; }static inline int check_kvm_guest (void ) {return 0 ; }
arch/powerpc/include/asm/pci.h +1 -1
@@ -48,7 +48,7 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) }#ifdef CONFIG_PCI -extern void set_pci_dma_ops (const struct dma_map_ops *dma_ops); +void __init set_pci_dma_ops (const struct dma_map_ops *dma_ops);#else /* CONFIG_PCI */ #define set_pci_dma_ops (d)#endif
arch/powerpc/include/asm/setup.h +2 -2
@@ -55,7 +55,7 @@ void setup_entry_flush(bool enable);void setup_uaccess_flush (bool enable);void do_rfi_flush_fixups (enum l1d_flush_type types);#ifdef CONFIG_PPC_BARRIER_NOSPEC -void setup_barrier_nospec (void ); +void __init setup_barrier_nospec (void );#else static inline void setup_barrier_nospec (void ) { }#endif
@@ -71,7 +71,7 @@ static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void#endif #ifdef CONFIG_PPC_FSL_BOOK3E -void setup_spectre_v2 (void ); +void __init setup_spectre_v2 (void );#else static inline void setup_spectre_v2 (void ) {}#endif
arch/powerpc/include/asm/udbg.h +4 -4
@@ -23,11 +23,11 @@ extern void udbg_printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));extern void udbg_progress (char *s,unsigned short hex); -extern void udbg_uart_init_mmio (void __iomem *addr,unsigned int stride); -extern void udbg_uart_init_pio (unsigned long port,unsigned int stride); +void __init udbg_uart_init_mmio (void __iomem *addr,unsigned int stride); +void __init udbg_uart_init_pio (unsigned long port,unsigned int stride); -extern void udbg_uart_setup (unsigned int speed,unsigned int clock); -extern unsigned int udbg_probe_uart_speed (unsigned int clock); +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);
arch/powerpc/kernel/btext.c +6 -6
@@ -161,7 +161,7 @@ void btext_map(void) boot_text_mapped =1 ; } -static int btext_initialize (struct device_node *np) +static int __init btext_initialize (struct device_node *np) {unsigned int width, height, depth, pitch;unsigned long address =0 ;
@@ -292,7 +292,7 @@ void btext_update_display(unsigned long phys, int width, int height, }EXPORT_SYMBOL (btext_update_display); -void btext_clearscreen (void ) +void __init btext_clearscreen (void ) {unsigned int *base = (unsigned int *)calc_base (0 ,0 ); unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
@@ -310,7 +310,7 @@ void btext_clearscreen(void)rmci_maybe_off (); } -void btext_flushscreen (void ) +void __init btext_flushscreen (void ) {unsigned int *base = (unsigned int *)calc_base (0 ,0 ); unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
@@ -329,7 +329,7 @@ void btext_flushscreen(void) __asm__ __volatile__ ("sync" :::"memory" ); } -void btext_flushline (void ) +void __init btext_flushline (void ) {unsigned int *base = (unsigned int *)calc_base (0 , g_loc_Y <<4 ); unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
@@ -544,7 +544,7 @@ void btext_drawstring(const char *c)btext_drawchar (*c++); } -void btext_drawtext (const char *c,unsigned int len) +void __init btext_drawtext (const char *c,unsigned int len) {if (!boot_text_mapped)return ;
@@ -552,7 +552,7 @@ void btext_drawtext(const char *c, unsigned int len)btext_drawchar (*c++); } -void btext_drawhex (unsigned long v) +void __init btext_drawhex (unsigned long v) {if (!boot_text_mapped)return ;
arch/powerpc/kernel/dt_cpu_ftrs.c +1 -1
@@ -344,7 +344,7 @@ static int __init feat_enable_dscr(struct dt_cpu_feature *f)return 1 ; } -static void hfscr_pmu_enable (void ) +static void __init hfscr_pmu_enable (void ) {u64 hfscr =mfspr (SPRN_HFSCR ); hfscr |=PPC_BIT (60 );
arch/powerpc/kernel/eeh_cache.c +1 -1
@@ -280,7 +280,7 @@ static int eeh_addr_cache_show(struct seq_file *s, void *v) }DEFINE_SHOW_ATTRIBUTE (eeh_addr_cache); -void eeh_cache_debugfs_init (void ) +void __init eeh_cache_debugfs_init (void ) { debugfs_create_file_unsafe("eeh_address_cache", 0400, arch_debugfs_dir, NULL,
arch/powerpc/kernel/fadump.c +9 -9
@@ -251,7 +251,7 @@ bool is_fadump_reserved_mem_contiguous(void) }/* Print firmware assisted dump configurations for debugging purpose. */ -static void fadump_show_config (void ) +static void __init fadump_show_config (void ) {int i;
@@ -353,7 +353,7 @@ static __init u64 fadump_calculate_reserve_size(void)* Calculate the total memory size required to be reserved for * firmware-assisted dump registration. */ -static unsigned long get_fadump_area_size (void ) +static unsigned long __init get_fadump_area_size (void ) {unsigned long size =0 ;
@@ -462,7 +462,7 @@ static int __init fadump_get_boot_mem_regions(void)* with the given memory range. * False, otherwise. */ -static bool overlaps_reserved_ranges (u64 base,u64 end,int *idx) +static bool __init overlaps_reserved_ranges (u64 base,u64 end,int *idx) {bool ret = false;int i;
@@ -737,7 +737,7 @@ void crash_fadump(struct pt_regs *regs, const char *str) fw_dump.ops->fadump_trigger (fdh, str); } -u32 *fadump_regs_to_elf_notes (u32 *buf,struct pt_regs *regs) +u32 *__init fadump_regs_to_elf_notes (u32 *buf,struct pt_regs *regs) {struct elf_prstatus prstatus;
@@ -752,7 +752,7 @@ u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)return buf; } -void fadump_update_elfcore_header (char *bufp) +void __init fadump_update_elfcore_header (char *bufp) {struct elf_phdr *phdr;
@@ -770,7 +770,7 @@ void fadump_update_elfcore_header(char *bufp)return ; } -static void *fadump_alloc_buffer (unsigned long size) +static void *__init fadump_alloc_buffer (unsigned long size) {unsigned long count, i;struct page *page;
@@ -792,7 +792,7 @@ static void fadump_free_buffer(unsigned long vaddr, unsigned long size)free_reserved_area ((void *)vaddr, (void *)(vaddr + size),-1 ,NULL ); } -s32 fadump_setup_cpu_notes_buf (u32 num_cpus) +s32 __init fadump_setup_cpu_notes_buf (u32 num_cpus) {/* Allocate buffer to hold cpu crash notes. */ fw_dump.cpu_notes_buf_size = num_cpus *sizeof (note_buf_t);
@@ -1447,7 +1447,7 @@ static ssize_t release_mem_store(struct kobject *kobj, }/* Release the reserved memory and disable the FADump */ -static void unregister_fadump (void ) +static void __init unregister_fadump (void ) {fadump_cleanup (); fadump_release_memory(fw_dump.reserve_dump_area_start,
@@ -1547,7 +1547,7 @@ ATTRIBUTE_GROUPS(fadump);DEFINE_SHOW_ATTRIBUTE (fadump_region); -static void fadump_init_files (void ) +static void __init fadump_init_files (void ) {int rc =0 ;
arch/powerpc/kernel/nvram_64.c +3 -3
@@ -540,7 +540,7 @@ static struct pstore_info nvram_pstore_info = { .write = nvram_pstore_write, }; -static int nvram_pstore_init (void ) +static int __init nvram_pstore_init (void ) {int rc =0 ;
@@ -562,7 +562,7 @@ static int nvram_pstore_init(void) return rc; }#else -static int nvram_pstore_init (void ) +static int __init nvram_pstore_init (void ) {return -1 ; }
@@ -755,7 +755,7 @@ static unsigned char __init nvram_checksum(struct nvram_header *p)* Per the criteria passed via nvram_remove_partition(), should this * partition be removed? 1=remove, 0=keep */ -static int nvram_can_remove_partition (struct nvram_partition *part, +static int __init nvram_can_remove_partition (struct nvram_partition *part,const char *name,int sig,const char *exceptions[]) {if (part->header.signature != sig)
arch/powerpc/kernel/pci-common.c +1 -1
@@ -62,7 +62,7 @@ EXPORT_SYMBOL(isa_mem_base);static const struct dma_map_ops *pci_dma_ops; -void set_pci_dma_ops (const struct dma_map_ops *dma_ops) +void __init set_pci_dma_ops (const struct dma_map_ops *dma_ops) { pci_dma_ops = dma_ops; }
arch/powerpc/kernel/pci_32.c +2 -2
@@ -37,7 +37,7 @@ int pcibios_assign_bus_offset = 1;EXPORT_SYMBOL (isa_io_base);EXPORT_SYMBOL (pci_dram_offset); -void pcibios_make_OF_bus_map (void ); +void __init pcibios_make_OF_bus_map (void );static void fixup_cpc710_pci64 (struct pci_dev * dev);static u8 * pci_to_OF_bus_map;
@@ -109,7 +109,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus) } } -void +void __init pcibios_make_OF_bus_map (void ) {int i;
arch/powerpc/kernel/prom.c +2 -2
@@ -447,7 +447,7 @@ static int __init early_init_dt_scan_chosen_ppc(unsigned long node,*/ #ifdef CONFIG_SPARSEMEM -static bool validate_mem_limit (u64 base,u64 *size) +static bool __init validate_mem_limit (u64 base,u64 *size) {u64 max_mem =1UL << (MAX_PHYSMEM_BITS );
@@ -458,7 +458,7 @@ static bool validate_mem_limit(u64 base, u64 *size) return true; }#else -static bool validate_mem_limit (u64 base,u64 *size) +static bool __init validate_mem_limit (u64 base,u64 *size) {return true; }
arch/powerpc/kernel/prom_init.c +6 -6
@@ -672,7 +672,7 @@ static inline 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;
@@ -682,7 +682,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;
@@ -728,7 +728,7 @@ static int __init prom_setprop(phandle node, const char *nodename,#define prom_islower (c) ('a' <= (c) && (c) <= 'z')#define prom_toupper (c) (prom_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;
@@ -753,7 +753,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 ;
@@ -1786,7 +1786,7 @@ static void __init prom_close_stdin(void) }#ifdef CONFIG_PPC_SVM -static int prom_rtas_hcall (uint64_t args) +static int __init prom_rtas_hcall (uint64_t args) { register uint64_t arg1 asm("r3") = H_RTAS; register uint64_t arg2 asm("r4") = args;
@@ -3248,7 +3248,7 @@ static void __init prom_check_initrd(unsigned long r3, unsigned long r4)/* * Perform the Enter Secure Mode ultracall. */ -static int enter_secure_mode (unsigned long kbase,unsigned long fdt) +static int __init enter_secure_mode (unsigned long kbase,unsigned long fdt) { register unsigned long r3 asm("r3") = UV_ESM; register unsigned long r4 asm("r4") = kbase;
arch/powerpc/kernel/rtasd.c +3 -3
@@ -455,7 +455,7 @@ static void rtas_event_scan(struct work_struct *w) }#ifdef CONFIG_PPC64 -static void retrieve_nvram_error_log (void ) +static void __init retrieve_nvram_error_log (void ) {unsigned int err_type ;int rc ;
@@ -473,12 +473,12 @@ static void retrieve_nvram_error_log(void) } }#else /* CONFIG_PPC64 */ -static void retrieve_nvram_error_log (void ) +static void __init retrieve_nvram_error_log (void ) { }#endif /* CONFIG_PPC64 */ -static void start_event_scan (void ) +static void __init start_event_scan (void ) {printk (KERN_DEBUG "RTAS daemon started\n" ); pr_debug("rtasd: will sleep for %d milliseconds\n",
arch/powerpc/kernel/security.c +2 -2
@@ -44,7 +44,7 @@ static void enable_barrier_nospec(bool enable)do_barrier_nospec_fixups (enable); } -void setup_barrier_nospec (void ) +void __init setup_barrier_nospec (void ) {bool enable;
@@ -132,7 +132,7 @@ early_param("nospectre_v2", handle_nospectre_v2);#endif /* CONFIG_PPC_FSL_BOOK3E || CONFIG_PPC_BOOK3S_64 */ #ifdef CONFIG_PPC_FSL_BOOK3E -void setup_spectre_v2 (void ) +void __init setup_spectre_v2 (void ) {if (no_spectrev2 ||cpu_mitigations_off ())do_btb_flush_fixups ();
arch/powerpc/kernel/setup_64.c +1 -1
@@ -499,7 +499,7 @@ void smp_release_cpus(void)* routines and/or provided to userland */ -static void init_cache_info (struct ppc_cache_info *info,u32 size,u32 lsize, +static void __init init_cache_info (struct ppc_cache_info *info,u32 size,u32 lsize,u32 bsize,u32 sets) { info->size = size;
arch/powerpc/kernel/smp.c +3 -2
@@ -896,7 +896,8 @@ static struct thread_groups *__init get_thread_groups(int cpu,return tg; } -static int update_mask_from_threadgroup (cpumask_var_t *mask,struct thread_groups *tg,int cpu,int cpu_group_start) +static int __init update_mask_from_threadgroup (cpumask_var_t *mask,struct thread_groups *tg, +int cpu,int cpu_group_start) {int first_thread =cpu_first_thread_sibling (cpu);int i;
@@ -1642,7 +1643,7 @@ int setup_profiling_timer(unsigned int multiplier) }#endif -static void fixup_topology (void ) +static void __init fixup_topology (void ) {int i;
arch/powerpc/kernel/sysfs.c +5 -5
@@ -214,7 +214,7 @@ static ssize_t __used store_dscr_default(struct device *dev, static DEVICE_ATTR(dscr_default, 0600, show_dscr_default, store_dscr_default); -static void sysfs_create_dscr_default (void ) +static void __init sysfs_create_dscr_default (void ) {if (cpu_has_feature (CPU_FTR_DSCR )) {int cpu;
@@ -744,12 +744,12 @@ static ssize_t show_svm(struct device *dev, struct device_attribute *attr, char } static DEVICE_ATTR(svm, 0444, show_svm, NULL); -static void create_svm_file (void ) +static void __init create_svm_file (void ) {device_create_file (cpu_subsys.dev_root, &dev_attr_svm); }#else -static void create_svm_file (void ) +static void __init create_svm_file (void ) { }#endif /* CONFIG_PPC_SVM */
@@ -1110,7 +1110,7 @@ EXPORT_SYMBOL_GPL(cpu_remove_dev_attr_group);/* NUMA stuff */ #ifdef CONFIG_NUMA -static void register_nodes (void ) +static void __init register_nodes (void ) {int i;
@@ -1134,7 +1134,7 @@ void sysfs_remove_device_from_node(struct device *dev, int nid)EXPORT_SYMBOL_GPL (sysfs_remove_device_from_node);#else -static void register_nodes (void ) +static void __init register_nodes (void ) {return ; }
arch/powerpc/kernel/udbg_16550.c +5 -5
@@ -84,7 +84,7 @@ static int udbg_uart_getc(void)return udbg_uart_in (UART_RBR ); } -static void udbg_use_uart (void ) +static void __init udbg_use_uart (void ) { udbg_putc = udbg_uart_putc; udbg_flush = udbg_uart_flush;
@@ -92,7 +92,7 @@ static void udbg_use_uart(void) udbg_getc_poll = udbg_uart_getc_poll; } -void udbg_uart_setup (unsigned int speed,unsigned int clock) +void __init udbg_uart_setup (unsigned int speed,unsigned int clock) {unsigned int dll, base_bauds;
@@ -121,7 +121,7 @@ void udbg_uart_setup(unsigned int speed, unsigned int clock)udbg_uart_out (UART_FCR ,0x7 ); } -unsigned int udbg_probe_uart_speed (unsigned int clock) +unsigned int __init udbg_probe_uart_speed (unsigned int clock) {unsigned int dll, dlm, divisor, prescaler, speed;u8 old_lcr;
@@ -172,7 +172,7 @@ static void udbg_uart_out_pio(unsigned int reg, u8 data)outb (data, udbg_uart.pio_base + (reg * udbg_uart_stride)); } -void udbg_uart_init_pio (unsigned long port,unsigned int stride) +void __init udbg_uart_init_pio (unsigned long port,unsigned int stride) {if (!port)return ;
@@ -194,7 +194,7 @@ static void udbg_uart_out_mmio(unsigned int reg, u8 data) } -void udbg_uart_init_mmio (void __iomem *addr,unsigned int stride) +void __init udbg_uart_init_mmio (void __iomem *addr,unsigned int stride) {if (!addr)return ;
arch/powerpc/kexec/core.c +1 -1
@@ -185,7 +185,7 @@ void __init reserve_crashkernel(void) } } -int overlaps_crashkernel (unsigned long start,unsigned long size) +int __init overlaps_crashkernel (unsigned long start,unsigned long size) {return (start + size) > crashk_res.start && start <= crashk_res.end; }
Signature · 1 line
2.25.1
PATCH v2 2/20 powerpc/lib: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/lib' 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.
--- arch/powerpc/include/asm/setup.h | 2 +- arch/powerpc/lib/code-patching.c | 2 +- arch/powerpc/lib/feature-fixups.c | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-)
arch/powerpc/include/asm/setup.h +1 -1
@@ -75,7 +75,7 @@ void __init setup_spectre_v2(void);#else static inline void setup_spectre_v2 (void ) {}#endif -void do_btb_flush_fixups (void ); +void __init do_btb_flush_fixups (void );#endif /* !__ASSEMBLY__ */
arch/powerpc/lib/code-patching.c +1 -1
@@ -397,7 +397,7 @@ void __patch_exception(int exc, unsigned long addr)#ifdef CONFIG_CODE_PATCHING_SELFTEST -static int instr_is_branch_to_addr (const u32 *instr,unsigned long addr) +static int __init instr_is_branch_to_addr (const u32 *instr,unsigned long addr) {if (instr_is_branch_iform (ppc_inst_read (instr)) ||instr_is_branch_bform (ppc_inst_read (instr)))
arch/powerpc/lib/feature-fixups.c +13 -13
@@ -580,7 +580,7 @@ void do_barrier_nospec_fixups_range(bool enable, void *fixup_start, void *fixup_printk (KERN_DEBUG "barrier-nospec: patched %d locations\n" , i); } -static void patch_btb_flush_section (long *curr) +static void __init patch_btb_flush_section (long *curr) {unsigned int *start, *end;
@@ -592,7 +592,7 @@ static void patch_btb_flush_section(long *curr) } } -void do_btb_flush_fixups (void ) +void __init do_btb_flush_fixups (void ) {long *start, *end;
@@ -621,7 +621,7 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end) } } -static void do_final_fixups (void ) +static void __init do_final_fixups (void ) {#if defined(CONFIG_PPC64 ) && defined(CONFIG_RELOCATABLE )ppc_inst_t inst;
@@ -715,12 +715,12 @@ late_initcall(check_features);/* This must be after the text it fixes up, vmlinux.lds.S enforces that atm */ static struct fixup_entry fixup; -static long calc_offset (struct fixup_entry *entry,unsigned int *p) +static long __init calc_offset (struct fixup_entry *entry,unsigned int *p) {return (unsigned long )p - (unsigned long )entry; } -static void test_basic_patching (void ) +static void __init test_basic_patching (void ) {extern unsigned int ftr_fixup_test1[];extern unsigned int end_ftr_fixup_test1[];
@@ -751,7 +751,7 @@ static void test_basic_patching(void)check (memcmp (ftr_fixup_test1, ftr_fixup_test1_expected, size) ==0 ); } -static void test_alternative_patching (void ) +static void __init test_alternative_patching (void ) {extern unsigned int ftr_fixup_test2[];extern unsigned int end_ftr_fixup_test2[];
@@ -784,7 +784,7 @@ static void test_alternative_patching(void)check (memcmp (ftr_fixup_test2, ftr_fixup_test2_expected, size) ==0 ); } -static void test_alternative_case_too_big (void ) +static void __init test_alternative_case_too_big (void ) {extern unsigned int ftr_fixup_test3[];extern unsigned int end_ftr_fixup_test3[];
@@ -810,7 +810,7 @@ static void test_alternative_case_too_big(void)check (memcmp (ftr_fixup_test3, ftr_fixup_test3_orig, size) ==0 ); } -static void test_alternative_case_too_small (void ) +static void __init test_alternative_case_too_small (void ) {extern unsigned int ftr_fixup_test4[];extern unsigned int end_ftr_fixup_test4[];
@@ -856,7 +856,7 @@ static void test_alternative_case_with_branch(void)check (memcmp (ftr_fixup_test5, ftr_fixup_test5_expected, size) ==0 ); } -static void test_alternative_case_with_external_branch (void ) +static void __init test_alternative_case_with_external_branch (void ) {extern unsigned int ftr_fixup_test6[];extern unsigned int end_ftr_fixup_test6[];
@@ -866,7 +866,7 @@ static void test_alternative_case_with_external_branch(void)check (memcmp (ftr_fixup_test6, ftr_fixup_test6_expected, size) ==0 ); } -static void test_alternative_case_with_branch_to_end (void ) +static void __init test_alternative_case_with_branch_to_end (void ) {extern unsigned int ftr_fixup_test7[];extern unsigned int end_ftr_fixup_test7[];
@@ -876,7 +876,7 @@ static void test_alternative_case_with_branch_to_end(void)check (memcmp (ftr_fixup_test7, ftr_fixup_test7_expected, size) ==0 ); } -static void test_cpu_macros (void ) +static void __init test_cpu_macros (void ) {extern u8 ftr_fixup_test_FTR_macros[];extern u8 ftr_fixup_test_FTR_macros_expected[];
@@ -888,7 +888,7 @@ static void test_cpu_macros(void) ftr_fixup_test_FTR_macros_expected, size) == 0); } -static void test_fw_macros (void ) +static void __init test_fw_macros (void ) {#ifdef CONFIG_PPC64 extern u8 ftr_fixup_test_FW_FTR_macros[];
@@ -902,7 +902,7 @@ static void test_fw_macros(void)#endif } -static void test_lwsync_macros (void ) +static void __init test_lwsync_macros (void ) {extern u8 lwsync_fixup_test[];extern u8 end_lwsync_fixup_test[];
Signature · 1 line
2.25.1
PATCH v2 3/20 powerpc/mm: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/mm' 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.
--- arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/mmu_context.h | 2 +- arch/powerpc/mm/book3s32/mmu.c | 2 +- arch/powerpc/mm/book3s64/hash_utils.c | 6 +++--- arch/powerpc/mm/book3s64/hugetlbpage.c | 2 +- arch/powerpc/mm/book3s64/mmu_context.c | 2 +- arch/powerpc/mm/book3s64/pkeys.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 4 ++-- arch/powerpc/mm/nohash/44x.c | 4 ++-- arch/powerpc/mm/nohash/fsl_book3e.c | 2 +- arch/powerpc/mm/nohash/tlb.c | 4 ++-- arch/powerpc/mm/numa.c | 6 +++--- arch/powerpc/mm/ptdump/ptdump.c | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-)
arch/powerpc/include/asm/hugetlb.h +1 -1
@@ -15,7 +15,7 @@extern bool hugetlb_disabled; -void hugetlbpage_init_default (void ); +void __init hugetlbpage_init_default (void );int slice_is_hugepage_only_range (struct mm_struct *mm,unsigned long addr,unsigned long len);
arch/powerpc/include/asm/mmu_context.h +1 -1
@@ -71,7 +71,7 @@ static inline void switch_mmu_context(struct mm_struct *prev, }extern int hash__alloc_context_id (void ); -extern void hash__reserve_context_id (int id); +void __init hash__reserve_context_id (int id);extern void __destroy_context (int context_id);static inline void mmu_context_init (void ) { }
arch/powerpc/mm/book3s32/mmu.c +1 -1
@@ -76,7 +76,7 @@ unsigned long p_block_mapped(phys_addr_t pa)return 0 ; } -static int find_free_bat (void ) +static int __init find_free_bat (void ) {int b;int n =mmu_has_feature (MMU_FTR_USE_HIGH_BATS ) ?8 :4 ;
arch/powerpc/mm/book3s64/hash_utils.c +3 -3
@@ -662,7 +662,7 @@ static int __init htab_dt_scan_hugepage_blocks(unsigned long node, }#endif /* CONFIG_HUGETLB_PAGE */ -static void mmu_psize_set_default_penc (void ) +static void __init mmu_psize_set_default_penc (void ) {int bpsize, apsize;for (bpsize =0 ; bpsize <MMU_PAGE_COUNT ; bpsize++)
@@ -672,7 +672,7 @@ static void mmu_psize_set_default_penc(void)#ifdef CONFIG_PPC_64K_PAGES -static bool might_have_hea (void ) +static bool __init might_have_hea (void ) {/* * The HEA ethernet adapter requires awareness of the
@@ -743,7 +743,7 @@ static void __init htab_scan_page_sizes(void)* low-order N bits as the encoding for the 2^(12+N) byte page size * (if it exists). */ -static void init_hpte_page_sizes (void ) +static void __init init_hpte_page_sizes (void ) {long int ap, bp;long int shift, penc;
arch/powerpc/mm/book3s64/hugetlbpage.c +1 -1
@@ -150,7 +150,7 @@ void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addrset_huge_pte_at (vma->vm_mm, addr, ptep, pte); } -void hugetlbpage_init_default (void ) +void __init hugetlbpage_init_default (void ) {/* Set default large page size. Currently, we pick 16M or 1M * depending on what is available
arch/powerpc/mm/book3s64/mmu_context.c +1 -1
@@ -32,7 +32,7 @@ static int alloc_context_id(int min_id, int max_id) }#ifdef CONFIG_PPC_64S_HASH_MMU -void hash__reserve_context_id (int id) +void __init hash__reserve_context_id (int id) {int result =ida_alloc_range (&mmu_context_ida, id, id,GFP_KERNEL );
arch/powerpc/mm/book3s64/pkeys.c +1 -1
@@ -66,7 +66,7 @@ static int __init dt_scan_storage_keys(unsigned long node,return 1 ; } -static int scan_pkey_feature (void ) +static int __init scan_pkey_feature (void ) {int ret;int pkeys_total =0 ;
arch/powerpc/mm/book3s64/radix_pgtable.c +2 -2
@@ -499,7 +499,7 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname,return 1 ; } -static unsigned long radix_memory_block_size (void ) +static unsigned long __init radix_memory_block_size (void ) {unsigned long mem_block_size =MIN_MEMORY_BLOCK_SIZE ;
@@ -517,7 +517,7 @@ static unsigned long radix_memory_block_size(void)#else /* CONFIG_MEMORY_HOTPLUG */ -static unsigned long radix_memory_block_size (void ) +static unsigned long __init radix_memory_block_size (void ) {return 1UL *1024 *1024 *1024 ; }
arch/powerpc/mm/nohash/44x.c +2 -2
@@ -38,7 +38,7 @@ int icache_44x_need_flush;unsigned long tlb_47x_boltmap[1024 /8 ]; -static void ppc44x_update_tlb_hwater (void ) +static void __init ppc44x_update_tlb_hwater (void ) {/* The TLB miss handlers hard codes the watermark in a cmpli * instruction to improve performances rather than loading it
@@ -122,7 +122,7 @@ static void __init ppc47x_update_boltmap(void)/* * "Pins" a 256MB TLB entry in AS0 for kernel lowmem for 47x type MMU */ -static void ppc47x_pin_tlb (unsigned int virt,unsigned int phys) +static void __init ppc47x_pin_tlb (unsigned int virt,unsigned int phys) {unsigned int rA;int bolted;
arch/powerpc/mm/nohash/fsl_book3e.c +1 -1
@@ -259,7 +259,7 @@ void __init MMU_init_hw(void)flush_instruction_cache (); } -static unsigned long tlbcam_sz (int idx) +static unsigned long __init tlbcam_sz (int idx) {return tlbcam_addrs[idx].limit - tlbcam_addrs[idx].start +1 ; }
arch/powerpc/mm/nohash/tlb.c +2 -2
@@ -432,7 +432,7 @@ void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address) } } -static void setup_page_sizes (void ) +static void __init setup_page_sizes (void ) {unsigned int tlb0cfg;unsigned int tlb0ps;
@@ -570,7 +570,7 @@ static void setup_page_sizes(void) } } -static void setup_mmu_htw (void ) +static void __init setup_mmu_htw (void ) {/* * If we want to use HW tablewalk, enable it by patching the TLB miss
arch/powerpc/mm/numa.c +3 -3
@@ -134,7 +134,7 @@ static int __init fake_numa_create_new_node(unsigned long end_pfn,return 0 ; } -static void reset_numa_cpu_lookup_table (void ) +static void __init reset_numa_cpu_lookup_table (void ) {unsigned int cpu;
@@ -372,7 +372,7 @@ void update_numa_distance(struct device_node *node)* ibm,numa-lookup-index-table= {N, domainid1, domainid2, ..... domainidN} * ibm,numa-distance-table = { N, 1, 2, 4, 5, 1, 6, .... N elements} */ -static void initialize_form2_numa_distance_lookup_table (void ) +static void __init initialize_form2_numa_distance_lookup_table (void ) {int i, j;struct device_node *root;
@@ -581,7 +581,7 @@ static int of_get_assoc_arrays(struct assoc_arrays *aa)return 0 ; } -static int get_nid_and_numa_distance (struct drmem_lmb *lmb) +static int __init get_nid_and_numa_distance (struct drmem_lmb *lmb) {struct assoc_arrays aa = { .arrays =NULL };int default_nid =NUMA_NO_NODE ;
arch/powerpc/mm/ptdump/ptdump.c +1 -1
@@ -315,7 +315,7 @@ static int ptdump_show(struct seq_file *m, void *v)DEFINE_SHOW_ATTRIBUTE (ptdump); -static void build_pgtable_complete_mask (void ) +static void __init build_pgtable_complete_mask (void ) {unsigned int i, j;
Signature · 1 line
2.25.1
PATCH v2 4/20 powerpc/perf: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/perf' 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.
--- arch/powerpc/include/asm/perf_event_server.h | 2 +- arch/powerpc/perf/core-book3s.c | 2 +- arch/powerpc/perf/generic-compat-pmu.c | 2 +- arch/powerpc/perf/internal.h | 18 +++++++++--------- arch/powerpc/perf/power10-pmu.c | 2 +- arch/powerpc/perf/power5+-pmu.c | 2 +- arch/powerpc/perf/power5-pmu.c | 2 +- arch/powerpc/perf/power6-pmu.c | 2 +- arch/powerpc/perf/power7-pmu.c | 2 +- arch/powerpc/perf/power8-pmu.c | 2 +- arch/powerpc/perf/power9-pmu.c | 2 +- arch/powerpc/perf/ppc970-pmu.c | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-)
arch/powerpc/include/asm/perf_event_server.h +1 -1
@@ -98,7 +98,7 @@ struct power_pmu {#define PPMU_LIMITED_PMC_REQD 2/* have to put this on a limited PMC */ #define PPMU_ONLY_COUNT_RUN 4/* only counting in run state */ -extern int register_power_pmu (struct power_pmu *); +int __init register_power_pmu (struct power_pmu *pmu);struct pt_regs ;extern unsigned long perf_misc_flags (struct pt_regs *regs);
arch/powerpc/perf/core-book3s.c +1 -1
@@ -2448,7 +2448,7 @@ static int power_pmu_prepare_cpu(unsigned int cpu)return 0 ; } -int register_power_pmu (struct power_pmu *pmu) +int __init register_power_pmu (struct power_pmu *pmu) {if (ppmu)return -EBUSY ;/* something's already registered */
arch/powerpc/perf/generic-compat-pmu.c +1 -1
@@ -307,7 +307,7 @@ static struct power_pmu generic_compat_pmu = { .attr_groups = generic_compat_pmu_attr_groups, }; -int init_generic_compat_pmu (void ) +int __init init_generic_compat_pmu (void ) {int rc =0 ;
arch/powerpc/perf/internal.h +9 -9
@@ -2,12 +2,12 @@// // Copyright 2019 Madhavan Srinivasan, IBM Corporation. -extern int init_ppc970_pmu (void ); -extern int init_power5_pmu (void ); -extern int init_power5p_pmu (void ); -extern int init_power6_pmu (void ); -extern int init_power7_pmu (void ); -extern int init_power8_pmu (void ); -extern int init_power9_pmu (void ); -extern int init_power10_pmu (void ); -extern int init_generic_compat_pmu (void ); +int __init init_ppc970_pmu (void ); +int __init init_power5_pmu (void ); +int __init init_power5p_pmu (void ); +int __init init_power6_pmu (void ); +int __init init_power7_pmu (void ); +int __init init_power8_pmu (void ); +int __init init_power9_pmu (void ); +int __init init_power10_pmu (void ); +int __init init_generic_compat_pmu (void );
arch/powerpc/perf/power10-pmu.c +1 -1
@@ -592,7 +592,7 @@ static struct power_pmu power10_pmu = { .check_attr_config = power10_check_attr_config, }; -int init_power10_pmu (void ) +int __init init_power10_pmu (void ) {unsigned int pvr;int rc;
arch/powerpc/perf/power5+-pmu.c +1 -1
@@ -677,7 +677,7 @@ static struct power_pmu power5p_pmu = { .cache_events = &power5p_cache_events, }; -int init_power5p_pmu (void ) +int __init init_power5p_pmu (void ) { if (!cur_cpu_spec->oprofile_cpu_type || (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5+")
arch/powerpc/perf/power5-pmu.c +1 -1
@@ -618,7 +618,7 @@ static struct power_pmu power5_pmu = { .flags = PPMU_HAS_SSLOT, }; -int init_power5_pmu (void ) +int __init init_power5_pmu (void ) {if (!cur_cpu_spec->oprofile_cpu_type ||strcmp (cur_cpu_spec->oprofile_cpu_type,"ppc64/power5" ))
arch/powerpc/perf/power6-pmu.c +1 -1
@@ -539,7 +539,7 @@ static struct power_pmu power6_pmu = { .cache_events = &power6_cache_events, }; -int init_power6_pmu (void ) +int __init init_power6_pmu (void ) {if (!cur_cpu_spec->oprofile_cpu_type ||strcmp (cur_cpu_spec->oprofile_cpu_type,"ppc64/power6" ))
arch/powerpc/perf/power7-pmu.c +1 -1
@@ -445,7 +445,7 @@ static struct power_pmu power7_pmu = { .cache_events = &power7_cache_events, }; -int init_power7_pmu (void ) +int __init init_power7_pmu (void ) {if (!cur_cpu_spec->oprofile_cpu_type ||strcmp (cur_cpu_spec->oprofile_cpu_type,"ppc64/power7" ))
arch/powerpc/perf/power8-pmu.c +1 -1
@@ -378,7 +378,7 @@ static struct power_pmu power8_pmu = { .bhrb_nr = 32, }; -int init_power8_pmu (void ) +int __init init_power8_pmu (void ) {int rc;
arch/powerpc/perf/power9-pmu.c +1 -1
@@ -452,7 +452,7 @@ static struct power_pmu power9_pmu = { .check_attr_config = power9_check_attr_config, }; -int init_power9_pmu (void ) +int __init init_power9_pmu (void ) {int rc =0 ;unsigned int pvr =mfspr (SPRN_PVR );
arch/powerpc/perf/ppc970-pmu.c +1 -1
@@ -489,7 +489,7 @@ static struct power_pmu ppc970_pmu = { .flags = PPMU_NO_SIPR | PPMU_NO_CONT_SAMPLING, }; -int init_ppc970_pmu (void ) +int __init init_ppc970_pmu (void ) { if (!cur_cpu_spec->oprofile_cpu_type || (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970")
Signature · 1 line
2.25.1
PATCH v2 5/20 powerpc/sysdev: Add __init attribute to eligible functions
In reply to Nick ChildSome files functions in 'arch/powerpc/sysdev' 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.
--- arch/powerpc/include/asm/cpm2.h | 6 +++--- arch/powerpc/include/asm/i8259.h | 2 +- arch/powerpc/include/asm/ipic.h | 2 +- arch/powerpc/include/asm/mpic.h | 2 +- arch/powerpc/include/asm/xics.h | 4 ++-- arch/powerpc/sysdev/cpm2.c | 6 +++--- arch/powerpc/sysdev/dart_iommu.c | 2 +- arch/powerpc/sysdev/fsl_mpic_err.c | 4 ++-- arch/powerpc/sysdev/fsl_pci.c | 2 +- arch/powerpc/sysdev/fsl_pci.h | 2 +- arch/powerpc/sysdev/i8259.c | 2 +- arch/powerpc/sysdev/ipic.c | 2 +- arch/powerpc/sysdev/mpic.c | 2 +- arch/powerpc/sysdev/mpic.h | 8 ++++---- arch/powerpc/sysdev/mpic_msi.c | 6 +++--- arch/powerpc/sysdev/mpic_timer.c | 6 +++--- arch/powerpc/sysdev/mpic_u3msi.c | 2 +- arch/powerpc/sysdev/tsi108_pci.c | 2 +- arch/powerpc/sysdev/udbg_memcons.c | 2 +- arch/powerpc/sysdev/xics/icp-hv.c | 2 +- arch/powerpc/sysdev/xics/icp-opal.c | 2 +- arch/powerpc/sysdev/xics/xics-common.c | 2 +- arch/powerpc/sysdev/xive/native.c | 4 ++-- arch/powerpc/sysdev/xive/spapr.c | 6 +++--- 24 files changed, 40 insertions(+), 40 deletions(-)
arch/powerpc/include/asm/cpm2.h +3 -3
@@ -1133,8 +1133,8 @@ enum cpm_clk { CPM_CLK_DUMMY }; -extern int cpm2_clk_setup (enum cpm_clk_target target,int clock,int mode); -extern int cpm2_smc_clk_setup (enum cpm_clk_target target,int clock); +int __init cpm2_clk_setup (enum cpm_clk_target target,int clock,int mode); +int __init cpm2_smc_clk_setup (enum cpm_clk_target target,int clock);#define CPM_PIN_INPUT 0#define CPM_PIN_OUTPUT 1
@@ -1143,7 +1143,7 @@ extern int cpm2_smc_clk_setup(enum cpm_clk_target target, int clock);#define CPM_PIN_GPIO 4#define CPM_PIN_OPENDRAIN 8 -void cpm2_set_pin (int port,int pin,int flags); +void __init cpm2_set_pin (int port,int pin,int flags);#endif /* __CPM2__ */ #endif /* __KERNEL__ */
arch/powerpc/include/asm/i8259.h +1 -1
@@ -7,7 +7,7 @@extern void i8259_init (struct device_node *node,unsigned long intack_addr);extern unsigned int i8259_irq (void ); -extern struct irq_domain *i8259_get_host (void ); +struct irq_domain *__init i8259_get_host (void );#endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_I8259_H */
arch/powerpc/include/asm/ipic.h +1 -1
@@ -65,7 +65,7 @@ enum ipic_mcp_irq { IPIC_MCP_MU = 7, }; -extern void ipic_set_default_priority (void ); +void __init ipic_set_default_priority (void );extern u32 ipic_get_mcp_status (void );extern void ipic_clear_mcp_status (u32 mask);
arch/powerpc/include/asm/mpic.h +1 -1
@@ -472,7 +472,7 @@ extern int mpic_cpu_get_priority(void);extern void mpic_cpu_set_priority (int prio);/* Request IPIs on primary mpic */ -extern void mpic_request_ipis (void ); +void __init mpic_request_ipis (void );/* Send a message (IPI) to a given target (cpu number or MSG_*) */ void smp_mpic_message_pass (int target,int msg);
arch/powerpc/include/asm/xics.h +2 -2
@@ -38,13 +38,13 @@ static inline int icp_native_init(void) { return -ENODEV; }/* PAPR ICP */ #ifdef CONFIG_PPC_ICP_HV -extern int icp_hv_init (void ); +int __init icp_hv_init (void );#else static inline int icp_hv_init (void ) {return -ENODEV ; }#endif #ifdef CONFIG_PPC_POWERNV -extern int icp_opal_init (void ); +int __init icp_opal_init (void );extern void icp_opal_flush_interrupt (void );#else static inline int icp_opal_init (void ) {return -ENODEV ; }
arch/powerpc/sysdev/cpm2.c +3 -3
@@ -135,7 +135,7 @@ void __cpm2_setbrg(uint brg, uint rate, uint clk, int div16, int src) }EXPORT_SYMBOL (__cpm2_setbrg); -int cpm2_clk_setup (enum cpm_clk_target target,int clock,int mode) +int __init cpm2_clk_setup (enum cpm_clk_target target,int clock,int mode) {int ret =0 ;int shift;
@@ -265,7 +265,7 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode)return ret; } -int cpm2_smc_clk_setup (enum cpm_clk_target target,int clock) +int __init cpm2_smc_clk_setup (enum cpm_clk_target target,int clock) {int ret =0 ;int shift;
@@ -326,7 +326,7 @@ struct cpm2_ioports {u32 res[3 ]; }; -void cpm2_set_pin (int port,int pin,int flags) +void __init cpm2_set_pin (int port,int pin,int flags) {struct cpm2_ioports __iomem *iop = (struct cpm2_ioports __iomem *)&cpm2_immr->im_ioport;
arch/powerpc/sysdev/dart_iommu.c +1 -1
@@ -226,7 +226,7 @@ static void dart_free(struct iommu_table *tbl, long index, long npages)dart_cache_sync (orig_dp, orig_npages); } -static void allocate_dart (void ) +static void __init allocate_dart (void ) {unsigned long tmp;
arch/powerpc/sysdev/fsl_mpic_err.c +2 -2
@@ -58,7 +58,7 @@ static struct irq_chip fsl_mpic_err_chip = { .irq_unmask = fsl_mpic_unmask_err, }; -int mpic_setup_error_int (struct mpic *mpic,int intvec) +int __init mpic_setup_error_int (struct mpic *mpic,int intvec) {int i;
@@ -121,7 +121,7 @@ static irqreturn_t fsl_error_int_handler(int irq, void *data)return IRQ_HANDLED ; } -void mpic_err_int_init (struct mpic *mpic,irq_hw_number_t irqnum) +void __init mpic_err_int_init (struct mpic *mpic,irq_hw_number_t irqnum) {unsigned int virq;int ret;
arch/powerpc/sysdev/fsl_pci.c +1 -1
@@ -1106,7 +1106,7 @@ static const struct of_device_id pci_ids[] = {struct device_node *fsl_pci_primary; -void fsl_pci_assign_primary (void ) +void __init fsl_pci_assign_primary (void ) {struct device_node *np;
arch/powerpc/sysdev/fsl_pci.h +1 -1
@@ -120,7 +120,7 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose);extern struct device_node *fsl_pci_primary;#ifdef CONFIG_PCI -void fsl_pci_assign_primary (void ); +void __init fsl_pci_assign_primary (void );#else static inline void fsl_pci_assign_primary (void ) {}#endif
arch/powerpc/sysdev/i8259.c +1 -1
@@ -208,7 +208,7 @@ static const struct irq_domain_ops i8259_host_ops = { .xlate = i8259_host_xlate, }; -struct irq_domain *i8259_get_host (void ) +struct irq_domain *__init i8259_get_host (void ) {return i8259_host; }
arch/powerpc/sysdev/ipic.c +1 -1
@@ -767,7 +767,7 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)return ipic; } -void ipic_set_default_priority (void ) +void __init ipic_set_default_priority (void ) {ipic_write (primary_ipic->regs,IPIC_SIPRR_A ,IPIC_PRIORITY_DEFAULT );ipic_write (primary_ipic->regs,IPIC_SIPRR_B ,IPIC_PRIORITY_DEFAULT );
arch/powerpc/sysdev/mpic.c +1 -1
@@ -1840,7 +1840,7 @@ unsigned int mpic_get_mcirq(void) }#ifdef CONFIG_SMP -void mpic_request_ipis (void ) +void __init mpic_request_ipis (void ) {struct mpic *mpic = mpic_primary;int i;
arch/powerpc/sysdev/mpic.h +4 -4
@@ -8,8 +8,8 @@#ifdef CONFIG_PCI_MSI extern void mpic_msi_reserve_hwirq (struct mpic *mpic,irq_hw_number_t hwirq); -extern int mpic_msi_init_allocator (struct mpic *mpic); -extern int mpic_u3msi_init (struct mpic *mpic); +int __init mpic_msi_init_allocator (struct mpic *mpic); +int __init mpic_u3msi_init (struct mpic *mpic);#else static inline void mpic_msi_reserve_hwirq (struct mpic *mpic,irq_hw_number_t hwirq)
@@ -37,8 +37,8 @@ extern void mpic_reset_core(int cpu);#ifdef CONFIG_FSL_SOC extern int mpic_map_error_int (struct mpic *mpic,unsigned int virq,irq_hw_number_t hw); -extern void mpic_err_int_init (struct mpic *mpic,irq_hw_number_t irqnum); -extern int mpic_setup_error_int (struct mpic *mpic,int intvec); +void __init mpic_err_int_init (struct mpic *mpic,irq_hw_number_t irqnum); +int __init mpic_setup_error_int (struct mpic *mpic,int intvec);#else static inline int mpic_map_error_int (struct mpic *mpic,unsigned int virq,irq_hw_number_t hw) {
arch/powerpc/sysdev/mpic_msi.c +3 -3
@@ -24,7 +24,7 @@ void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq) }#ifdef CONFIG_MPIC_U3_HT_IRQS -static int mpic_msi_reserve_u3_hwirqs (struct mpic *mpic) +static int __init mpic_msi_reserve_u3_hwirqs (struct mpic *mpic) {irq_hw_number_t hwirq;const struct irq_domain_ops *ops = mpic->irqhost->ops;
@@ -68,13 +68,13 @@ static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic) return 0; }#else -static int mpic_msi_reserve_u3_hwirqs (struct mpic *mpic) +static int __init mpic_msi_reserve_u3_hwirqs (struct mpic *mpic) {return -1 ; }#endif -int mpic_msi_init_allocator (struct mpic *mpic) +int __init mpic_msi_init_allocator (struct mpic *mpic) {int rc;
arch/powerpc/sysdev/mpic_timer.c +3 -3
@@ -384,7 +384,7 @@ struct mpic_timer *mpic_request_timer(irq_handler_t fn, void *dev, }EXPORT_SYMBOL (mpic_request_timer); -static int timer_group_get_freq (struct device_node *np, +static int __init timer_group_get_freq (struct device_node *np,struct timer_group_priv *priv) {u32 div;
@@ -411,7 +411,7 @@ static int timer_group_get_freq(struct device_node *np,return 0 ; } -static int timer_group_get_irq (struct device_node *np, +static int __init timer_group_get_irq (struct device_node *np,struct timer_group_priv *priv) {const u32 all_timer[] = {0 ,TIMERS_PER_GROUP };
@@ -459,7 +459,7 @@ static int timer_group_get_irq(struct device_node *np,return 0 ; } -static void timer_group_init (struct device_node *np) +static void __init timer_group_init (struct device_node *np) {struct timer_group_priv *priv;unsigned int i =0 ;
arch/powerpc/sysdev/mpic_u3msi.c +1 -1
@@ -174,7 +174,7 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)return 0 ; } -int mpic_u3msi_init (struct mpic *mpic) +int __init mpic_u3msi_init (struct mpic *mpic) {int rc;struct pci_controller *phb;
arch/powerpc/sysdev/tsi108_pci.c +1 -1
@@ -257,7 +257,7 @@ static void tsi108_pci_int_unmask(u_int irq)mb (); } -static void init_pci_source (void ) +static void __init init_pci_source (void ) {tsi108_write_reg (TSI108_PCI_OFFSET +TSI108_PCI_IRP_CFG_CTL ,0x0000ff00 );
arch/powerpc/sysdev/udbg_memcons.c +1 -1
@@ -92,7 +92,7 @@ int memcons_getc(void)return c; } -void udbg_init_memcons (void ) +void __init udbg_init_memcons (void ) { udbg_putc = memcons_putc; udbg_getc = memcons_getc;
arch/powerpc/sysdev/xics/icp-hv.c +1 -1
@@ -162,7 +162,7 @@ static const struct icp_ops icp_hv_ops = {#endif }; -int icp_hv_init (void ) +int __init icp_hv_init (void ) {struct device_node *np;
arch/powerpc/sysdev/xics/icp-opal.c +1 -1
@@ -184,7 +184,7 @@ static const struct icp_ops icp_opal_ops = {#endif }; -int icp_opal_init (void ) +int __init icp_opal_init (void ) {struct device_node *np;
arch/powerpc/sysdev/xics/xics-common.c +1 -1
@@ -121,7 +121,7 @@ void xics_mask_unknown_vec(unsigned int vec)#ifdef CONFIG_SMP -static void xics_request_ipi (void ) +static void __init xics_request_ipi (void ) {unsigned int ipi;
arch/powerpc/sysdev/xive/native.c +2 -2
@@ -492,7 +492,7 @@ static const struct xive_ops xive_native_ops = { .name = "native", }; -static bool xive_parse_provisioning (struct device_node *np) +static bool __init xive_parse_provisioning (struct device_node *np) {int rc;
@@ -532,7 +532,7 @@ static bool xive_parse_provisioning(struct device_node *np)return true; } -static void xive_native_setup_pools (void ) +static void __init xive_native_setup_pools (void ) {/* Allocate a pool big enough */ pr_debug ("XIVE: Allocating VP block for pool size %u\n" , nr_cpu_ids);
arch/powerpc/sysdev/xive/spapr.c +3 -3
@@ -44,7 +44,7 @@ struct xive_irq_bitmap {static LIST_HEAD (xive_irq_bitmaps); -static int xive_irq_bitmap_add (int base,int count) +static int __init xive_irq_bitmap_add (int base,int count) {struct xive_irq_bitmap *xibm;
@@ -687,7 +687,7 @@ static const struct xive_ops xive_spapr_ops = {/* * get max priority from "/ibm,plat-res-int-priorities" */ -static bool xive_get_max_prio (u8 *max_prio) +static bool __init xive_get_max_prio (u8 *max_prio) {struct device_node *rootdn;const __be32 *reg;
@@ -741,7 +741,7 @@ static bool xive_get_max_prio(u8 *max_prio)return true; } -static const u8 *get_vec5_feature (unsigned int index) +static const u8 *__init get_vec5_feature (unsigned int index) {unsigned long root, chosen;int size;
Signature · 1 line
2.25.1
PATCH v2 6/20 powerpc/xmon: Add __init attribute to eligible functions
In reply to Nick Childxmon_register_spus defined in 'arch/powerpc/xmon' is deserving of an __init macro attribute. This functions is only called by other initialization functions and therefore should inherit the attribute. Also, change the function declaration in the header file to include __init.
--- arch/powerpc/include/asm/xmon.h | 2 +- arch/powerpc/xmon/xmon.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/xmon.h +1 -1
@@ -12,7 +12,7 @@#ifdef CONFIG_XMON extern void xmon_setup (void ); -extern void xmon_register_spus (struct list_head *list); +void __init xmon_register_spus (struct list_head *list);struct pt_regs ;extern int xmon (struct pt_regs *excp);extern irqreturn_t xmon_irq (int ,void *);
arch/powerpc/xmon/xmon.c +1 -1
@@ -4136,7 +4136,7 @@ struct spu_info {static struct spu_info spu_info[XMON_NUM_SPUS ]; -void xmon_register_spus (struct list_head *list) +void __init xmon_register_spus (struct list_head *list) {struct spu *spu;
Signature · 1 line
2.25.1
PATCH v2 7/20 powerpc/cell: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/cell' are deserving of an __init macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute.
--- arch/powerpc/platforms/cell/cbe_regs.c | 2 +- arch/powerpc/platforms/cell/iommu.c | 14 +++++++------- arch/powerpc/platforms/cell/spu_base.c | 6 +++--- arch/powerpc/platforms/cell/spu_manage.c | 16 ++++++++-------- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-)
arch/powerpc/platforms/cell/cbe_regs.c +1 -1
@@ -165,7 +165,7 @@ u32 cbe_node_to_cpu(int node) }EXPORT_SYMBOL_GPL (cbe_node_to_cpu); -static struct device_node *cbe_get_be_node (int cpu_id) +static struct device_node *__init cbe_get_be_node (int cpu_id) {struct device_node *np;
arch/powerpc/platforms/cell/iommu.c +7 -7
@@ -253,7 +253,7 @@ static irqreturn_t ioc_interrupt(int irq, void *data)return IRQ_HANDLED ; } -static int cell_iommu_find_ioc (int nid,unsigned long *base) +static int __init cell_iommu_find_ioc (int nid,unsigned long *base) {struct device_node *np;struct resource r;
@@ -293,7 +293,7 @@ static int cell_iommu_find_ioc(int nid, unsigned long *base)return -ENODEV ; } -static void cell_iommu_setup_stab (struct cbe_iommu *iommu, +static void __init cell_iommu_setup_stab (struct cbe_iommu *iommu,unsigned long dbase,unsigned long dsize,unsigned long fbase,unsigned long fsize) {
@@ -313,7 +313,7 @@ static void cell_iommu_setup_stab(struct cbe_iommu *iommu,memset (iommu->stab,0 , stab_size); } -static unsigned long *cell_iommu_alloc_ptab (struct cbe_iommu *iommu, +static unsigned long *__init cell_iommu_alloc_ptab (struct cbe_iommu *iommu,unsigned long base,unsigned long size,unsigned long gap_base,unsigned long gap_size,unsigned long page_shift) {
@@ -373,7 +373,7 @@ static unsigned long *cell_iommu_alloc_ptab(struct cbe_iommu *iommu,return ptab; } -static void cell_iommu_enable_hardware (struct cbe_iommu *iommu) +static void __init cell_iommu_enable_hardware (struct cbe_iommu *iommu) {int ret;unsigned long reg, xlate_base;
@@ -413,7 +413,7 @@ static void cell_iommu_enable_hardware(struct cbe_iommu *iommu)out_be64 (iommu->cmd_regs + IOC_IOCmd_Cfg, reg); } -static void cell_iommu_setup_hardware (struct cbe_iommu *iommu, +static void __init cell_iommu_setup_hardware (struct cbe_iommu *iommu,unsigned long base,unsigned long size) {cell_iommu_setup_stab (iommu, base, size,0 ,0 );
@@ -858,7 +858,7 @@ static bool cell_pci_iommu_bypass_supported(struct pci_dev *pdev, u64 mask)cell_iommu_get_fixed_address (&pdev->dev) !=OF_BAD_ADDR ; } -static void insert_16M_pte (unsigned long addr,unsigned long *ptab, +static void __init insert_16M_pte (unsigned long addr,unsigned long *ptab,unsigned long base_pte) {unsigned long segment, offset;
@@ -873,7 +873,7 @@ static void insert_16M_pte(unsigned long addr, unsigned long *ptab, ptab[offset] = base_pte | (__pa (addr) & CBE_IOPTE_RPN_Mask); } -static void cell_iommu_setup_fixed_ptab (struct cbe_iommu *iommu, +static void __init cell_iommu_setup_fixed_ptab (struct cbe_iommu *iommu,struct device_node *np,unsigned long dbase,unsigned long dsize,unsigned long fbase,unsigned long fsize) {
arch/powerpc/platforms/cell/spu_base.c +3 -3
@@ -387,7 +387,7 @@ spu_irq_class_2(int irq, void *data)return stat ?IRQ_HANDLED :IRQ_NONE ; } -static int spu_request_irqs (struct spu *spu) +static int __init spu_request_irqs (struct spu *spu) {int ret =0 ;
@@ -540,7 +540,7 @@ void spu_remove_dev_attr_group(struct attribute_group *attrs) }EXPORT_SYMBOL_GPL (spu_remove_dev_attr_group); -static int spu_create_dev (struct spu *spu) +static int __init spu_create_dev (struct spu *spu) {int ret;
@@ -711,7 +711,7 @@ static void crash_kexec_stop_spus(void) } } -static void crash_register_spus (struct list_head *list) +static void __init crash_register_spus (struct list_head *list) {struct spu *spu;int ret;
arch/powerpc/platforms/cell/spu_manage.c +8 -8
@@ -186,7 +186,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)return -EINVAL ; } -static int spu_map_resource (struct spu *spu,int nr, +static int __init spu_map_resource (struct spu *spu,int nr,void __iomem ** virt,unsigned long *phys) {struct device_node *np = spu->devnode;
@@ -361,7 +361,7 @@ static void disable_spu_by_master_run(struct spu_context *ctx)static int qs20_reg_idxs[QS20_SPES_PER_BE ] = {0 ,2 ,4 ,6 ,7 ,5 ,3 ,1 };static int qs20_reg_memory[QS20_SPES_PER_BE ] = {1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 }; -static struct spu *spu_lookup_reg (int node,u32 reg) +static struct spu *__init spu_lookup_reg (int node,u32 reg) {struct spu *spu;const u32 *spu_reg;
@@ -374,7 +374,7 @@ static struct spu *spu_lookup_reg(int node, u32 reg)return NULL ; } -static void init_affinity_qs20_harcoded (void ) +static void __init init_affinity_qs20_harcoded (void ) {int node, i;struct spu *last_spu, *spu;
@@ -396,7 +396,7 @@ static void init_affinity_qs20_harcoded(void) } } -static int of_has_vicinity (void ) +static int __init of_has_vicinity (void ) {struct device_node *dn;
@@ -409,7 +409,7 @@ static int of_has_vicinity(void)return 0 ; } -static struct spu *devnode_spu (int cbe,struct device_node *dn) +static struct spu *__init devnode_spu (int cbe,struct device_node *dn) {struct spu *spu;
@@ -419,7 +419,7 @@ static struct spu *devnode_spu(int cbe, struct device_node *dn)return NULL ; } -static struct spu * +static struct spu *__init neighbour_spu (int cbe,struct device_node *target,struct device_node *avoid) {struct spu *spu;
@@ -440,7 +440,7 @@ neighbour_spu(int cbe, struct device_node *target, struct device_node *avoid)return NULL ; } -static void init_affinity_node (int cbe) +static void __init init_affinity_node (int cbe) {struct spu *spu, *last_spu;struct device_node *vic_dn, *last_spu_dn;
@@ -494,7 +494,7 @@ static void init_affinity_node(int cbe) } } -static void init_affinity_fw (void ) +static void __init init_affinity_fw (void ) {int cbe;
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -648,7 +648,7 @@ static void spufs_exit_isolated_loader(void) get_order(isolated_loader_size)); } -static void +static void __init spufs_init_isolated_loader (void ) {struct device_node *dn;
Signature · 1 line
2.25.1
PATCH v2 8/20 powerpc/chrp: Add __init attribute to eligible functions
In reply to Nick ChildThe function Enable_SRAM defined in 'arch/powerpc/platforms/chrp' is deserving of an __init macro attribute. This function is only called by other initialization functions and therefore should inherit the attribute.
--- arch/powerpc/platforms/chrp/pegasos_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/chrp/pegasos_eth.c +1 -1
@@ -113,7 +113,7 @@ static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {static void __iomem *mv643xx_reg_base; -static int Enable_SRAM (void ) +static int __init Enable_SRAM (void ) {u32 ALong;
Signature · 1 line
2.25.1
PATCH v2 9/20 powerpc/pasemi: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/pasemi' 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.
--- arch/powerpc/platforms/pasemi/msi.c | 2 +- arch/powerpc/platforms/pasemi/pasemi.h | 2 +- arch/powerpc/platforms/pasemi/pci.c | 2 +- arch/powerpc/platforms/pasemi/setup.c | 2 +- arch/powerpc/sysdev/mpic.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/pasemi/msi.c +1 -1
@@ -135,7 +135,7 @@ static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)return 0 ; } -int mpic_pasemi_msi_init (struct mpic *mpic) +int __init mpic_pasemi_msi_init (struct mpic *mpic) {int rc;struct pci_controller *phb;
arch/powerpc/platforms/pasemi/pasemi.h +1 -1
@@ -7,7 +7,7 @@ extern void pas_pci_init(void);extern void pas_pci_irq_fixup (struct pci_dev *dev);extern void pas_pci_dma_dev_setup (struct pci_dev *dev); -extern void __iomem *pasemi_pci_getcfgaddr (struct pci_dev *dev,int offset); +void __iomem *__init pasemi_pci_getcfgaddr (struct pci_dev *dev,int offset);extern void __init pasemi_map_registers (void );
arch/powerpc/platforms/pasemi/pci.c +1 -1
@@ -287,7 +287,7 @@ void __init pas_pci_init(void) } } -void __iomem *pasemi_pci_getcfgaddr (struct pci_dev *dev,int offset) +void __iomem *__init pasemi_pci_getcfgaddr (struct pci_dev *dev,int offset) {struct pci_controller *hose;
arch/powerpc/platforms/pasemi/setup.c +1 -1
@@ -212,7 +212,7 @@ static void sb600_8259_cascade(struct irq_desc *desc) chip->irq_eoi (&desc->irq_data); } -static void nemo_init_IRQ (struct mpic *mpic) +static void __init nemo_init_IRQ (struct mpic *mpic) {struct device_node *np;int gpio_virq;
arch/powerpc/sysdev/mpic.h +1 -1
@@ -24,7 +24,7 @@ static inline int mpic_u3msi_init(struct mpic *mpic)#endif #if defined(CONFIG_PCI_MSI ) && defined(CONFIG_PPC_PASEMI ) -int mpic_pasemi_msi_init (struct mpic *mpic); +int __init mpic_pasemi_msi_init (struct mpic *mpic);#else static inline int mpic_pasemi_msi_init (struct mpic *mpic) {return -1 ; }#endif
Signature · 1 line
2.25.1
PATCH v2 10/20 powerpc/powermac: Add __init attribute to eligible functions
In reply to Nick ChildSome 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.
--- 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(-)
arch/powerpc/include/asm/smu.h +1 -1
@@ -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 );
arch/powerpc/include/asm/udbg.h +1 -1
@@ -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 );
arch/powerpc/platforms/powermac/feature.c +1 -1
@@ -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 );
arch/powerpc/platforms/powermac/nvram.c +1 -1
@@ -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;
arch/powerpc/platforms/powermac/pfunc_base.c +3 -3
@@ -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;
arch/powerpc/platforms/powermac/setup.c +1 -1
@@ -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 ;
arch/powerpc/platforms/powermac/smp.c +2 -2
@@ -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)
arch/powerpc/platforms/powermac/udbg_scc.c +1 -1
@@ -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;
Signature · 1 line
2.25.1
PATCH v2 11/20 powerpc/powernv: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/powernv' 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.
--- arch/powerpc/include/asm/cpuidle.h | 2 +- arch/powerpc/include/asm/opal.h | 2 +- arch/powerpc/platforms/powernv/idle.c | 6 +++--- arch/powerpc/platforms/powernv/opal-core.c | 6 +++--- arch/powerpc/platforms/powernv/opal-fadump.c | 2 +- arch/powerpc/platforms/powernv/opal-msglog.c | 4 ++-- arch/powerpc/platforms/powernv/opal-power.c | 2 +- arch/powerpc/platforms/powernv/opal-powercap.c | 2 +- arch/powerpc/platforms/powernv/opal-rtc.c | 2 +- arch/powerpc/platforms/powernv/opal-sensor-groups.c | 4 ++-- arch/powerpc/platforms/powernv/opal.c | 8 ++++---- arch/powerpc/platforms/powernv/pci-ioda.c | 4 ++-- arch/powerpc/platforms/powernv/powernv.h | 4 ++-- arch/powerpc/platforms/powernv/rng.c | 2 +- arch/powerpc/platforms/powernv/setup.c | 6 +++--- 15 files changed, 28 insertions(+), 28 deletions(-)
arch/powerpc/include/asm/cpuidle.h +1 -1
@@ -85,7 +85,7 @@ extern struct pnv_idle_states_t *pnv_idle_states;extern int nr_pnv_idle_states;unsigned long pnv_cpu_offline (unsigned int cpu); -int validate_psscr_val_mask (u64 *psscr_val,u64 *psscr_mask,u32 flags); +int __init validate_psscr_val_mask (u64 *psscr_val,u64 *psscr_mask,u32 flags);static inline void report_invalid_psscr_val (u64 psscr_val,int err) {switch (err) {
arch/powerpc/include/asm/opal.h +1 -1
@@ -314,7 +314,7 @@ extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);extern int early_init_dt_scan_recoverable_ranges (unsigned long node,const char *uname,int depth,void *data); -extern void opal_configure_cores (void ); +void __init opal_configure_cores (void );extern int opal_get_chars (uint32_t vtermno,char *buf,int count);extern int opal_put_chars (uint32_t vtermno,const char *buf,int total_len);
arch/powerpc/platforms/powernv/idle.c +3 -3
@@ -62,7 +62,7 @@ static bool deepest_stop_found;static unsigned long power7_offline_type; -static int pnv_save_sprs_for_deep_states (void ) +static int __init pnv_save_sprs_for_deep_states (void ) {int cpu;int rc;
@@ -1123,7 +1123,7 @@ unsigned long pnv_cpu_offline(unsigned int cpu)* stop instruction */ -int validate_psscr_val_mask (u64 *psscr_val,u64 *psscr_mask,u32 flags) +int __init validate_psscr_val_mask (u64 *psscr_val,u64 *psscr_mask,u32 flags) {int err =0 ;
@@ -1317,7 +1317,7 @@ static void __init pnv_probe_idle_states(void)* which is the number of cpuidle states discovered through device-tree. */ -static int pnv_parse_cpuidle_dt (void ) +static int __init pnv_parse_cpuidle_dt (void ) {struct device_node *np;int nr_idle_states, i;
arch/powerpc/platforms/powernv/opal-core.c +3 -3
@@ -89,7 +89,7 @@ static inline int is_opalcore_usable(void)return (oc_conf && oc_conf->opalcorebuf !=NULL ) ?1 :0 ; } -static Elf64_Word *append_elf64_note (Elf64_Word *buf,char *name, +static Elf64_Word *__init append_elf64_note (Elf64_Word *buf,char *name,u32 type,void *data,size_t data_len) {
@@ -108,7 +108,7 @@ static Elf64_Word *append_elf64_note(Elf64_Word *buf, char *name,return buf; } -static void fill_prstatus (struct elf_prstatus *prstatus,int pir, +static void __init fill_prstatus (struct elf_prstatus *prstatus,int pir,struct pt_regs *regs) {memset (prstatus,0 ,sizeof (struct elf_prstatus ));
@@ -134,7 +134,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus, int pir, } } -static Elf64_Word *auxv_to_elf64_notes (Elf64_Word *buf, +static Elf64_Word *__init auxv_to_elf64_notes (Elf64_Word *buf,u64 opal_boot_entry) {Elf64_Off *bufp = (Elf64_Off *)oc_conf->auxv_buf;
arch/powerpc/platforms/powernv/opal-fadump.c +1 -1
@@ -112,7 +112,7 @@ static void opal_fadump_update_config(struct fw_dump *fadump_conf,* This function is called in the capture kernel to get configuration details * from metadata setup by the first kernel. */ -static void opal_fadump_get_config (struct fw_dump *fadump_conf, +static void __init opal_fadump_get_config (struct fw_dump *fadump_conf,const struct opal_fadump_mem_struct *fdm) {unsigned long base, size, last_end, hole_size;
arch/powerpc/platforms/powernv/opal-msglog.c +2 -2
@@ -105,7 +105,7 @@ static struct bin_attribute opal_msglog_attr = { .read = opal_msglog_read }; -struct memcons *memcons_init (struct device_node *node,const char *mc_prop_name) +struct memcons *__init memcons_init (struct device_node *node,const char *mc_prop_name) {u64 mcaddr;struct memcons *mc;
@@ -133,7 +133,7 @@ struct memcons *memcons_init(struct device_node *node, const char *mc_prop_name)return NULL ; } -u32 memcons_get_size (struct memcons *mc) +u32 __init memcons_get_size (struct memcons *mc) {return be32_to_cpu (mc->ibuf_size) +be32_to_cpu (mc->obuf_size); }
arch/powerpc/platforms/powernv/opal-power.c +1 -1
@@ -53,7 +53,7 @@ static bool detect_epow(void) }/* Check for existing EPOW, DPO events */ -static bool poweroff_pending (void ) +static bool __init poweroff_pending (void ) {int rc;__be64 opal_dpo_timeout;
arch/powerpc/platforms/powernv/opal-powercap.c +1 -1
@@ -129,7 +129,7 @@ static ssize_t powercap_store(struct kobject *kobj,return ret; } -static void powercap_add_attr (int handle,const char *name, +static void __init powercap_add_attr (int handle,const char *name,struct powercap_attr *attr) { attr->handle = handle;
arch/powerpc/platforms/powernv/opal-rtc.c +1 -1
@@ -18,7 +18,7 @@#include <asm/firmware.h> #include <asm/machdep.h> -static void opal_to_tm (u32 y_m_d,u64 h_m_s_ms,struct rtc_time *tm) +static void __init opal_to_tm (u32 y_m_d,u64 h_m_s_ms,struct rtc_time *tm) { tm->tm_year = ((bcd2bin (y_m_d >>24 ) *100 ) +bcd2bin ((y_m_d >>16 ) &0xff )) -1900 ;
arch/powerpc/platforms/powernv/opal-sensor-groups.c +2 -2
@@ -126,7 +126,7 @@ static void add_attr(int handle, struct sg_attr *attr, int index) attr->attr.store = ops_info[index].store; } -static int add_attr_group (const __be32 *ops,int len,struct sensor_group *sg, +static int __init add_attr_group (const __be32 *ops,int len,struct sensor_group *sg,u32 handle) {int i, j;
@@ -144,7 +144,7 @@ static int add_attr_group(const __be32 *ops, int len, struct sensor_group *sg,return sysfs_create_group (sg_kobj, &sg->sg); } -static int get_nr_attrs (const __be32 *ops,int len) +static int __init get_nr_attrs (const __be32 *ops,int len) {int i, j;int nr_attrs =0 ;
arch/powerpc/platforms/powernv/opal.c +4 -4
@@ -73,7 +73,7 @@ static struct task_struct *kopald_tsk;static struct opal_msg *opal_msg;static u32 opal_msg_size__ro_after_init ; -void opal_configure_cores (void ) +void __init opal_configure_cores (void ) {u64 reinit_flags =0 ;
@@ -779,7 +779,7 @@ bool opal_mce_check_early_recovery(struct pt_regs *regs)return !!recover_addr; } -static int opal_sysfs_init (void ) +static int __init opal_sysfs_init (void ) { opal_kobj =kobject_create_and_add ("opal" , firmware_kobj);if (!opal_kobj) {
@@ -937,7 +937,7 @@ static void __init opal_dump_region_init(void) "rc = %d\n", rc); } -static void opal_pdev_init (const char *compatible) +static void __init opal_pdev_init (const char *compatible) {struct device_node *np;
@@ -981,7 +981,7 @@ void opal_wake_poller(void)wake_up_process (kopald_tsk); } -static void opal_init_heartbeat (void ) +static void __init opal_init_heartbeat (void ) {/* Old firwmware, we assume the HVC heartbeat is sufficient */ if (of_property_read_u32(opal_node, "ibm,heartbeat-ms",
arch/powerpc/platforms/powernv/pci-ioda.c +2 -2
@@ -2265,7 +2265,7 @@ static const struct irq_domain_ops pnv_irq_domain_ops = { .free = pnv_irq_domain_free, }; -static int pnv_msi_allocate_domains (struct pci_controller *hose,unsigned int count) +static int __init pnv_msi_allocate_domains (struct pci_controller *hose,unsigned int count) {struct pnv_phb *phb = hose->private_data;struct irq_domain *parent =irq_get_default_host ();
@@ -2298,7 +2298,7 @@ static int pnv_msi_allocate_domains(struct pci_controller *hose, unsigned int coreturn 0 ; } -static void pnv_pci_init_ioda_msis (struct pnv_phb *phb) +static void __init pnv_pci_init_ioda_msis (struct pnv_phb *phb) {unsigned int count; const __be32 *prop = of_get_property(phb->hose->dn,
arch/powerpc/platforms/powernv/powernv.h +2 -2
@@ -39,7 +39,7 @@ bool cpu_core_split_required(void);struct memcons ;ssize_t memcons_copy (struct memcons *mc,char *to,loff_t pos,size_t count); -u32 memcons_get_size (struct memcons *mc); -struct memcons *memcons_init (struct device_node *node,const char *mc_prop_name); +u32 __init memcons_get_size (struct memcons *mc); +struct memcons *__init memcons_init (struct device_node *node,const char *mc_prop_name);#endif /* _POWERNV_H */
arch/powerpc/platforms/powernv/rng.c +1 -1
@@ -80,7 +80,7 @@ static int powernv_get_random_darn(unsigned long *v)return 1 ; } -static int initialise_darn (void ) +static int __init initialise_darn (void ) {unsigned long val;int i;
arch/powerpc/platforms/powernv/setup.c +3 -3
@@ -40,7 +40,7 @@#include "powernv.h" -static bool fw_feature_is (const char *state,const char *name, +static bool __init fw_feature_is (const char *state,const char *name,struct device_node *fw_features) {struct device_node *np;
@@ -55,7 +55,7 @@ static bool fw_feature_is(const char *state, const char *name,return rc; } -static void init_fw_feat_flags (struct device_node *np) +static void __init init_fw_feat_flags (struct device_node *np) {if (fw_feature_is ("enabled" ,"inst-spec-barrier-ori31,31,0" , np))security_ftr_set (SEC_FTR_SPEC_BAR_ORI31 );
@@ -98,7 +98,7 @@ static void init_fw_feat_flags(struct device_node *np)security_ftr_clear (SEC_FTR_BNDS_CHK_SPEC_BAR ); } -static void pnv_setup_security_mitigations (void ) +static void __init pnv_setup_security_mitigations (void ) {struct device_node *np, *fw_features;enum l1d_flush_type type;
Signature · 1 line
2.25.1
PATCH v2 12/20 powerpc/pseries: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/pseries' 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.
--- arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- arch/powerpc/include/asm/iommu.h | 2 +- arch/powerpc/include/asm/setup.h | 2 +- arch/powerpc/platforms/pseries/event_sources.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 2 +- arch/powerpc/platforms/pseries/lpar.c | 6 +++--- arch/powerpc/platforms/pseries/pseries.h | 2 +- arch/powerpc/platforms/pseries/rtas-fadump.c | 6 +++--- arch/powerpc/platforms/pseries/setup.c | 4 ++-- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 6 +++--- 11 files changed, 18 insertions(+), 18 deletions(-)
arch/powerpc/include/asm/book3s/64/mmu.h +1 -1
@@ -258,7 +258,7 @@ static inline void setup_initial_memory_limit(phys_addr_t first_memblock_base, }#ifdef CONFIG_PPC_PSERIES -extern void radix_init_pseries (void ); +void __init radix_init_pseries (void );#else static inline void radix_init_pseries (void ) { }#endif
arch/powerpc/include/asm/iommu.h +1 -1
@@ -275,7 +275,7 @@ extern void iommu_unmap_page(struct iommu_table *tbl, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction, unsigned long attrs); -extern void iommu_init_early_pSeries (void ); +void __init iommu_init_early_pSeries (void );extern void iommu_init_early_dart (struct pci_controller_ops *controller_ops);extern void iommu_init_early_pasemi (void );
arch/powerpc/include/asm/setup.h +1 -1
@@ -32,7 +32,7 @@ void setup_panic(void);extern bool pseries_enable_reloc_on_exc (void );extern void pseries_disable_reloc_on_exc (void );extern void pseries_big_endian_exceptions (void ); -extern void pseries_little_endian_exceptions (void ); +void __init pseries_little_endian_exceptions (void );#else static inline bool pseries_enable_reloc_on_exc (void ) {return false; }static inline void pseries_disable_reloc_on_exc (void ) {}
arch/powerpc/platforms/pseries/event_sources.c +1 -1
@@ -8,7 +8,7 @@#include "pseries.h" -void request_event_sources_irqs (struct device_node *np, +void __init request_event_sources_irqs (struct device_node *np,irq_handler_t handler,const char *name) {
arch/powerpc/platforms/pseries/iommu.c +1 -1
@@ -1654,7 +1654,7 @@ static struct notifier_block iommu_reconfig_nb = { };/* These are called very early. */ -void iommu_init_early_pSeries (void ) +void __init iommu_init_early_pSeries (void ) {if (of_chosen &&of_get_property (of_chosen,"linux,iommu-off" ,NULL ))return ;
arch/powerpc/platforms/pseries/lpar.c +3 -3
@@ -714,7 +714,7 @@ void vpa_init(int cpu)#ifdef CONFIG_PPC_BOOK3S_64 -static int pseries_lpar_register_process_table (unsigned long base, +static int __init pseries_lpar_register_process_table (unsigned long base,unsigned long page_size,unsigned long table_size) {long rc;
@@ -1737,7 +1737,7 @@ void __init hpte_init_pseries(void)#endif /* CONFIG_PPC_64S_HASH_MMU */ #ifdef CONFIG_PPC_RADIX_MMU -void radix_init_pseries (void ) +void __init radix_init_pseries (void ) {pr_info ("Using radix MMU under hypervisor\n" );
@@ -1938,7 +1938,7 @@ int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data) }#ifdef CONFIG_PPC_64S_HASH_MMU -static unsigned long vsid_unscramble (unsigned long vsid,int ssize) +static unsigned long __init vsid_unscramble (unsigned long vsid,int ssize) {unsigned long protovsid;unsigned long va_bits =VA_BITS ;
arch/powerpc/platforms/pseries/pseries.h +1 -1
@@ -11,7 +11,7 @@struct device_node ; -extern void request_event_sources_irqs (struct device_node *np, +void __init request_event_sources_irqs (struct device_node *np,irq_handler_t handler,const char *name);#include <linux/of.h>
arch/powerpc/platforms/pseries/rtas-fadump.c +3 -3
@@ -39,7 +39,7 @@ static void rtas_fadump_update_config(struct fw_dump *fadump_conf,* This function is called in the capture kernel to get configuration details * setup in the first kernel and passed to the f/w. */ -static void rtas_fadump_get_config (struct fw_dump *fadump_conf, +static void __init rtas_fadump_get_config (struct fw_dump *fadump_conf,const struct rtas_fadump_mem_struct *fdm) { fadump_conf->boot_mem_addr[0] =
@@ -247,7 +247,7 @@ static inline int rtas_fadump_gpr_index(u64 id)return i; } -static void rtas_fadump_set_regval (struct pt_regs *regs,u64 reg_id,u64 reg_val) +static void __init rtas_fadump_set_regval (struct pt_regs *regs,u64 reg_id,u64 reg_val) {int i;
@@ -272,7 +272,7 @@ static void rtas_fadump_set_regval(struct pt_regs *regs, u64 reg_id, u64 reg_val regs->dsisr = (unsigned long )reg_val; } -static struct rtas_fadump_reg_entry * +static struct rtas_fadump_reg_entry *__init rtas_fadump_read_regs (struct rtas_fadump_reg_entry *reg_entry,struct pt_regs *regs) {
arch/powerpc/platforms/pseries/setup.c +2 -2
@@ -447,7 +447,7 @@ void pseries_big_endian_exceptions(void)panic ("Could not enable big endian exceptions" ); } -void pseries_little_endian_exceptions (void ) +void __init pseries_little_endian_exceptions (void ) {long rc;
@@ -907,7 +907,7 @@ void pSeries_coalesce_init(void)* fw_cmo_feature_init - FW_FEATURE_CMO is not stored in ibm,hypertas-functions, * handle that here. (Stolen from parse_system_parameter_string) */ -static void pSeries_cmo_feature_init (void ) +static void __init pSeries_cmo_feature_init (void ) {char *ptr, *key, *value, *end;int call_status;
arch/powerpc/platforms/pseries/vas.c +1 -1
@@ -482,7 +482,7 @@ EXPORT_SYMBOL_GPL(vas_unregister_api_pseries);* Get the specific capabilities based on the feature type. * Right now supports GZIP default and GZIP QoS capabilities. */ -static int get_vas_capabilities (u8 feat,enum vas_cop_feat_type type, +static int __init get_vas_capabilities (u8 feat,enum vas_cop_feat_type type,struct hv_vas_cop_feat_caps *hv_caps) {struct vas_cop_feat_caps *caps;
arch/powerpc/platforms/pseries/vio.c +3 -3
@@ -1061,7 +1061,7 @@ static struct attribute *vio_bus_attrs[] = { };ATTRIBUTE_GROUPS (vio_bus); -static void vio_cmo_sysfs_init (void ) +static void __init vio_cmo_sysfs_init (void ) { vio_bus_type.dev_groups = vio_cmo_dev_groups; vio_bus_type.bus_groups = vio_bus_groups;
@@ -1073,7 +1073,7 @@ static int vio_cmo_bus_probe(struct vio_dev *viodev) { return 0; }static void vio_cmo_bus_remove (struct vio_dev *viodev) {}static void vio_cmo_set_dma_ops (struct vio_dev *viodev) {}static void vio_cmo_bus_init (void ) {} -static void vio_cmo_sysfs_init (void ) { } +static void __init vio_cmo_sysfs_init (void ) { }#endif /* CONFIG_PPC_SMLPAR */ EXPORT_SYMBOL (vio_cmo_entitlement_update);EXPORT_SYMBOL (vio_cmo_set_dev_desired);
@@ -1479,7 +1479,7 @@ EXPORT_SYMBOL(vio_register_device_node);* Starting from the root node provide, register the device node for * each child beneath the root. */ -static void vio_bus_scan_register_devices (char *root_name) +static void __init vio_bus_scan_register_devices (char *root_name) {struct device_node *node_root, *node_child;
Signature · 1 line
2.25.1
PATCH v2 13/20 powerpc/ps3: Add __init attribute to eligible functions
In reply to Nick ChildSome 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.
--- arch/powerpc/platforms/ps3/gelic_udbg.c | 2 +- arch/powerpc/platforms/ps3/mm.c | 4 ++-- arch/powerpc/platforms/ps3/os-area.c | 4 ++-- arch/powerpc/platforms/ps3/platform.h | 14 +++++++------- arch/powerpc/platforms/ps3/repository.c | 20 ++++++++++---------- arch/powerpc/platforms/ps3/smp.c | 2 +- arch/powerpc/platforms/ps3/spu.c | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-)
arch/powerpc/platforms/ps3/gelic_udbg.c +1 -1
@@ -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); } -static void gelic_debug_init (void ) +static void __init gelic_debug_init (void ) {s64 result;u64 v2;
arch/powerpc/platforms/ps3/mm.c +2 -2
@@ -41,7 +41,7 @@ enum { 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 ); }
@@ -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;
arch/powerpc/platforms/ps3/os-area.c +2 -2
@@ -501,7 +501,7 @@ static int db_set_64(struct os_area_db *db, const struct os_area_db_id *id,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) {struct db_iterator i;
@@ -517,7 +517,7 @@ static int db_get_64(const struct os_area_db *db,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); }
arch/powerpc/platforms/ps3/platform.h +7 -7
@@ -35,7 +35,7 @@ void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq);/* smp */ -void smp_init_ps3 (void ); +void __init smp_init_ps3 (void );#ifdef CONFIG_SMP void ps3_smp_cleanup_cpu (int cpu);#else
@@ -134,9 +134,9 @@ struct ps3_repository_device {int ps3_repository_find_device (struct ps3_repository_device *repo);int ps3_repository_find_device_by_id (struct ps3_repository_device *repo,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 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);int ps3_repository_find_interrupt (const struct ps3_repository_device *repo,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)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_id (u64 node_id,u64 *be_id); -int 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_tb_freq (u64 node_id,u64 *tb_freq); +int __init ps3_repository_read_be_tb_freq (unsigned int be_index,u64 *tb_freq);/* repository performance monitor info */
@@ -247,7 +247,7 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index,/* repository vuart info */ -int 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_av_port (unsigned int *port); +int __init ps3_repository_read_vuart_sysmgr_port (unsigned int *port);#endif
arch/powerpc/platforms/ps3/repository.c +10 -10
@@ -413,7 +413,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,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 result =0 ;
@@ -455,7 +455,7 @@ int ps3_repository_find_devices(enum ps3_bus_type bus_type,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 i;
@@ -908,7 +908,7 @@ int ps3_repository_read_boot_dat_size(unsigned int *size)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;u64 v1 =0 ;
@@ -923,7 +923,7 @@ int ps3_repository_read_vuart_av_port(unsigned int *port)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;u64 v1 =0 ;
@@ -1005,7 +1005,7 @@ int ps3_repository_read_be_id(u64 node_id, u64 *be_id) 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, make_first_field("be", 0),
@@ -1015,7 +1015,7 @@ int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq) 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;u64 node_id;
@@ -1178,7 +1178,7 @@ int ps3_repository_delete_highmem_info(unsigned int region_index)#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 ;unsigned int res_index;
@@ -1231,7 +1231,7 @@ int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)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 ;unsigned int num_regions, region_index;
@@ -1279,7 +1279,7 @@ static int dump_stor_dev_info(struct ps3_repository_device *repo)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) {int result =0 ;
@@ -1323,7 +1323,7 @@ static int dump_device_info(struct ps3_repository_device *repo,return result; } -int ps3_repository_dump_bus_info (void ) +int __init ps3_repository_dump_bus_info (void ) {int result =0 ;struct ps3_repository_device repo;
arch/powerpc/platforms/ps3/smp.c +1 -1
@@ -112,7 +112,7 @@ static struct smp_ops_t ps3_smp_ops = { .kick_cpu = smp_generic_kick_cpu, }; -void smp_init_ps3 (void ) +void __init smp_init_ps3 (void ) {DBG (" -> %s\n" , __func__); smp_ops = &ps3_smp_ops;
arch/powerpc/platforms/ps3/spu.c +1 -1
@@ -137,7 +137,7 @@ u64 ps3_get_spe_id(void *arg) }EXPORT_SYMBOL_GPL (ps3_get_spe_id); -static unsigned long get_vas_id (void ) +static unsigned long __init get_vas_id (void ) {u64 id;
Signature · 1 line
2.25.1
PATCH v2 14/20 powerpc/4xx: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/4xx' are deserving of an __init macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute.
--- arch/powerpc/platforms/4xx/cpm.c | 4 ++-- arch/powerpc/platforms/4xx/pci.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/platforms/4xx/cpm.c +2 -2
@@ -163,7 +163,7 @@ static ssize_t cpm_idle_store(struct kobject *kobj,static struct kobj_attribute cpm_idle_attr =__ATTR (idle,0644 , cpm_idle_show, cpm_idle_store); -static void cpm_idle_config_sysfs (void ) +static void __init cpm_idle_config_sysfs (void ) {struct device *dev;unsigned long ret;
@@ -231,7 +231,7 @@ static const struct platform_suspend_ops cpm_suspend_ops = { .enter = cpm_suspend_enter, }; -static int cpm_get_uint_property (struct device_node *np, +static int __init cpm_get_uint_property (struct device_node *np,const char *name) {int len;
arch/powerpc/platforms/4xx/pci.c +1 -1
@@ -1273,7 +1273,7 @@ static int __init ppc405ex_pciex_core_init(struct device_node *np)return 2 ; } -static void ppc405ex_pcie_phy_reset (struct ppc4xx_pciex_port *port) +static void __init ppc405ex_pcie_phy_reset (struct ppc4xx_pciex_port *port) {/* Assert the PE0_PHY reset */ mtdcri (SDR0 , port->sdr_base + PESDRn_RCSSET,0x01010000 );
Signature · 1 line
2.25.1
PATCH v2 15/20 powerpc/44x: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/44x/' are deserving of an __init macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute.
--- arch/powerpc/platforms/44x/fsp2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/44x/fsp2.c +2 -2
@@ -197,7 +197,7 @@ static irqreturn_t rst_wrn_handler(int irq, void *data) { } } -static void node_irq_request (const char *compat,irq_handler_t errirq_handler) +static void __init node_irq_request (const char *compat,irq_handler_t errirq_handler) {struct device_node *np;unsigned int irq;
@@ -222,7 +222,7 @@ static void node_irq_request(const char *compat, irq_handler_t errirq_handler) } } -static void critical_irq_setup (void ) +static void __init critical_irq_setup (void ) {node_irq_request (FSP2_CMU_ERR , cmu_err_handler);node_irq_request (FSP2_BUS_ERR , bus_err_handler);
Signature · 1 line
2.25.1
PATCH v2 16/20 powerpc/embedded6xx: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/embedded6xx' 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.
--- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 4 ++-- arch/powerpc/platforms/embedded6xx/hlwd-pic.h | 2 +- arch/powerpc/platforms/embedded6xx/holly.c | 2 +- arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 4 ++-- arch/powerpc/platforms/embedded6xx/wii.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +2 -2
@@ -153,7 +153,7 @@ static void __hlwd_quiesce(void __iomem *io_base)out_be32 (io_base +HW_BROADWAY_ICR ,0xffffffff ); } -static struct irq_domain *hlwd_pic_init (struct device_node *np) +static struct irq_domain *__init hlwd_pic_init (struct device_node *np) {struct irq_domain *irq_domain;struct resource res;
@@ -197,7 +197,7 @@ unsigned int hlwd_pic_get_irq(void)* */ -void hlwd_pic_probe (void ) +void __init hlwd_pic_probe (void ) {struct irq_domain *host;struct device_node *np;
arch/powerpc/platforms/embedded6xx/hlwd-pic.h +1 -1
@@ -11,7 +11,7 @@#define __HLWD_PIC_Hextern unsigned int hlwd_pic_get_irq (void ); -extern void hlwd_pic_probe (void ); +void __init hlwd_pic_probe (void );extern void hlwd_quiesce (void );#endif
arch/powerpc/platforms/embedded6xx/holly.c +1 -1
@@ -50,7 +50,7 @@ static int holly_exclude_device(struct pci_controller *hose, u_char bus,return PCIBIOS_SUCCESSFUL ; } -static void holly_remap_bridge (void ) +static void __init holly_remap_bridge (void ) {u32 lut_val, lut_addr;int i;
arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c +2 -2
@@ -194,7 +194,7 @@ static int ug_udbg_getc_poll(void)/* * Retrieves and prepares the virtual address needed to access the hardware. */ -static void __iomem *ug_udbg_setup_exi_io_base (struct device_node *np) +static void __iomem *__init ug_udbg_setup_exi_io_base (struct device_node *np) {void __iomem *exi_io_base =NULL ;phys_addr_t paddr;
@@ -212,7 +212,7 @@ static void __iomem *ug_udbg_setup_exi_io_base(struct device_node *np)/* * Checks if a USB Gecko adapter is inserted in any memory card slot. */ -static void __iomem *ug_udbg_probe (void __iomem *exi_io_base) +static void __iomem *__init ug_udbg_probe (void __iomem *exi_io_base) {int i;
arch/powerpc/platforms/embedded6xx/wii.c +1 -1
@@ -69,7 +69,7 @@ static void __noreturn wii_spin(void)cpu_relax (); } -static void __iomem *wii_ioremap_hw_regs (char *name,char *compatible) +static void __iomem *__init wii_ioremap_hw_regs (char *name,char *compatible) {void __iomem *hw_regs =NULL ;struct device_node *np;
Signature · 1 line
2.25.1
PATCH v2 17/20 powerpc/83xx: Add __init attribute to eligible functions
In reply to Nick ChildSome 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.
--- 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(-)
arch/powerpc/platforms/83xx/km83xx.c +1 -1
@@ -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:
arch/powerpc/platforms/83xx/mpc834x_mds.c +1 -1
@@ -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 ;
arch/powerpc/platforms/83xx/mpc837x_mds.c +1 -1
@@ -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;
arch/powerpc/platforms/83xx/mpc837x_rdb.c +1 -1
@@ -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;
arch/powerpc/platforms/83xx/mpc83xx.h +3 -3
@@ -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 ); +int __init mpc837x_usb_cfg (void ); +int __init mpc834x_usb_cfg (void ); +int __init mpc831x_usb_cfg (void );extern void mpc83xx_ipic_init_IRQ (void );#ifdef CONFIG_PCI
arch/powerpc/platforms/83xx/usb.c +3 -3
@@ -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 ;
Signature · 1 line
2.25.1
PATCH v2 18/20 powerpc/85xx: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/85xx' 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.
--- arch/powerpc/platforms/85xx/ge_imp3a.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 2 +- arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 2 +- arch/powerpc/platforms/85xx/socrates_fpga_pic.h | 2 +- arch/powerpc/platforms/85xx/xes_mpc85xx.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/platforms/85xx/ge_imp3a.c +1 -1
@@ -78,7 +78,7 @@ void __init ge_imp3a_pic_init(void)of_node_put (cascade_node); } -static void ge_imp3a_pci_assign_primary (void ) +static void __init ge_imp3a_pci_assign_primary (void ) {#ifdef CONFIG_PCI struct device_node *np;
arch/powerpc/platforms/85xx/mpc85xx_cds.c +1 -1
@@ -282,7 +282,7 @@ machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);#endif /* CONFIG_PPC_I8259 */ -static void mpc85xx_cds_pci_assign_primary (void ) +static void __init mpc85xx_cds_pci_assign_primary (void ) {#ifdef CONFIG_PCI struct device_node *np;
arch/powerpc/platforms/85xx/socrates_fpga_pic.c +1 -1
@@ -271,7 +271,7 @@ static const struct irq_domain_ops socrates_fpga_pic_host_ops = { .xlate = socrates_fpga_pic_host_xlate, }; -void socrates_fpga_pic_init (struct device_node *pic) +void __init socrates_fpga_pic_init (struct device_node *pic) {unsigned long flags;int i;
arch/powerpc/platforms/85xx/socrates_fpga_pic.h +1 -1
@@ -6,6 +6,6 @@#ifndef SOCRATES_FPGA_PIC_H #define SOCRATES_FPGA_PIC_H -void socrates_fpga_pic_init (struct device_node *pic); +void __init socrates_fpga_pic_init (struct device_node *pic);#endif
arch/powerpc/platforms/85xx/xes_mpc85xx.c +2 -2
@@ -45,7 +45,7 @@ void __init xes_mpc85xx_pic_init(void)mpic_init (mpic); } -static void xes_mpc85xx_configure_l2 (void __iomem *l2_base) +static void __init xes_mpc85xx_configure_l2 (void __iomem *l2_base) {volatile uint32_t ctl, tmp;
@@ -72,7 +72,7 @@ static void xes_mpc85xx_configure_l2(void __iomem *l2_base) asmvolatile ("msync; isync" ); } -static void xes_mpc85xx_fixups (void ) +static void __init xes_mpc85xx_fixups (void ) {struct device_node *np;int err;
Signature · 1 line
2.25.1
PATCH v2 19/20 powerpc/512x: Add __init attribute to eligible functions
In reply to Nick ChildSome functions defined in 'arch/powerpc/platforms/512x' 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.
--- arch/powerpc/platforms/512x/clock-commonclk.c | 52 +++++++++---------- arch/powerpc/platforms/512x/mpc512x.h | 4 +- arch/powerpc/platforms/512x/mpc512x_shared.c | 4 +- 3 files changed, 30 insertions(+), 30 deletions(-)
arch/powerpc/platforms/512x/clock-commonclk.c +26 -26
@@ -97,7 +97,7 @@ static enum soc_type { MPC512x_SOC_MPC5125, } soc; -static void mpc512x_clk_determine_soc (void ) +static void __init mpc512x_clk_determine_soc (void ) {if (of_machine_is_compatible ("fsl,mpc5121" )) { soc = MPC512x_SOC_MPC5121;
@@ -113,98 +113,98 @@ static void mpc512x_clk_determine_soc(void) } } -static bool soc_has_mbx (void ) +static bool __init soc_has_mbx (void ) {if (soc == MPC512x_SOC_MPC5121)return true;return false; } -static bool soc_has_axe (void ) +static bool __init soc_has_axe (void ) {if (soc == MPC512x_SOC_MPC5125)return false;return true; } -static bool soc_has_viu (void ) +static bool __init soc_has_viu (void ) {if (soc == MPC512x_SOC_MPC5125)return false;return true; } -static bool soc_has_spdif (void ) +static bool __init soc_has_spdif (void ) {if (soc == MPC512x_SOC_MPC5125)return false;return true; } -static bool soc_has_pata (void ) +static bool __init soc_has_pata (void ) {if (soc == MPC512x_SOC_MPC5125)return false;return true; } -static bool soc_has_sata (void ) +static bool __init soc_has_sata (void ) {if (soc == MPC512x_SOC_MPC5125)return false;return true; } -static bool soc_has_pci (void ) +static bool __init soc_has_pci (void ) {if (soc == MPC512x_SOC_MPC5125)return false;return true; } -static bool soc_has_fec2 (void ) +static bool __init soc_has_fec2 (void ) {if (soc == MPC512x_SOC_MPC5125)return true;return false; } -static int soc_max_pscnum (void ) +static int __init soc_max_pscnum (void ) {if (soc == MPC512x_SOC_MPC5125)return 10 ;return 12 ; } -static bool soc_has_sdhc2 (void ) +static bool __init soc_has_sdhc2 (void ) {if (soc == MPC512x_SOC_MPC5125)return true;return false; } -static bool soc_has_nfc_5125 (void ) +static bool __init soc_has_nfc_5125 (void ) {if (soc == MPC512x_SOC_MPC5125)return true;return false; } -static bool soc_has_outclk (void ) +static bool __init soc_has_outclk (void ) {if (soc == MPC512x_SOC_MPC5125)return true;return false; } -static bool soc_has_cpmf_0_bypass (void ) +static bool __init soc_has_cpmf_0_bypass (void ) {if (soc == MPC512x_SOC_MPC5125)return true;return false; } -static bool soc_has_mclk_mux0_canin (void ) +static bool __init soc_has_mclk_mux0_canin (void ) {if (soc == MPC512x_SOC_MPC5125)return true;
@@ -294,7 +294,7 @@ static inline int get_bit_field(uint32_t __iomem *reg, uint8_t pos, uint8_t len) }/* get the SPMF and translate it into the "sys pll" multiplier */ -static int get_spmf_mult (void ) +static int __init get_spmf_mult (void ) {static int spmf_to_mult[] = {68 ,1 ,12 ,16 ,20 ,24 ,28 ,32 ,
@@ -312,7 +312,7 @@ static int get_spmf_mult(void)* values returned from here are a multiple of the real factor since the * divide ratio is fractional */ -static int get_sys_div_x2 (void ) +static int __init get_sys_div_x2 (void ) {static int sysdiv_code_to_x2[] = {4 ,5 ,6 ,7 ,8 ,9 ,10 ,14 ,
@@ -333,7 +333,7 @@ static int get_sys_div_x2(void)* values returned from here are a multiple of the real factor since the * multiplier ratio is fractional */ -static int get_cpmf_mult_x2 (void ) +static int __init get_cpmf_mult_x2 (void ) {static int cpmf_to_mult_x36[] = {/* 0b000 is "times 36" */
@@ -379,7 +379,7 @@ static const struct clk_div_table divtab_1234[] = { { .div = 0, }, }; -static int get_freq_from_dt (char *propname) +static int __init get_freq_from_dt (char *propname) {struct device_node *np;const unsigned int *prop;
@@ -396,7 +396,7 @@ static int get_freq_from_dt(char *propname)return val; } -static void mpc512x_clk_preset_data (void ) +static void __init mpc512x_clk_preset_data (void ) {size_t i;
@@ -418,7 +418,7 @@ static void mpc512x_clk_preset_data(void)* SYS -> CSB -> IPS) from the REF clock rate and the returned mul/div * values */ -static void mpc512x_clk_setup_ref_clock (struct device_node *np,int bus_freq, +static void __init mpc512x_clk_setup_ref_clock (struct device_node *np,int bus_freq,int *sys_mul,int *sys_div,int *ips_div) {
@@ -592,7 +592,7 @@ static struct mclk_setup_data mclk_outclk_data[] = { };/* setup the MCLK clock subtree of an individual PSC/MSCAN/SPDIF */ -static void mpc512x_clk_setup_mclk (struct mclk_setup_data *entry,size_t idx) +static void __init mpc512x_clk_setup_mclk (struct mclk_setup_data *entry,size_t idx) {size_t clks_idx_pub, clks_idx_int;u32 __iomem *mccr_reg;/* MCLK control register (mux, en, div) */
@@ -701,7 +701,7 @@ static void mpc512x_clk_setup_mclk(struct mclk_setup_data *entry, size_t idx)/* }}} MCLK helpers */ -static void mpc512x_clk_setup_clock_tree (struct device_node *np,int busfreq) +static void __init mpc512x_clk_setup_clock_tree (struct device_node *np,int busfreq) {int sys_mul, sys_div, ips_div;int mul, div;
@@ -937,7 +937,7 @@ static void mpc512x_clk_setup_clock_tree(struct device_node *np, int busfreq)* registers the set of public clocks (those listed in the dt-bindings/ * header file) for OF lookups, keeps the intermediates private to us */ -static void mpc5121_clk_register_of_provider (struct device_node *np) +static void __init mpc5121_clk_register_of_provider (struct device_node *np) { clk_data.clks = clks; clk_data.clk_num = MPC512x_CLK_LAST_PUBLIC +1 ;/* _not_ ARRAY_SIZE() */
@@ -948,7 +948,7 @@ static void mpc5121_clk_register_of_provider(struct device_node *np)* temporary support for the period of time between introduction of CCF * support and the adjustment of peripheral drivers to OF based lookups */ -static void mpc5121_clk_provide_migration_support (void ) +static void __init mpc5121_clk_provide_migration_support (void ) {/*
@@ -1009,7 +1009,7 @@ static void mpc5121_clk_provide_migration_support(void)* case of not yet adjusted device tree data, where clock related specs * are missing) */ -static void mpc5121_clk_provide_backwards_compat (void ) +static void __init mpc5121_clk_provide_backwards_compat (void ) {enum did_reg_flags {DID_REG_PSC =BIT (0 ),
arch/powerpc/platforms/512x/mpc512x.h +2 -2
@@ -12,8 +12,8 @@ extern void __init mpc512x_init_early(void);extern void __init mpc512x_init (void );extern void __init mpc512x_setup_arch (void );extern int __init mpc5121_clk_init (void ); -extern const char *mpc512x_select_psc_compat (void ); -extern const char *mpc512x_select_reset_compat (void ); +const char *__init mpc512x_select_psc_compat (void ); +const char *__init mpc512x_select_reset_compat (void );extern void __noreturn mpc512x_restart (char *cmd);#endif /* __MPC512X_H__ */
arch/powerpc/platforms/512x/mpc512x_shared.c +2 -2
@@ -352,7 +352,7 @@ static void __init mpc512x_declare_of_platform_devices(void)#define DEFAULT_FIFO_SIZE 16 -const char *mpc512x_select_psc_compat (void ) +const char *__init mpc512x_select_psc_compat (void ) {if (of_machine_is_compatible ("fsl,mpc5121" ))return "fsl,mpc5121-psc" ;
@@ -363,7 +363,7 @@ const char *mpc512x_select_psc_compat(void)return NULL ; } -const char *mpc512x_select_reset_compat (void ) +const char *__init mpc512x_select_reset_compat (void ) {if (of_machine_is_compatible ("fsl,mpc5121" ))return "fsl,mpc5121-reset" ;
Signature · 1 line
2.25.1
PATCH v2 20/20 cuda/pmu: Make find_via_cuda/pmu init functions
In reply to Nick ChildMake find_via_cuda and find_via_pmu initialization functions. Previously, their definitions in drivers/macintosh/via-cuda.h include the __init attribute but their alternative definitions in arch/powerpc/powermac/sectup./c and prototypes in include/linux/ cuda.h and include/linux/pmu.h do not use the __init macro. Since, only initialization functions call find_via_cuda and find_via_pmu it is safe to label these functions with __init.
--- arch/powerpc/platforms/powermac/setup.c | 4 ++-- include/linux/cuda.h | 2 +- include/linux/pmu.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/powermac/setup.c +2 -2
@@ -166,7 +166,7 @@ static void pmac_show_cpuinfo(struct seq_file *m) }#ifndef CONFIG_ADB_CUDA -int find_via_cuda (void ) +int __init find_via_cuda (void ) {struct device_node *dn =of_find_node_by_name (NULL ,"via-cuda" );
@@ -180,7 +180,7 @@ int find_via_cuda(void)#endif #ifndef CONFIG_ADB_PMU -int find_via_pmu (void ) +int __init find_via_pmu (void ) {struct device_node *dn =of_find_node_by_name (NULL ,"via-pmu" );
include/linux/cuda.h +1 -1
@@ -12,7 +12,7 @@#include <uapi/linux/cuda.h> -extern int find_via_cuda (void ); +extern int __init find_via_cuda (void );extern int cuda_request (struct adb_request *req,void (*done)(struct adb_request *),int nbytes, ...);extern void cuda_poll (void );
include/linux/pmu.h +1 -1
@@ -13,7 +13,7 @@#include <uapi/linux/pmu.h> -extern int find_via_pmu (void ); +extern int __init find_via_pmu (void );extern int pmu_request (struct adb_request *req,void (*done)(struct adb_request *),int nbytes, ...);
Signature · 1 line
2.25.1
Le 16/12/2021 à 23:00, Nick Child a écrit :
Quoted 5 lines
Changes in v2:
- add__initin prototypes right before the funtion name instead of at the end.
- respond to./scripts/checkpatchfeedback
You probably missed the following comment from checkpatch:
WARNING: From:/Signed-off-by: email address mismatch: 'From: Nick Child <[email protected]>' != 'Signed-off-by: Nick Child <[email protected]>'
Sending from a different address is possible, but you then must add
From: Nick Child <[email protected]>
at the top of the commit message.
'git format-patch' should be able to do it for you with the good option.
Christophe
Michael Ellerman
reviewerQuoted 11 lines · Christophe Leroy
Le 16/12/2021 à 23:00, Nick Child a écrit :
Quoted 5 lines
Changes in v2:
- add__initin prototypes right before the funtion name instead of at the end.
- respond to./scripts/checkpatchfeedbackYou probably missed the following comment from checkpatch:
WARNING: From:/Signed-off-by: email address mismatch: 'From: Nick Child <[email protected]>' != 'Signed-off-by: Nick Child <[email protected]>'
I fixed it up when applying to use Nick's IBM address as the author.
Quoted 7 lines
Sending from a different address is possible, but you then must add
From: Nick Child <[email protected]>
at the top of the commit message.
'git format-patch' should be able to do it for you with the good option.
Yeah, Nick please teach git format-patch/send-email to use the right address for future series. If you need any help just let me know.
cheers
Michael Ellerman
AppliedQuoted 14 lines · Nick Child
This patchset focuses on redefining/declaring functions that could be labeled with the macro
__init. From my understanding, an initialization function is one which is only needed during the initial phases of booting, after which it's resources can be freed. I figure that any function which is only called by other initialization functions may also be labeled as an initialization function. There are several (mostly static) functions which can and should be labeled as__init. I created some scripts to help identify these functions. It scans all functions defined inarch/powerpcand, if it is only called by functions with the__initattribute, it will go on to adjust the prototype and definition to include the__initdeclaration. This patchset hopes to solve related issue #282:
https://github.com/linuxppc/issues/issues/282
Quoted 1 line
[...]
Applied to powerpc/next.
[01/20] powerpc/kernel: Add __init attribute to eligible functions
https://git.kernel.org/powerpc/c/d276960d9296b6a9074795fe60a513abf8474e35 [02/20] powerpc/lib: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/ce0c6be9c69883df38e7631d1d7364b52f6db135 [03/20] powerpc/mm: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/c13f2b2bb5afd90f152c389c1c9245a0d43bce80 [04/20] powerpc/perf: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/c49f5d88ff0166ffa4e48ee8ce84d63719f346be [05/20] powerpc/sysdev: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/6c552983d0e65a8c923dfacc4f69b694205672c1 [06/20] powerpc/xmon: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/456e8eb324a47573b377f7041f4c038fac403f86 [07/20] powerpc/cell: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/7c1ab16b2d035c6bc3b6b6980ab7e72f547edc45 [08/20] powerpc/chrp: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/d3aa3c5edf0cb7ac0b0b5b0d144bba60b0ee77da [09/20] powerpc/pasemi: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/e37e06af9b0d6b7828159455d33f8ef45c456460 [10/20] powerpc/powermac: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/b346f57100e9417f23ee9051f0efe621a492be96 [11/20] powerpc/powernv: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/e5913db1ef22817e128f0a794752f7393205e00b [12/20] powerpc/pseries: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/e14ff96d08f0ade9dd33081d909ad65a02a858c1 [13/20] powerpc/ps3: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/f1ba9b9474a9e32b9c173c91e71f713bfa7b2463 [14/20] powerpc/4xx: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/1e3d992d213928851f7ddec6f150fb54fe759b64 [15/20] powerpc/44x: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/1ee969be25ed21a1192ca569ad827013eb7fac04 [16/20] powerpc/embedded6xx: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/c0dc225ae7dd9f01d46ea779f7f169d49aa59b78 [17/20] powerpc/83xx: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/f4a88b0ef5c5f7ce218aced7d811a31dd311a0b0 [18/20] powerpc/85xx: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/407454cafd3f1878dae6bb839d8bac2db264300f [19/20] powerpc/512x: Add __init attribute to eligible functions https://git.kernel.org/powerpc/c/2493a24271dab3d5c1235a13cf6ee2d12773c9a1 [20/20] cuda/pmu: Make find_via_cuda/pmu init functions https://git.kernel.org/powerpc/c/7da1d1ddd1f02e5de7497a0c849256912652fb6c
cheers