__initdata cleanup
Subsystems (28)
cover __initdata cleanup
Follow-up Russell King comment at http://lkml.org/lkml/2007/1/22/267
All __initdata variables should be initialized so they won't end up in BSS.
There is no dependency between patches or even hunks.
Some architecture patches are untested, this is documented as "UNTESTED"
Against 2.6.20-rc6-mm3.
---
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 1/34 __initdata cleanup - alpha
Trivial.
---
arch/alpha/kernel/setup.c +1 -1
@@ -122,7 +122,7 @@ static void get_sysnames(unsigned long, char **, char **);static void determine_cpu_caches (unsigned int ); -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;/* * The format of "screen_info" is strange, and due to early
arch/alpha/kernel/smc37c669.c +2 -2
@@ -996,7 +996,7 @@ static SMC37c669_CONFIG_REGS *SMC37c669** and standard ISA IRQs. ** */ -static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table__initdata ; +static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table__initdata =NULL ;/* ** The following definition is for the default IRQ
@@ -1045,7 +1045,7 @@ static SMC37c669_IRQ_TRANSLATION_ENTRY *** ISA DMA channels. ** */ -static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table__initdata ; +static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table__initdata =NULL ;/* ** The following definition is the default DRQ
Re: [PATCH 01/34] __initdata cleanup - alpha
Alon Bar-Lev napsal(a):
Quoted 11 lines
Trivial.
Signed-off-by Alon Bar-Lev <[email protected]>Signed-off-by Bernhard Walle <[email protected]>---
diff -urNp
linux-2.6.20-rc6-mm3.org/arch/alpha/kernel/setup.clinux-2.6.20-rc6-mm3/arch/alpha/kernel/setup.c
arch/alpha/kernel/setup.c static void get_sysnames(unsigned long, · line 125
Quoted 5 lines
arch/alpha/kernel/setup.c +1
-1@@ -122,7 +122,7 @@ static void get_sysnames(unsigned long, char **, char **);static void determine_cpu_caches (unsigned int ); -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;
Why is this "= 0" to static global variables needed?
regards,
Signature · 4 lines
http://www.fi.muni.cz/~xslaby/ Jiri Slaby faculty of informatics, masaryk university, brno, cz e-mail: jirislaby gmail com, gpg pubkey fingerprint: B674 9967 0407 CE62 ACC8 22A0 32CC 55C3 39D4 7A7E
Re: [PATCH 01/34] __initdata cleanup - alpha
Quoted 4 lines · Jiri Slaby
arch/alpha/kernel/setup.c static void get_sysnames(unsigned long, · line 125
Quoted 2 lines
arch/alpha/kernel/setup.c +1
-1-static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;Why is this "= 0" to static global variables needed?
Please review http://lkml.org/lkml/2007/1/22/267
Best Regards,
Alon Bar-Lev.
Re: [PATCH 01/34] __initdata cleanup - alpha
Alon Bar-Lev napsal(a):
Quoted 7 lines · Jiri Slaby
Quoted 4 lines
arch/alpha/kernel/setup.c static void get_sysnames(unsigned long, · line 125
Quoted 2 lines
arch/alpha/kernel/setup.c +1
-1-static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;Why is this "= 0" to static global variables needed?
Please review http://lkml.org/lkml/2007/1/22/267
Ok, thanks,
Signature · 4 lines
http://www.fi.muni.cz/~xslaby/ Jiri Slaby faculty of informatics, masaryk university, brno, cz e-mail: jirislaby gmail com, gpg pubkey fingerprint: B674 9967 0407 CE62 ACC8 22A0 32CC 55C3 39D4 7A7E
PATCH 2/34 __initdata cleanup - arm
In reply to Alon Bar-LevTrivial.
---
arch/arm/kernel/setup.c +2 -2
@@ -106,7 +106,7 @@ unsigned long phys_initrd_size __initdatstatic struct meminfo meminfo__initdata = {0 , };static const char *cpu_name;static const char *machine_name; -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;static char default_command_line[COMMAND_LINE_SIZE ]__initdata =CONFIG_CMDLINE ;static union {char c[4 ];unsigned long l; } endian_test__initdata = { {'l' ,'?' ,'?' ,'b' } };
@@ -753,7 +753,7 @@ static struct init_tags { { 0, ATAG_NONE } }; -static void (*init_machine)(void )__initdata ; +static void (*init_machine)(void )__initdata =NULL ;static int __init customize_machine (void ) {
arch/arm26/kernel/setup.c +1 -1
@@ -80,7 +80,7 @@ unsigned long phys_initrd_size __initdatstatic struct meminfo meminfo__initdata = {0 , };static struct proc_info_item proc_info;static const char *machine_name; -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;static char default_command_line[COMMAND_LINE_SIZE ]__initdata =CONFIG_CMDLINE ;
PATCH 3/34 __initdata cleanup - avr32
In reply to Alon Bar-LevTrivial.
**NOT TESTED***
---
arch/avr32/boards/atstk1000/atstk1002.c +2 -2
@@ -27,9 +27,9 @@ struct eth_addr {u8 addr[6 ]; }; -static struct eth_addr __initdata hw_addr[2 ]; +static struct eth_addr __initdata hw_addr[2 ] = {{{0 }}}; -static struct eth_platform_data __initdata eth_data[2 ]; +static struct eth_platform_data __initdata eth_data[2 ] = {{0 }};extern struct lcdc_platform_data atstk1000_fb0_data;static struct spi_board_info spi_board_info[]__initdata = {
arch/avr32/boards/atstk1000/setup.c +2 -2
@@ -17,9 +17,9 @@#include <asm/arch/board.h> /* Initialized by bootloader-specific startup code. */ -struct tag *bootloader_tags__initdata ; +struct tag *bootloader_tags__initdata =NULL ; -struct lcdc_platform_data __initdata atstk1000_fb0_data; +struct lcdc_platform_data __initdata atstk1000_fb0_data = {0 };void __init board_setup_fbmem (unsigned long fbmem_start,unsigned long fbmem_size)
arch/avr32/kernel/setup.c +4 -4
@@ -44,13 +44,13 @@ struct avr32_cpuinfo boot_cpu_data = { };EXPORT_SYMBOL (boot_cpu_data); -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;/* * Should be more than enough, but if you have a _really_ complex * setup, you might need to increase the size of this... */ -static struct tag_mem_range __initdata mem_range_cache[32 ]; +static struct tag_mem_range __initdata mem_range_cache[32 ] = {{0 }};static unsigned mem_range_next_free;/*
@@ -87,8 +87,8 @@ static struct resource mem_res[] = {* Board-specific code may use these variables to set up platform data * for the framebuffer driver if fbmem_size is nonzero. */ -static unsigned long __initdata fbmem_start; -static unsigned long __initdata fbmem_size; +static unsigned long __initdata fbmem_start =0l ; +static unsigned long __initdata fbmem_size =0l ;/* * "fbmem=xxx[kKmM]" allocates the specified amount of boot memory for
PATCH 4/34 __initdata cleanup - frv
In reply to Alon Bar-LevTrivial.
---
arch/frv/kernel/setup.c +4 -4
@@ -105,13 +105,13 @@ unsigned long __nongprelbss memory_end;unsigned long __nongprelbss dma_coherent_mem_start;unsigned long __nongprelbss dma_coherent_mem_end; -unsigned long __initdata __sdram_old_base; -unsigned long __initdata num_mappedpages; +unsigned long __initdata __sdram_old_base =0l ; +unsigned long __initdata num_mappedpages =0l ; struct cpuinfo_frv __nongprelbss boot_cpu_data; -char __initdata command_line[COMMAND_LINE_SIZE ]; -char __initdata redboot_command_line[COMMAND_LINE_SIZE ]; +char __initdata command_line[COMMAND_LINE_SIZE ] ="" ; +char __initdata redboot_command_line[COMMAND_LINE_SIZE ] ="" ;#ifdef CONFIG_PM #define __pminit
PATCH 5/34 __initdata cleanup - h8300
In reply to Alon Bar-LevTrivial.
---
arch/h8300/kernel/setup.c +1 -1
@@ -54,7 +54,7 @@ unsigned long rom_length;unsigned long memory_start;unsigned long memory_end; -char __initdata command_line[COMMAND_LINE_SIZE ]; +char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;extern int _ramstart, _ramend;
PATCH 6/34 __initdata cleanup - i386
In reply to Alon Bar-LevTrivial.
---
arch/i386/kernel/acpi/boot.c +5 -5
@@ -72,7 +72,7 @@ static inline int acpi_madt_oem_check(ch#define PREFIX "ACPI: "int acpi_noirq;/* skip ACPI IRQ initialization */ -int acpi_pci_disabled__initdata ;/* skip ACPI PCI scan and IRQ initialization */ +int acpi_pci_disabled__initdata =0 ;/* skip ACPI PCI scan and IRQ initialization */ int acpi_ht__initdata =1 ;/* enable HT */ int acpi_lapic;
@@ -80,10 +80,10 @@ int acpi_ioapic;int acpi_strict;EXPORT_SYMBOL (acpi_strict); -u8 acpi_sci_flags__initdata ; -int acpi_sci_override_gsi__initdata ; -int acpi_skip_timer_override__initdata ; -int acpi_use_timer_override__initdata ; +u8 acpi_sci_flags__initdata =0 ; +int acpi_sci_override_gsi__initdata =0 ; +int acpi_skip_timer_override__initdata =0 ; +int acpi_use_timer_override__initdata =0 ;#ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr__initdata =APIC_DEFAULT_PHYS_BASE ;
arch/i386/kernel/acpi/earlyquirk.c +1 -1
@@ -13,7 +13,7 @@#ifdef CONFIG_ACPI -static int nvidia_hpet_detected__initdata ; +static int nvidia_hpet_detected__initdata =0 ;static int __init nvidia_hpet_check (struct acpi_table_header *header) {
arch/i386/kernel/cpu/mtrr/generic.c +1 -1
@@ -26,7 +26,7 @@ static struct mtrr_state mtrr_state = {}#undef MODULE_PARAM_PREFIX#define MODULE_PARAM_PREFIX "mtrr." -static __initdata int mtrr_show; +static __initdata int mtrr_show =0 ;module_param_named (show, mtrr_show, bool,0 );/* Get the MSR pair relating to a var range */
arch/i386/kernel/e820.c +4 -4
@@ -26,10 +26,10 @@ struct change_member {struct e820entry *pbios;/* pointer to original bios entry */ unsigned long long addr;/* address for this change point */ }; -static struct change_member change_point_list[2 *E820MAX ]__initdata ; -static struct change_member *change_point[2 *E820MAX ]__initdata ; -static struct e820entry *overlap_list[E820MAX ]__initdata ; -static struct e820entry new_bios[E820MAX ]__initdata ; +static struct change_member change_point_list[2 *E820MAX ]__initdata = {{0 }}; +static struct change_member *change_point[2 *E820MAX ]__initdata = {0 }; +static struct e820entry *overlap_list[E820MAX ]__initdata = {0 }; +static struct e820entry new_bios[E820MAX ]__initdata = {{0 }};/* For PCI or other memory-mapped resources */ unsigned long pci_mem_start =0x10000000 ;#ifdef CONFIG_PCI
arch/i386/kernel/io_apic.c +2 -2
@@ -72,7 +72,7 @@ int sis_apic_bug = -1;*/ int nr_ioapic_registers[MAX_IO_APICS ]; -static int disable_timer_pin_1__initdata ; +static int disable_timer_pin_1__initdata =0 ;/* * Rough estimation of how many shared IRQs there are, can
@@ -1920,7 +1920,7 @@ static void __init setup_ioapic_ids_fromstatic void __init setup_ioapic_ids_from_mpc (void ) { }#endif -int no_timer_check__initdata ; +int no_timer_check__initdata =0 ;static int __init notimercheck (char *s) {
arch/i386/kernel/setup.c +2 -2
@@ -133,9 +133,9 @@ unsigned long saved_videomode;#define RAMDISK_PROMPT_FLAG 0x8000#define RAMDISK_LOAD_FLAG 0x4000 -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ; -unsigned char __initdata boot_params[PARAM_SIZE ]; +unsigned char __initdata boot_params[PARAM_SIZE ] = {0 };#if defined(CONFIG_EDD ) || defined(CONFIG_EDD_MODULE )struct edd edd;
arch/i386/kernel/srat.c +1 -1
@@ -55,7 +55,7 @@ struct node_memory_chunk_s {static struct node_memory_chunk_s node_memory_chunk[MAXCHUNKS ];static int num_memory_chunks;/* total number of memory chunks */ -static u8 __initdata apicid_to_pxm[MAX_APICID ]; +static u8 __initdata apicid_to_pxm[MAX_APICID ] = {0 };extern void *boot_ioremap (unsigned long ,unsigned long );
arch/i386/kernel/summit.c +3 -3
@@ -31,9 +31,9 @@#include <asm/io.h> #include <asm/mach-summit/mach_mpparse.h> -static struct rio_table_hdr *rio_table_hdr__initdata ; -static struct scal_detail *scal_devs[MAX_NUMNODES ]__initdata ; -static struct rio_detail *rio_devs[MAX_NUMNODES *4 ]__initdata ; +static struct rio_table_hdr *rio_table_hdr__initdata =NULL ; +static struct scal_detail *scal_devs[MAX_NUMNODES ]__initdata = {0 }; +static struct rio_detail *rio_devs[MAX_NUMNODES *4 ]__initdata = {0 };static int __init setup_pci_node_map_for_wpeg (int wpeg_num,int last_bus) {
arch/i386/mach-generic/probe.c +1 -1
@@ -30,7 +30,7 @@ struct genapic *apic_probe[] __initdata NULL, }; -static int cmdline_apic__initdata ; +static int cmdline_apic__initdata =0 ;static int __init parse_apic (char *arg) {int i;
arch/i386/mach-voyager/voyager_cat.c +1 -1
@@ -561,7 +561,7 @@ cat_subread(voyager_module_t *modp, voya/* buffer for storing EPROM data read in during initialisation */ -static __initdata __u8 eprom_buf[0xFFFF ]; +static __initdata __u8 eprom_buf[0xFFFF ] = {0 };static voyager_module_t *voyager_initial_module;/* Initialise the cat bus components. We assume this is called by the
arch/i386/mm/boot_ioremap.c +1 -1
@@ -65,7 +65,7 @@ static void __boot_ioremap(unsigned long#define BOOT_IOREMAP_PAGES 4#define BOOT_IOREMAP_SIZE (BOOT_IOREMAP_PAGES*PAGE_SIZE) static __initdata char boot_ioremap_space[BOOT_IOREMAP_SIZE] - __attribute__ ((aligned (PAGE_SIZE))); + __attribute__ ((aligned (PAGE_SIZE))) = {0};/* * This only applies to things which need to ioremap before paging_init()
PATCH 7/34 __initdata cleanup - ia64
In reply to Alon Bar-LevTrivial.
---
arch/ia64/kernel/acpi.c +7 -7
@@ -158,9 +158,9 @@ char *__acpi_map_table(unsigned long phyBoot-time Table Parsing -------------------------------------------------------------------------- */ -static int total_cpus__initdata ; -static int available_cpus__initdata ; -struct acpi_table_madt *acpi_madt__initdata ; +static int total_cpus__initdata =0 ; +static int available_cpus__initdata =0 ; +struct acpi_table_madt *acpi_madt__initdata =NULL ;static u8 has_8259; static int __init
@@ -229,7 +229,7 @@ acpi_parse_iosapic(struct acpi_subtable_return iosapic_init (iosapic->address, iosapic->global_irq_base); } -static unsigned int __initdata acpi_madt_rev; +static unsigned int __initdata acpi_madt_rev =0 ; static int __init acpi_parse_plat_int_src(struct acpi_subtable_header * header,
@@ -401,11 +401,11 @@ static int __init acpi_parse_madt(struct#define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32) -static int __initdata srat_num_cpus;/* number of cpus */ -static u32 __devinitdata pxm_flag[PXM_FLAG_LEN ]; +static int __initdata srat_num_cpus =0 ;/* number of cpus */ +static u32 __devinitdata pxm_flag[PXM_FLAG_LEN ] = {0 };#define pxm_bit_set (bit) (set_bit(bit,(void *)pxm_flag))#define pxm_bit_test (bit) (test_bit(bit,(void *)pxm_flag)) -static struct acpi_table_slit __initdata *slit_table; +static struct acpi_table_slit __initdata *slit_table =NULL ;static int get_processor_proximity_domain (struct acpi_srat_cpu_affinity *pa) {
arch/ia64/kernel/machvec.c +1 -1
@@ -13,7 +13,7 @@struct ia64_machine_vector ia64_mv;EXPORT_SYMBOL (ia64_mv); -static __initdata const char *mvec_name; +static __initdata const char *mvec_name =NULL ;static __init int setup_mvec (char *s) { mvec_name = s;
arch/ia64/kernel/mca.c +1 -1
@@ -138,7 +138,7 @@ static int cpe_poll_enabled = 1;extern void salinfo_log_wakeup (int type,u8 *buffer,u64 size,int irqsafe); -static int mca_init__initdata ; +static int mca_init__initdata =0 ;/* * limited & delayed printing support for MCA/INIT handler
arch/ia64/kernel/setup.c +3 -3
@@ -131,8 +131,8 @@ EXPORT_SYMBOL(ia64_max_iommu_merge_mask)/* * We use a special marker for the end of memory and it uses the extra (+1) slot */ -struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS +1 ]__initdata ; -int num_rsvd_regions__initdata ; +struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS +1 ]__initdata = {{0 }}; +int num_rsvd_regions__initdata =0 ;/*
@@ -432,7 +432,7 @@ check_for_logical_procs (void) }#endif -static __initdata int nomca; +static __initdata int nomca =0 ;static __init int setup_nomca (char *s) { nomca =1 ;
arch/ia64/kernel/smpboot.c +2 -2
@@ -148,11 +148,11 @@ EXPORT_SYMBOL(ia64_cpu_to_sapicid);static volatile cpumask_t cpu_callin_map; -struct smp_boot_data smp_boot_data__initdata ; +struct smp_boot_data smp_boot_data__initdata = {0 };unsigned long ap_wakeup_vector =-1 ;/* External Int use to wakeup APs */ -char __initdata no_int_routing; +char __initdata no_int_routing =0 ;unsigned char smp_int_redirect;/* are INT and IPI redirectable by the chipset? */
arch/ia64/mm/discontig.c +2 -2
@@ -44,8 +44,8 @@ struct early_node_data {unsigned long max_pfn; }; -static struct early_node_data mem_data[MAX_NUMNODES ]__initdata ; -static nodemask_t memory_less_mask__initdata ; +static struct early_node_data mem_data[MAX_NUMNODES ]__initdata = {{0 }}; +static nodemask_t memory_less_mask__initdata = {{0 }};static pg_data_t *pgdat_list[MAX_NUMNODES ];
arch/ia64/mm/init.c +1 -1
@@ -656,7 +656,7 @@ count_reserved_pages (u64 start, u64 end* purposes. */ -static int nolwsys__initdata ; +static int nolwsys__initdata =0 ;static int __init nolwsys_setup (char *s)
arch/ia64/sn/kernel/setup.c +1 -1
@@ -194,7 +194,7 @@ void __init early_sn_setup(void) }extern int platform_intr_list[]; -static int __initdata shub_1_1_found; +static int __initdata shub_1_1_found =0 ;/* * sn_check_for_wars
PATCH 8/34 __initdata cleanup - m32r
In reply to Alon Bar-LevTrivial.
**NOT TESTED***
---
arch/m32r/kernel/setup.c +1 -1
@@ -64,7 +64,7 @@ struct screen_info screen_info = {extern int root_mountflags; -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;static struct resource data_resource = { .name ="Kernel data" ,
arch/m32r/mm/discontig.c +1 -1
@@ -20,7 +20,7 @@ extern char _end[];struct pglist_data *node_data[MAX_NUMNODES ];EXPORT_SYMBOL (node_data); -static bootmem_data_t node_bdata[MAX_NUMNODES ]__initdata ; +static bootmem_data_t node_bdata[MAX_NUMNODES ]__initdata = {{0 }};pg_data_t m32r_node_data[MAX_NUMNODES ];
PATCH 9/34 __initdata cleanup - m68knommu
In reply to Alon Bar-LevTrivial.
---
arch/m68knommu/kernel/setup.c +1 -1
@@ -44,7 +44,7 @@ unsigned long memory_end;EXPORT_SYMBOL (memory_start);EXPORT_SYMBOL (memory_end); -char __initdata command_line[COMMAND_LINE_SIZE ]; +char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;/* setup some dummy routines */ static void dummy_waitbut (void )
PATCH 10/34 __initdata cleanup - mips
In reply to Alon Bar-LevTrivial.
---
arch/mips/kernel/traps.c +1 -1
@@ -1432,7 +1432,7 @@ void __init set_uncached_handler (unsignmemcpy ((void *)(uncached_ebase + offset), addr, size); } -static int __initdata rdhwr_noopt; +static int __initdata rdhwr_noopt =0 ;static int __init set_rdhwr_noopt (char *str) { rdhwr_noopt =1 ;
arch/mips/mm/pg-r4k.c +5 -5
@@ -67,13 +67,13 @@ EXPORT_SYMBOL(copy_page);static int pref_offset_clear__initdata =512 ;static int pref_offset_copy__initdata =256 ; -static unsigned int pref_src_mode__initdata ; -static unsigned int pref_dst_mode__initdata ; +static unsigned int pref_src_mode__initdata =0 ; +static unsigned int pref_dst_mode__initdata =0 ; -static int load_offset__initdata ; -static int store_offset__initdata ; +static int load_offset__initdata =0 ; +static int store_offset__initdata =0 ; -static unsigned int __initdata *dest, *epc; +static unsigned int __initdata *dest =NULL , *epc =NULL ;static unsigned int instruction_pending;static union mips_instruction delayed_mi;
arch/mips/mm/tlbex.c +4 -4
@@ -728,11 +728,11 @@ il_bgez(u32 **p, struct reloc **r, unsig* We deliberately chose a buffer size of 128, so we won't scribble * over anything important on overflow before we panic. */ -static __initdata u32 tlb_handler[128 ]; +static __initdata u32 tlb_handler[128 ] = {0 };/* simply assume worst case size for labels and relocs */ -static __initdata struct label labels[128 ]; -static __initdata struct reloc relocs[128 ]; +static __initdata struct label labels[128 ] = {{NULL }}; +static __initdata struct reloc relocs[128 ] = {{NULL }};/* * The R3000 TLB handler is simple.
@@ -786,7 +786,7 @@ static void __init build_r3000_tlb_refil* other one.To keep things simple, we first assume linear space, * then we relocate it to the final handler layout as needed. */ -static __initdata u32 final_handler[64 ]; +static __initdata u32 final_handler[64 ] = {0 };/* * Hazards
arch/mips/mm/tlb-r4k.c +1 -1
@@ -367,7 +367,7 @@ void __init add_wired_entry(unsigned lon* lifetime of the system */ -static int temp_tlb_entry__initdata ; +static int temp_tlb_entry__initdata =0 ;__init int add_temporary_entry (unsigned long entrylo0,unsigned long entrylo1,unsigned long entryhi,unsigned long pagemask)
arch/mips/pci/fixup-malta.c +1 -1
@@ -8,7 +8,7 @@#define PCID 4/* This table is filled in by interrogating the PIIX4 chip */ -static char pci_irq[5 ]__initdata ; +static char pci_irq[5 ]__initdata = {0 };static char irq_tab[][5 ]__initdata = {/* INTA INTB INTC INTD */
arch/mips/pmc-sierra/yosemite/smp.c +3 -3
@@ -9,11 +9,11 @@static __initdata DEFINE_SPINLOCK (launch_lock); -static unsigned long secondary_sp__initdata ; -static unsigned long secondary_gp__initdata ; +static unsigned long secondary_sp__initdata =0l ; +static unsigned long secondary_gp__initdata =0l ; static unsigned char launchstack[LAUNCHSTACK_SIZE] __initdata - __attribute__((aligned(2 * sizeof(long)))); + __attribute__((aligned(2 * sizeof(long)))) = {0};static void __init prom_smp_bootstrap (void ) {
arch/mips/sgi-ip27/ip27-memory.c +3 -3
@@ -34,9 +34,9 @@#define SLOT_IGNORED 0xffff -static short __initdata slot_lastfilled_cache[MAX_COMPACT_NODES ]; -static unsigned short __initdata slot_psize_cache[MAX_COMPACT_NODES ][MAX_MEM_SLOTS ]; -static struct bootmem_data __initdata plat_node_bdata[MAX_COMPACT_NODES ]; +static short __initdata slot_lastfilled_cache[MAX_COMPACT_NODES ] = {0 }; +static unsigned short __initdata slot_psize_cache[MAX_COMPACT_NODES ][MAX_MEM_SLOTS ] = {0 }; +static struct bootmem_data __initdata plat_node_bdata[MAX_COMPACT_NODES ] = {0 };struct node_data *__node_data[MAX_COMPACT_NODES ];
arch/mips/tx4938/toshiba_rbtx4938/setup.c +2 -2
@@ -63,8 +63,8 @@ struct tx4938_pcic_reg *pcicptrs[4] = {static struct {unsigned long base;unsigned long size; -} phys_regions[16 ]__initdata ; -static int num_phys_regions__initdata ; +} phys_regions[16 ]__initdata = {{0 }}; +static int num_phys_regions__initdata =0 ;#define PHYS_REGION_MINSIZE 0x10000
PATCH 11/34 __initdata cleanup - parisc
In reply to Alon Bar-LevTrivial.
---
arch/parisc/kernel/setup.c +1 -1
@@ -45,7 +45,7 @@#include <asm/io.h> #include <asm/setup.h> -char __initdata command_line[COMMAND_LINE_SIZE ]__read_mostly ; +char __initdata command_line[COMMAND_LINE_SIZE ]__read_mostly ="" ;/* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */ struct proc_dir_entry * proc_runway_root__read_mostly =NULL ;
PATCH 12/34 __initdata cleanup - powerpc
In reply to Alon Bar-LevTrivial.
---
arch/powerpc/kernel/legacy_serial.c +1 -1
@@ -565,7 +565,7 @@ static int __init check_legacy_serial_coDBG ("Found serial console at ttyS%d\n" , offset);if (speed) { -static char __initdata opt[16 ]; +static char __initdata opt[16 ] = {0 };sprintf (opt,"%d" , speed);return add_preferred_console ("ttyS" , offset, opt); }else
arch/powerpc/kernel/pci_32.c +1 -1
@@ -889,7 +889,7 @@ void __init pci_process_bridge_OF_ranges(struct pci_controller *hose, struct device_node *dev, int primary) { - static unsigned int static_lc_ranges[256] __initdata; + static unsigned int static_lc_ranges[256] __initdata = {0};const unsigned int *dt_ranges;unsigned int *lc_ranges, *ranges, *prev, size;int rlen =0 , orig_rlen;
arch/powerpc/kernel/prom.c +2 -2
@@ -60,8 +60,8 @@#endif -static int __initdata dt_root_addr_cells; -static int __initdata dt_root_size_cells; +static int __initdata dt_root_addr_cells =0 ; +static int __initdata dt_root_size_cells =0 ;#ifdef CONFIG_PPC64 int __initdata iommu_is_off;
arch/powerpc/kernel/prom_init.c +22 -22
68 lines not on this page · raw message
arch/powerpc/mm/numa.c +1 -1
@@ -35,7 +35,7 @@ EXPORT_SYMBOL(numa_cpu_lookup_table);EXPORT_SYMBOL (numa_cpumask_lookup_table);EXPORT_SYMBOL (node_data); -static bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES ]; +static bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES ] = {{0 }};static int min_common_depth;static int n_mem_addr_cells, n_mem_size_cells;
arch/powerpc/platforms/iseries/dt.c +1 -1
@@ -61,7 +61,7 @@ struct iseries_flat_dt {u64 reserve_map[2 ]; }; -static void *__initdata dt_data; +static void *__initdata dt_data =NULL ;/* * Putting these strings here keeps them out of the section
arch/powerpc/platforms/powermac/bootx_init.c +5 -5
@@ -32,11 +32,11 @@extern void __start (unsigned long r3,unsigned long r4,unsigned long r5); -static unsigned long __initdata bootx_dt_strbase; -static unsigned long __initdata bootx_dt_strend; -static unsigned long __initdata bootx_node_chosen; -static boot_infos_t *__initdata bootx_info; -static char __initdata bootx_disp_path[256 ]; +static unsigned long __initdata bootx_dt_strbase =0l ; +static unsigned long __initdata bootx_dt_strend =0l ; +static unsigned long __initdata bootx_node_chosen =0l ; +static boot_infos_t *__initdata bootx_info =NULL ; +static char __initdata bootx_disp_path[256 ] = {0 };/* Is boot-info compatible ? */ #define BOOT_INFO_IS_COMPATIBLE (bi) \
arch/powerpc/xmon/xmon.c +1 -1
@@ -2632,7 +2632,7 @@ static int __init setup_xmon_sysrq(void)__initcall (setup_xmon_sysrq);#endif /* CONFIG_MAGIC_SYSRQ */ -int __initdata xmon_early, xmon_off; +int __initdata xmon_early =0 , xmon_off =0 ;static int __init early_parse_xmon (char *p) {
PATCH 13/34 __initdata cleanup - ppc
In reply to Alon Bar-LevTrivial.
**NOT TESTED***
---
arch/ppc/platforms/4xx/bamboo.c +1 -1
@@ -50,7 +50,7 @@extern bd_t __res; -static struct ibm44x_clocks clocks__initdata ; +static struct ibm44x_clocks clocks__initdata = {0 };/* * Bamboo external IRQ triggering/polarity settings
arch/ppc/platforms/4xx/ebony.c +1 -1
@@ -53,7 +53,7 @@extern bd_t __res; -static struct ibm44x_clocks clocks__initdata ; +static struct ibm44x_clocks clocks__initdata = {0 };/* * Ebony external IRQ triggering/polarity settings
arch/ppc/platforms/4xx/luan.c +1 -1
@@ -51,7 +51,7 @@extern bd_t __res; -static struct ibm44x_clocks clocks__initdata ; +static struct ibm44x_clocks clocks__initdata = {0 };static void __init luan_calibrate_decr (void )
arch/ppc/platforms/4xx/ocotea.c +1 -1
@@ -51,7 +51,7 @@extern bd_t __res; -static struct ibm44x_clocks clocks__initdata ; +static struct ibm44x_clocks clocks__initdata = {0 };static void __init ocotea_calibrate_decr (void )
arch/ppc/platforms/4xx/yucca.c +1 -1
@@ -53,7 +53,7 @@extern bd_t __res; -static struct ibm44x_clocks clocks__initdata ; +static struct ibm44x_clocks clocks__initdata = {0 };static void __init yucca_calibrate_decr (void )
PATCH 14/34 __initdata cleanup - s390
In reply to Alon Bar-LevTrivial.
**NOT TESTED***
---
arch/s390/kernel/setup.c +2 -2
@@ -74,9 +74,9 @@ unsigned int console_devno = -1;unsigned int console_irq =-1 ;unsigned long machine_flags =0 ; -struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS ]; +struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS ] = {{0 }};volatile int __cpu_logical_map[NR_CPUS ];/* logical cpu to cpu address */ -static unsigned long __initdata memory_end; +static unsigned long __initdata memory_end =0l ;/* * This is set up by the setup-routine at boot-time
arch/s390/kernel/smp.c +2 -2
@@ -603,8 +603,8 @@ __cpu_up(unsigned int cpu)return 0 ; } -static unsigned int __initdata additional_cpus; -static unsigned int __initdata possible_cpus; +static unsigned int __initdata additional_cpus =0 ; +static unsigned int __initdata possible_cpus =0 ;void __init smp_setup_cpu_possible_map (void ) {
drivers/s390/block/xpram.c +1 -1
@@ -63,7 +63,7 @@ static int xpram_devs;* Parameter parsing functions. */ static int __initdata devs =XPRAM_DEVS ; -static char __initdata *sizes[XPRAM_MAX_DEVS ]; +static char __initdata *sizes[XPRAM_MAX_DEVS ] = {0 };module_param (devs, int,0 );module_param_array (sizes, charp,NULL ,0 );
PATCH 15/34 __initdata cleanup - sh
In reply to Alon Bar-LevTrivial.
---
arch/sh/kernel/early_printk.c +1 -1
@@ -163,7 +163,7 @@ static struct console *early_console =#endif ; -static int __initdata keep_early; +static int __initdata keep_early =0 ;static int early_console_initialized;int __init setup_early_printk (char *buf)
arch/sh/kernel/timers/timer.c +1 -1
@@ -26,7 +26,7 @@ static struct sys_timer *sys_timers[] __ NULL, }; -static char timer_override[10 ]__initdata ; +static char timer_override[10 ]__initdata = {0 };static int __init timer_setup (char *str) {if (str)
PATCH 16/34 __initdata cleanup - sparc64
In reply to Alon Bar-LevTrivial.
**NOT TESTED***
---
arch/sparc64/mm/init.c +6 -6
@@ -64,10 +64,10 @@ struct tsb swapper_4m_tsb[KERNEL_TSB4M_N#define MAX_BANKS 32 -static struct linux_prom64_registers pavail[MAX_BANKS ]__initdata ; -static struct linux_prom64_registers pavail_rescan[MAX_BANKS ]__initdata ; -static int pavail_ents__initdata ; -static int pavail_rescan_ents__initdata ; +static struct linux_prom64_registers pavail[MAX_BANKS ]__initdata = {{0 }}; +static struct linux_prom64_registers pavail_rescan[MAX_BANKS ]__initdata = {{0 }}; +static int pavail_ents__initdata =0 ; +static int pavail_rescan_ents__initdata =0 ;static int cmp_p64 (const void *a,const void *b) {
@@ -1109,8 +1109,8 @@ static unsigned long __init bootmem_initreturn end_pfn; } -static struct linux_prom64_registers pall[MAX_BANKS ]__initdata ; -static int pall_ents__initdata ; +static struct linux_prom64_registers pall[MAX_BANKS ]__initdata = {{0 }}; +static int pall_ents__initdata =0 ;#ifdef CONFIG_DEBUG_PAGEALLOC static unsigned long kernel_map_range (unsigned long pstart,unsigned long pend,pgprot_t prot)
PATCH 17/34 __initdata cleanup - v850
In reply to Alon Bar-LevTrivial.
---
arch/v850/kernel/setup.c +1 -1
@@ -42,7 +42,7 @@ extern char _root_fs_image_start __attri extern char _root_fs_image_end __attribute__ ((__weak__)); -char __initdata command_line[COMMAND_LINE_SIZE ]; +char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;/* Memory not used by the kernel. */ static unsigned long total_ram_pages;
PATCH 18/34 __initdata cleanup - x86_64
In reply to Alon Bar-LevTrivial.
---
arch/x86_64/crypto/aes.c +4 -4
@@ -83,10 +83,10 @@ struct aes_ctx#define E_KEY (&ctx->buf[0])#define D_KEY (&ctx->buf[60]) -static u8 pow_tab[256 ]__initdata ; -static u8 log_tab[256 ]__initdata ; -static u8 sbx_tab[256 ]__initdata ; -static u8 isb_tab[256 ]__initdata ; +static u8 pow_tab[256 ]__initdata = {0 }; +static u8 log_tab[256 ]__initdata = {0 }; +static u8 sbx_tab[256 ]__initdata = {0 }; +static u8 isb_tab[256 ]__initdata = {0 };static u32 rco_tab[10 ];u32 aes_ft_tab[4 ][256 ];u32 aes_it_tab[4 ][256 ];
arch/x86_64/kernel/apic.c +2 -2
@@ -43,9 +43,9 @@int apic_mapped;int apic_verbosity;int apic_runs_main_timer; -int apic_calibrate_pmtmr__initdata ; +int apic_calibrate_pmtmr__initdata =0 ; -int disable_apic_timer__initdata ; +int disable_apic_timer__initdata =0 ;static struct resource *ioapic_resources;static struct resource lapic_resource = {
arch/x86_64/kernel/e820.c +6 -6
@@ -25,7 +25,7 @@#include <asm/bootsetup.h> #include <asm/sections.h> -struct e820map e820__initdata ; +struct e820map e820__initdata = {0 };/* * PFN of last memory page.
@@ -402,10 +402,10 @@ static int __init sanitize_e820_map(strustruct e820entry *pbios;/* pointer to original bios entry */ unsigned long long addr;/* address for this change point */ }; -static struct change_member change_point_list[2 *E820MAX ]__initdata ; -static struct change_member *change_point[2 *E820MAX ]__initdata ; -static struct e820entry *overlap_list[E820MAX ]__initdata ; -static struct e820entry new_bios[E820MAX ]__initdata ; +static struct change_member change_point_list[2 *E820MAX ]__initdata = {{0 }}; +static struct change_member *change_point[2 *E820MAX ]__initdata = {0 }; +static struct e820entry *overlap_list[E820MAX ]__initdata = {0 }; +static struct e820entry new_bios[E820MAX ]__initdata = {{0 }};struct change_member *change_tmp;unsigned long current_type, last_type;unsigned long long last_addr;
@@ -618,7 +618,7 @@ static int __init parse_memopt(char *p) }early_param ("mem" , parse_memopt); -static int userdef__initdata ; +static int userdef__initdata =0 ;static int __init parse_memmap_opt (char *p) {
arch/x86_64/kernel/early_printk.c +1 -1
@@ -213,7 +213,7 @@ void early_printk(const char *fmt, ...)va_end (ap); } -static int __initdata keep_early; +static int __initdata keep_early =0 ;static int __init setup_early_printk (char *buf) {
arch/x86_64/kernel/early-quirks.c +1 -1
@@ -30,7 +30,7 @@ static void via_bugs(void)#ifdef CONFIG_ACPI -static int nvidia_hpet_detected__initdata ; +static int nvidia_hpet_detected__initdata =0 ;static int __init nvidia_hpet_check (struct acpi_table_header *header) {
arch/x86_64/kernel/io_apic.c +1 -1
@@ -55,7 +55,7 @@ int sis_apic_bug; /* not actually supporstatic int no_timer_check; -static int disable_timer_pin_1__initdata ; +static int disable_timer_pin_1__initdata =0 ;int timer_over_8254__initdata =1 ;
arch/x86_64/kernel/mpparse.c +1 -1
@@ -62,7 +62,7 @@ unsigned int boot_cpu_id = -1U;/* Internal processor count */ unsigned int num_processors__initdata =0 ; -unsigned disabled_cpus__initdata ; +unsigned disabled_cpus__initdata =0 ;/* Bitmask of physically existing CPUs */ physid_mask_t phys_cpu_present_map =PHYSID_MASK_NONE ;
arch/x86_64/kernel/pci-calgary.c +3 -3
@@ -142,9 +142,9 @@ unsigned int specified_table_size = TCE_static int translate_empty_slots__read_mostly =0 ;static int calgary_detected__read_mostly =0 ; -static struct rio_table_hdr *rio_table_hdr__initdata ; -static struct scal_detail *scal_devs[MAX_NUMNODES ]__initdata ; -static struct rio_detail *rio_devs[MAX_NUMNODES *4 ]__initdata ; +static struct rio_table_hdr *rio_table_hdr__initdata =NULL ; +static struct scal_detail *scal_devs[MAX_NUMNODES ]__initdata = {0 }; +static struct rio_detail *rio_devs[MAX_NUMNODES *4 ]__initdata = {0 };struct calgary_bus_info {void *tce_space;
arch/x86_64/kernel/setup64.c +1 -1
@@ -24,7 +24,7 @@#include <asm/proto.h> #include <asm/sections.h> -char x86_boot_params[BOOT_PARAM_SIZE ]__initdata ; +char x86_boot_params[BOOT_PARAM_SIZE ]__initdata ="" ;cpumask_t cpu_initialized__cpuinitdata =CPU_MASK_NONE ;
arch/x86_64/kernel/setup.c +3 -3
@@ -100,7 +100,7 @@ EXPORT_SYMBOL_GPL(edid_info);extern int root_mountflags; -char __initdata command_line[COMMAND_LINE_SIZE ]; +char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;struct resource standard_io_resources[] = { { .name ="dma1" , .start =0x00 , .end =0x1f ,
@@ -333,8 +333,8 @@ static inline void copy_edd(void)#define EBDA_ADDR_POINTER 0x40E -unsigned __initdata ebda_addr; -unsigned __initdata ebda_size; +unsigned __initdata ebda_addr =0 ; +unsigned __initdata ebda_size =0 ;static void discover_ebda (void ) {
arch/x86_64/mm/init.c +2 -2
@@ -49,7 +49,7 @@struct dma_mapping_ops * dma_ops;EXPORT_SYMBOL (dma_ops); -static unsigned long dma_reserve__initdata ; +static unsigned long dma_reserve__initdata =0l ; DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -165,7 +165,7 @@ __set_fixmap (enum fixed_addresses idx,set_pte_phys (address, phys, prot); } -unsigned long __initdata table_start, table_end; +unsigned long __initdata table_start =0l , table_end =0l ;extern pmd_t temp_boot_pmds[];
arch/x86_64/mm/numa.c +3 -3
@@ -35,9 +35,9 @@ unsigned char apicid_to_node[MAX_LOCAL_A };cpumask_t node_to_cpumask[MAX_NUMNODES ]__read_mostly ; -int numa_off__initdata ; -unsigned long __initdata nodemap_addr; -unsigned long __initdata nodemap_size; +int numa_off__initdata =0 ; +unsigned long __initdata nodemap_addr =0l ; +unsigned long __initdata nodemap_size =0l ;/*
arch/x86_64/mm/srat.c +4 -4
@@ -21,14 +21,14 @@#include <asm/numa.h> #include <asm/e820.h> -int acpi_numa__initdata ; +int acpi_numa__initdata =0 ;static struct acpi_table_slit *acpi_slit; -static nodemask_t nodes_parsed__initdata ; -static struct bootnode nodes[MAX_NUMNODES ]__initdata ; +static nodemask_t nodes_parsed__initdata = {{0 }}; +static struct bootnode nodes[MAX_NUMNODES ]__initdata = {{0 }};static struct bootnode nodes_add[MAX_NUMNODES ]; -static int found_add_area__initdata ; +static int found_add_area__initdata =0 ;int hotadd_percent__initdata =0 ;/* Too small nodes confuse the VM badly. Usually they result
Re: [PATCH 18/34] __initdata cleanup - x86_64
Quoted 2 lines · Alon Bar-Lev
Trivial.
What is this change good for?
I didn't think any x86_64 binutils had trouble with bss initdata
-Andi
Re: [PATCH 18/34] __initdata cleanup - x86_64
Quoted 5 lines · Andi Kleen
Quoted 2 lines · Alon Bar-Lev
Trivial.
What is this change good for?
It was because http://lkml.org/lkml/2007/1/22/267. But since the kernel is compiled with -fno-common, it's superflous.
Regards,
Bernhard
PATCH 19/34 __initdata cleanup - xtensa
In reply to Alon Bar-LevTrivial.
**NOT TESTED***
---
arch/xtensa/kernel/setup.c +2 -2
@@ -78,13 +78,13 @@ extern unsigned long loops_per_jiffy;/* Command line specified as configuration option. */ -static char __initdata command_line[COMMAND_LINE_SIZE ]; +static char __initdata command_line[COMMAND_LINE_SIZE ] ="" ;#ifdef CONFIG_CMDLINE_BOOL static char default_command_line[COMMAND_LINE_SIZE ]__initdata =CONFIG_CMDLINE ;#endif -sysmem_info_t __initdata sysmem; +sysmem_info_t __initdata sysmem = {0 };#ifdef CONFIG_BLK_DEV_INITRD int initrd_is_mapped;
PATCH 20/34 __initdata cleanup - acpi
In reply to Alon Bar-LevTrivial.
---
drivers/acpi/ec.c +1 -1
@@ -911,7 +911,7 @@ static int __init acpi_ec_get_real_ecdt(return -ENODEV ; } -static int __initdata acpi_fake_ecdt_enabled; +static int __initdata acpi_fake_ecdt_enabled =0 ;int __init acpi_ec_ecdt_probe (void ) {acpi_status status;
drivers/acpi/tables.c +1 -1
@@ -40,7 +40,7 @@static char *mps_inti_flags_polarity[] = {"dfl" ,"high" ,"res" ,"low" };static char *mps_inti_flags_trigger[] = {"dfl" ,"edge" ,"res" ,"level" }; -static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES ]__initdata ; +static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES ]__initdata = {{0 }};void acpi_table_print_madt_entry (struct acpi_subtable_header * header) {
PATCH 21/34 __initdata cleanup - aes
In reply to Alon Bar-LevTrivial.
---
crypto/aes.c +4 -4
@@ -81,10 +81,10 @@ struct aes_ctx {#define E_KEY (&ctx->buf[0])#define D_KEY (&ctx->buf[60]) -static u8 pow_tab[256 ]__initdata ; -static u8 log_tab[256 ]__initdata ; -static u8 sbx_tab[256 ]__initdata ; -static u8 isb_tab[256 ]__initdata ; +static u8 pow_tab[256 ]__initdata = {0 }; +static u8 log_tab[256 ]__initdata = {0 }; +static u8 sbx_tab[256 ]__initdata = {0 }; +static u8 isb_tab[256 ]__initdata = {0 };static u32 rco_tab[10 ];static u32 ft_tab[4 ][256 ];static u32 it_tab[4 ][256 ];
PATCH 22/34 __initdata cleanup - fs
In reply to Alon Bar-LevTrivial.
---
fs/dcache.c +1 -1
@@ -2009,7 +2009,7 @@ ino_t find_inode_number(struct dentry *dreturn ino; } -static __initdata unsigned long dhash_entries; +static __initdata unsigned long dhash_entries =0l ;static int __init set_dhash_entries (char *str) {if (!str)
fs/inode.c +1 -1
@@ -1355,7 +1355,7 @@ void inode_double_unlock(struct inode *i }EXPORT_SYMBOL (inode_double_unlock); -static __initdata unsigned long ihash_entries; +static __initdata unsigned long ihash_entries =0l ;static int __init set_ihash_entries (char *str) {if (!str)
fs/nfs/nfsroot.c +1 -1
@@ -289,7 +289,7 @@ static int __init root_nfs_parse(char *n*/ static int __init root_nfs_name (char *name) { -static char buf[NFS_MAXPATHLEN ]__initdata ; +static char buf[NFS_MAXPATHLEN ]__initdata = {0 , };char *cp;/* Set some default values */
PATCH 23/34 __initdata cleanup - ide
In reply to Alon Bar-LevTrivial.
---
drivers/ide/ide.c +6 -6
@@ -1483,27 +1483,27 @@ static int __init match_parm (char *s, c }#ifdef CONFIG_BLK_DEV_ALI14XX -static int __initdata probe_ali14xx; +static int __initdata probe_ali14xx =0 ;extern int ali14xx_init (void );#endif #ifdef CONFIG_BLK_DEV_UMC8672 -static int __initdata probe_umc8672; +static int __initdata probe_umc8672 =0 ;extern int umc8672_init (void );#endif #ifdef CONFIG_BLK_DEV_DTC2278 -static int __initdata probe_dtc2278; +static int __initdata probe_dtc2278 =0 ;extern int dtc2278_init (void );#endif #ifdef CONFIG_BLK_DEV_HT6560B -static int __initdata probe_ht6560b; +static int __initdata probe_ht6560b =0 ;extern int ht6560b_init (void );#endif #ifdef CONFIG_BLK_DEV_QD65XX -static int __initdata probe_qd65xx; +static int __initdata probe_qd65xx =0 ;extern int qd65xx_init (void );#endif -static int __initdata is_chipset_set[MAX_HWIFS ]; +static int __initdata is_chipset_set[MAX_HWIFS ] = {0 };/* * ide_setup() gets called VERY EARLY during initialization,
PATCH 24/34 __initdata cleanup - init
In reply to Alon Bar-LevTrivial.
---
init/do_mounts.c +6 -6
@@ -18,11 +18,11 @@extern int get_filesystem_list (char * buf); -int __initdata rd_doload;/* 1 = load RAM disk, 0 = don't load */ +int __initdata rd_doload =0 ;/* 1 = load RAM disk, 0 = don't load */ int root_mountflags =MS_RDONLY |MS_SILENT ; -char *__initdata root_device_name; -static char __initdata saved_root_name[64 ]; +char *__initdata root_device_name =NULL ; +static char __initdata saved_root_name[64 ] ="" ;dev_t ROOT_DEV ;
@@ -214,21 +214,21 @@ static int __init root_dev_setup(char *l__setup ("root=" , root_dev_setup); -static char *__initdata root_mount_data; +static char *__initdata root_mount_data =NULL ;static int __init root_data_setup (char *str) { root_mount_data = str;return 1 ; } -static char *__initdata root_fs_names; +static char *__initdata root_fs_names =NULL ;static int __init fs_names_setup (char *str) { root_fs_names = str;return 1 ; } -static unsigned int __initdata root_delay; +static unsigned int __initdata root_delay =0 ;static int __init root_delay_setup (char *str) { root_delay =simple_strtoul (str,NULL ,0 );
init/do_mounts_initrd.c +1 -1
@@ -13,7 +13,7 @@unsigned long initrd_start, initrd_end;int initrd_below_start_ok;unsigned int real_root_dev;/* do_proc_dointvec cannot handle kdev_t */ -static int __initdata old_fd, root_fd; +static int __initdata old_fd =0 , root_fd =0 ;static int __initdata mount_initrd =1 ;static int __init no_initrd (char *str)
init/do_mounts_md.c +3 -3
@@ -12,7 +12,7 @@* The code for that is here. */ -static int __initdata raid_noautodetect, raid_autopart; +static int __initdata raid_noautodetect =0 , raid_autopart =0 ; static struct { int minor;
@@ -20,9 +20,9 @@ static struct {int level;int chunk;char *device_names; -} md_setup_args[256 ]__initdata ; +} md_setup_args[256] __initdata = {{0}}; -static int md_setup_ents__initdata ; +static int md_setup_ents__initdata =0 ;extern int mdp_major;/*
init/initramfs.c +19 -19
@@ -7,7 +7,7 @@#include <linux/string.h> #include <linux/syscalls.h> -static __initdata char *message; +static __initdata char *message =NULL ;static void __init error (char *x) {if (!message)
@@ -33,7 +33,7 @@ static __initdata struct hash {mode_t mode;struct hash *next;char name[N_ALIGN (PATH_MAX )]; -} *head[32 ]; +} *head[32] = {0};static inline int hash (int major,int minor,int ino) {
@@ -84,12 +84,12 @@ static void __init free_hash(void)/* cpio header parsing */ -static __initdata unsigned long ino, major, minor, nlink; -static __initdata mode_t mode; -static __initdata unsigned long body_len, name_len; -static __initdata uid_t uid; -static __initdata gid_t gid; -static __initdata unsigned rdev; +static __initdata unsigned long ino =0l , major =0l , minor =0l , nlink =0l ; +static __initdata mode_t mode =0 ; +static __initdata unsigned long body_len =0l , name_len =0l ; +static __initdata uid_t uid =0 ; +static __initdata gid_t gid =0 ; +static __initdata unsigned rdev =0 ;static void __init parse_header (char *s) {
@@ -125,13 +125,13 @@ static __initdata enum state { CopyFile, GotSymlink, Reset -} state, next_state; +} state = Start, next_state = Start; -static __initdata char *victim; -static __initdata unsigned count; -static __initdata loff_t this_header, next_header; +static __initdata char *victim =NULL ; +static __initdata unsigned count =0 ; +static __initdata loff_t this_header =0 , next_header =0 ; -static __initdata int dry_run; +static __initdata int dry_run =0 ;static inline void eat (unsigned n) {
@@ -140,9 +140,9 @@ static inline void eat(unsigned n) count -= n; } -static __initdata char *collected; -static __initdata int remains; -static __initdata char *collect; +static __initdata char *collected =NULL ; +static __initdata int remains =0 ; +static __initdata char *collect =NULL ;static void __init read_into (char *buf,unsigned size,enum state next) {
@@ -158,7 +158,7 @@ static void __init read_into(char *buf, } } -static __initdata char *header_buf, *symlink_buf, *name_buf; +static __initdata char *header_buf =NULL , *symlink_buf =NULL , *name_buf =NULL ;static int __init do_start (void ) {
@@ -257,7 +257,7 @@ static void __init clean_path(char *path } } -static __initdata int wfd; +static __initdata int wfd =0 ;static int __init do_name (void ) {
@@ -491,7 +491,7 @@ static char * __init unpack_to_rootfs(chreturn message; } -static int __initdata do_retain_initrd; +static int __initdata do_retain_initrd =0 ;static int __init retain_initrd_param (char *str) {
init/main.c +3 -3
@@ -122,7 +122,7 @@ void (*late_time_init)(void);extern void softirq_init (void );/* Untouched command line saved by arch-specific code. */ -char __initdata boot_command_line[COMMAND_LINE_SIZE ]; +char __initdata boot_command_line[COMMAND_LINE_SIZE ] ="" ;/* Untouched saved command line (eg. for /proc) */ char *saved_command_line;/* Command line for parameter parsing */
@@ -470,7 +470,7 @@ static int __init do_early_param(char *pvoid __init parse_early_param (void ) {static __initdata int done =0 ; -static __initdata char tmp_cmdline[COMMAND_LINE_SIZE ]; +static __initdata char tmp_cmdline[COMMAND_LINE_SIZE ] ="" ;if (done)return ;
@@ -640,7 +640,7 @@ asmlinkage void __init start_kernel(voidrest_init (); } -static int __initdata initcall_debug; +static int __initdata initcall_debug =0 ;static int __init initcall_debug_setup (char *str) {
PATCH 25/34 __initdata cleanup - input
In reply to Alon Bar-LevTrivial.
---
drivers/input/joystick/db9.c +1 -1
@@ -50,7 +50,7 @@ struct db9_config { };#define DB9_MAX_PORTS 3 -static struct db9_config db9[DB9_MAX_PORTS ]__initdata ; +static struct db9_config db9[DB9_MAX_PORTS ]__initdata = {{{0 }}};module_param_array_named (dev, db9[0 ].args, int, &db9[0 ].nargs,0 );MODULE_PARM_DESC (dev,"Describes first attached device (<parport#>,<type>)" );
drivers/input/joystick/gamecon.c +1 -1
@@ -51,7 +51,7 @@ struct gc_config {int nargs; }; -static struct gc_config gc[GC_MAX_PORTS ]__initdata ; +static struct gc_config gc[GC_MAX_PORTS ]__initdata = {{{0 }}};module_param_array_named (map, gc[0 ].args, int, &gc[0 ].nargs,0 );MODULE_PARM_DESC (map,"Describes first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)" );
drivers/input/joystick/turbografx.c +1 -1
@@ -51,7 +51,7 @@ struct tgfx_config {int nargs; }; -static struct tgfx_config tgfx[TGFX_MAX_PORTS ]__initdata ; +static struct tgfx_config tgfx[TGFX_MAX_PORTS ]__initdata = {{{0 }}};module_param_array_named (map, tgfx[0 ].args, int, &tgfx[0 ].nargs,0 );MODULE_PARM_DESC (map,"Describes first set of devices (<parport#>,<js1>,<js2>,..<js7>" );
drivers/input/keyboard/amikbd.c +1 -1
@@ -215,7 +215,7 @@ static int __init amikbd_init(void)set_bit (i, amikbd_dev->keybit);for (i =0 ; i <MAX_NR_KEYMAPS ; i++) { -static u_short temp_map[NR_KEYS ]__initdata ; +static u_short temp_map[NR_KEYS ]__initdata = {0 };if (!key_maps[i])continue ;memset (temp_map,0 ,sizeof (temp_map));
PATCH 26/34 __initdata cleanup - intel-rng
In reply to Alon Bar-LevTrivial.
---
drivers/char/hw_random/intel-rng.c +2 -2
@@ -143,7 +143,7 @@ static const struct pci_device_id pci_tb };MODULE_DEVICE_TABLE (pci, pci_tbl); -static __initdata int no_fwh_detect; +static __initdata int no_fwh_detect =0 ;module_param (no_fwh_detect, int,0 );MODULE_PARM_DESC (no_fwh_detect,"Skip FWH detection:\n" " positive value - skip if FWH space locked read-only\n"
@@ -219,7 +219,7 @@ static struct hwrng intel_rng = {#ifdef CONFIG_SMP -static char __initdata waitflag; +static char __initdata waitflag =0 ;static void __init intel_init_wait (void *unused) {
PATCH 27/34 __initdata cleanup - mm
In reply to Alon Bar-LevTrivial.
---
mm/page_alloc.c +10 -10
@@ -101,9 +101,9 @@ static char * const zone_names[MAX_NR_ZOint min_free_kbytes =1024 ; -unsigned long __meminitdata nr_kernel_pages; -unsigned long __meminitdata nr_all_pages; -static unsigned long __initdata dma_reserve; +unsigned long __meminitdata nr_kernel_pages =0l ; +unsigned long __meminitdata nr_all_pages =0l ; +static unsigned long __initdata dma_reserve =0l ;#ifdef CONFIG_ARCH_POPULATES_NODE_MAP /*
@@ -126,13 +126,13 @@ static unsigned long __initdata dma_rese#endif #endif -struct node_active_region __initdata early_node_map[MAX_ACTIVE_REGIONS ]; -int __initdata nr_nodemap_entries; -unsigned long __initdata arch_zone_lowest_possible_pfn[MAX_NR_ZONES ]; -unsigned long __initdata arch_zone_highest_possible_pfn[MAX_NR_ZONES ]; +struct node_active_region __initdata early_node_map[MAX_ACTIVE_REGIONS ] = {{0 }}; +int __initdata nr_nodemap_entries =0 ; +unsigned long __initdata arch_zone_lowest_possible_pfn[MAX_NR_ZONES ] = {0 }; +unsigned long __initdata arch_zone_highest_possible_pfn[MAX_NR_ZONES ] = {0 };#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE -unsigned long __initdata node_boundary_start_pfn[MAX_NUMNODES ]; -unsigned long __initdata node_boundary_end_pfn[MAX_NUMNODES ]; +unsigned long __initdata node_boundary_start_pfn[MAX_NUMNODES ] = {0 }; +unsigned long __initdata node_boundary_end_pfn[MAX_NUMNODES ] = {0 };#endif /* CONFIG_MEMORY_HOTPLUG_RESERVE */ #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
@@ -1776,7 +1776,7 @@ static int __meminit build_zonelists_nod#ifdef CONFIG_NUMA #define MAX_NODE_LOAD (num_online_nodes()) -static int __meminitdata node_load[MAX_NUMNODES ]; +static int __meminitdata node_load[MAX_NUMNODES ] = {0 };/** * find_next_best_node - find the next node that should appear in a given node's fallback list * @node: node whose fallback list we're appending
mm/slab.c +1 -1
@@ -305,7 +305,7 @@ struct kmem_list3 {* Need this for bootstrapping a per node allocator. */ #define NUM_INIT_LISTS (2 * MAX_NUMNODES + 1) -struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS ]; +struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS ] = {{{0 }}};#define CACHE_CACHE 0#define SIZE_AC 1#define SIZE_L3 (1 + MAX_NUMNODES)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 28/34 __initdata cleanup - mtd
In reply to Alon Bar-LevTrivial.
---
drivers/mtd/devices/block2mtd.c +1 -1
@@ -424,7 +424,7 @@ static inline void kill_final_newline(ch#ifndef MODULE static int block2mtd_init_called =0 ; -static __initdata char block2mtd_paramline[80 +12 ];/* 80 for device, 12 for erase size */ +static __initdata char block2mtd_paramline[80 +12 ] = {0 };/* 80 for device, 12 for erase size */ #endif
PATCH 29/34 __initdata cleanup - net
In reply to Alon Bar-LevTrivial.
---
net/decnet/dn_dev.c +1 -1
@@ -1461,7 +1461,7 @@ static struct rtnetlink_link dnet_rtnetl }; -static int __initdata addr[2 ]; +static int __initdata addr[2 ] = {0 ,0 };module_param_array (addr, int,NULL ,0444 );MODULE_PARM_DESC (addr,"The DECnet address of this machine: area,node" );
net/ipv4/route.c +1 -1
@@ -3103,7 +3103,7 @@ static int ip_rt_acct_read(char *buffer,#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_NET_CLS_ROUTE */ -static __initdata unsigned long rhash_entries; +static __initdata unsigned long rhash_entries =0l ;static int __init set_rhash_entries (char *str) {if (!str)
net/ipv4/tcp.c +1 -1
@@ -2385,7 +2385,7 @@ EXPORT_SYMBOL(__tcp_put_md5sig_pool);extern void __skb_cb_too_small_for_tcp (int ,int );extern struct tcp_congestion_ops tcp_reno; -static __initdata unsigned long thash_entries; +static __initdata unsigned long thash_entries =0l ;static int __init set_thash_entries (char *str) {if (!str)
PATCH 30/34 __initdata cleanup - parallel
In reply to Alon Bar-LevTrivial.
---
drivers/parport/parport_gsc.c +1 -1
@@ -350,7 +350,7 @@ struct parport *__devinit parport_gsc_pr#define PARPORT_GSC_OFFSET 0x800 -static int __initdata parport_count; +static int __initdata parport_count =0 ;static int __devinit parport_init_chip (struct parisc_device *dev) {
PATCH 31/34 __initdata cleanup - pnp
In reply to Alon Bar-LevTrivial.
---
drivers/pnp/pnpacpi/core.c +1 -1
@@ -236,7 +236,7 @@ static acpi_status __init pnpacpi_add_dereturn AE_OK ; } -int pnpacpi_disabled__initdata ; +int pnpacpi_disabled__initdata =0 ;static int __init pnpacpi_init (void ) {if (acpi_disabled || pnpacpi_disabled) {
PATCH 32/34 __initdata cleanup - scsi
In reply to Alon Bar-LevTrivial.
---
drivers/scsi/aha1542.c +1 -1
@@ -943,7 +943,7 @@ fail: }#ifndef MODULE -static char *setup_str[MAXBOARDS ]__initdata ; +static char *setup_str[MAXBOARDS ]__initdata = {0 };static int setup_idx =0 ;static void __init aha1542_setup (char *str,int *ints)
drivers/scsi/pluto.c +1 -1
@@ -47,7 +47,7 @@ static struct ctrl_inquiry {Scsi_Cmnd cmd;char inquiry[256 ];fc_channel *fc; -} *fcs__initdata ; +} *fcs__initdata =NULL ;static int fcscount__initdata =0 ;static atomic_t fcss__initdata =ATOMIC_INIT (0 );DECLARE_MUTEX_LOCKED (fc_sem);
PATCH 33/34 __initdata cleanup - serial
In reply to Alon Bar-LevTrivial.
---
drivers/serial/8250_early.c +2 -2
@@ -41,8 +41,8 @@ struct early_uart_device {unsigned int baud; }; -static struct early_uart_device early_device__initdata ; -static int early_uart_registered__initdata ; +static struct early_uart_device early_device__initdata = {{{{0 }}}}; +static int early_uart_registered__initdata =0 ;static unsigned int __init serial_in (struct uart_port *port,int offset) {
PATCH 34/34 __initdata cleanup - video
In reply to Alon Bar-LevTrivial.
---
drivers/video/console/sticore.c +3 -3
@@ -289,9 +289,9 @@ __setup("sti=", sti_setup);static char __initdata *font_name[MAX_STI_ROMS ] = {"VGA8x16" , }; -static int __initdata font_index[MAX_STI_ROMS ], - font_height[MAX_STI_ROMS ], - font_width[MAX_STI_ROMS ]; +static int __initdata font_index[MAX_STI_ROMS ] = {0 }, + font_height[MAX_STI_ROMS ] = {0 }, + font_width[MAX_STI_ROMS ] = {0 };#ifndef MODULE static int __init sti_font_setup (char *str) {
drivers/video/skeletonfb.c +1 -1
@@ -123,7 +123,7 @@ static struct fb_info info;* Each one represents the state of the hardware. Most hardware have * just one hardware state. These here represent the default state(s). */ -static struct xxx_par __initdata current_par; +static struct xxx_par __initdata current_par = {0 };int xxxfb_init (void );int xxxfb_setup (char *);
drivers/video/stifb.c +2 -2
@@ -111,7 +111,7 @@ struct stifb_info {u32 pseudo_palette[16 ]; }; -static int __initdata stifb_bpp_pref[MAX_STI_ROMS ]; +static int __initdata stifb_bpp_pref[MAX_STI_ROMS ] = {0 };/* ------------------- chipset specific functions -------------------------- */
@@ -1298,7 +1298,7 @@ out_err0:return -ENXIO ; } -static int stifb_disabled__initdata ; +static int stifb_disabled__initdata =0 ;int __init stifb_setup (char *options);
drivers/video/vesafb.c +2 -2
@@ -49,8 +49,8 @@ static struct fb_fix_screeninfo vesafb_fstatic int inverse__read_mostly ;static int mtrr__read_mostly ;/* disable mtrr */ -static int vram_remap__initdata ;/* Set amount of memory to be used */ -static int vram_total__initdata ;/* Set total amount of memory */ +static int vram_remap__initdata =0 ;/* Set amount of memory to be used */ +static int vram_total__initdata =0 ;/* Set total amount of memory */ static int pmi_setpal__read_mostly =1 ;/* pmi for palette changes ??? */ static int ypan__read_mostly ;/* 0..nothing, 1..ypan, 2..ywrap */ static void (*pmi_start)(void )__read_mostly ;
Quoted 11 lines · Alon Bar-Lev
Follow-up Russell King comment at http://lkml.org/lkml/2007/1/22/267
All
__initdatavariables should be initialized so they won't end up in BSS.There is no dependency between patches or even hunks.
Some architecture patches are untested, this is documented as "UNTESTED"
Against 2.6.20-rc6-mm3.
To quote parts of that:
Anyway, here's what the GCC manual has to say about use of __attribute__((section)) on variables:
`section ("SECTION-NAME")'
Use the section' attribute with an _initialized_ definition of a _global_ variable, as shown in the example. GCC issues a warning and otherwise ignores the section' attribute in uninitialized variable declarations.
You may only use the `section' attribute with a fully initialized global definition because of the way linkers work. The linker requires each object be defined once, with the exception that uninitialized variables tentatively go in the common' (or bss') section and can be multiply "defined". You can force a variable to be initialized with the -fno-common' flag or the nocommon' attribute.
And the top-level Makefile has:
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common
Note the -fno-common.
And indeed all the __initdata annotated local and global variables on s390 are in the init.data section. So I'm wondering what this patch series is about. Or I must have missed something.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 11 lines · Heiko Carstens
And the top-level
Makefilehas:CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-commonNote the -fno-common.
And indeed all the
__initdataannotated local and global variables on s390 are in the init.data section. So I'm wondering what this patch series is about. Or I must have missed something.
Hmmm... You have a valid point!
So it reduces the patch to the following.
Quoted 1 line
From the previous discussion I was afraid that I added some invalid variables.
Thanks!
Best Regards,
Alon Bar-Lev.
---
arch/x86_64/kernel/e820.c +4 -4
@@ -402,10 +402,10 @@ static int __init sanitize_e820_map(strustruct e820entry *pbios;/* pointer to original bios entry */ unsigned long long addr;/* address for this change point */ }; -static struct change_member change_point_list[2 *E820MAX ]__initdata ; -static struct change_member *change_point[2 *E820MAX ]__initdata ; -static struct e820entry *overlap_list[E820MAX ]__initdata ; -static struct e820entry new_bios[E820MAX ]__initdata ; +static struct change_member change_point_list[2 *E820MAX ]__initdata = {{0 }}; +static struct change_member *change_point[2 *E820MAX ]__initdata = {0 }; +static struct e820entry *overlap_list[E820MAX ]__initdata = {0 }; +static struct e820entry new_bios[E820MAX ]__initdata = {{0 }};struct change_member *change_tmp;unsigned long current_type, last_type;unsigned long long last_addr;
fs/nfs/nfsroot.c +1 -1
@@ -289,7 +289,7 @@ static int __init root_nfs_parse(char *n*/ static int __init root_nfs_name (char *name) { -static char buf[NFS_MAXPATHLEN ]__initdata ; +static char buf[NFS_MAXPATHLEN ]__initdata = {0 , };char *cp;/* Set some default values */
init/main.c +1 -1
@@ -470,7 +470,7 @@ static int __init do_early_param(char *pvoid __init parse_early_param (void ) {static __initdata int done =0 ; -static __initdata char tmp_cmdline[COMMAND_LINE_SIZE ]; +static __initdata char tmp_cmdline[COMMAND_LINE_SIZE ] ="" ;if (done)return ;
drivers/input/keyboard/amikbd.c +1 -1
@@ -215,7 +215,7 @@ static int __init amikbd_init(void)set_bit (i, amikbd_dev->keybit);for (i =0 ; i <MAX_NR_KEYMAPS ; i++) { -static u_short temp_map[NR_KEYS ]__initdata ; +static u_short temp_map[NR_KEYS ]__initdata = {0 };if (!key_maps[i])continue ;memset (temp_map,0 ,sizeof (temp_map));
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Hi,
Quoted 3 lines · Heiko Carstens
And indeed all the
__initdataannotated local and global variables on s390 are in the init.data section. So I'm wondering what this patch series is about. Or I must have missed something.
I think it reaches back to times when gcc 2.7.* was still supported, which does behave as described in the documentation. gcc 2.95 and newer don't require explicit initialization anymore, so this has become a non-issue.
bye, Roman
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerQuoted 4 lines · On Fri, 9 Feb 2007 18:37:34 +0100 (CET) Roman Zippel <[email protected]>…
Hi,
On Fri, 9 Feb 2007, Heiko Carstens wrote:
Quoted 8 lines
Quoted 3 lines
And indeed all the
__initdataannotated local and global variables on s390 are in the init.data section. So I'm wondering what this patch series is about. Or I must have missed something.I think it reaches back to times when gcc 2.7.* was still supported, which does behave as described in the documentation. gcc 2.95 and newer don't require explicit initialization anymore, so this has become a non-issue.
Yes, nobody's been observing any problems arising from this, and if this memory was really uninitialised, people would be hitting problems.
I don't want to have to require that all __attribute__((section)) storage be initialised - people will surely forget to do it and things will slip through.
If we really do have a problem here it'd be better to fix it in some central and global fashion: either by ensuring that each architecture's startup code will zero this memory or by some compiler/linker option such as -fno-common.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Andrew Morton
If we really do have a problem here it'd be better to fix it in some central and global fashion: either by ensuring that each architecture's startup code will zero this memory or by some compiler/linker option such as -fno-common.
Great,
But what about the variables that are not in global scope?
As I understand from init.h description:
"Don't forget to initialize data not at file scope, i.e. within a function, as gcc otherwise puts the data into the bss section and not into the init section."
Best Regards,
Alon Bar-Lev.
Andrew Morton
maintainerQuoted 6 lines · On Fri, 9 Feb 2007 23:48:36 +0200 "Alon Bar-Lev" <[email protected]> wrote:
Quoted 4 lines · Andrew Morton
If we really do have a problem here it'd be better to fix it in some central and global fashion: either by ensuring that each architecture's startup code will zero this memory or by some compiler/linker option such as -fno-common.
Quoted 7 lines
Great,
But what about the variables that are not in global scope?
As I understand frominit.hdescription:
"Don't forget to initialize data not at file scope, i.e. within a function, as gcc otherwise puts the data into the bss section and not into the init section."
It could be that this is referring to a toolchain which we don't use any more. That comment has been there for at least seven years.
This:
fs/open.c renamed from fs/open.c~a +2 -0
@@ -223,6 +223,8 @@ static long do_sys_truncate(const char _struct inode * inode;int error; +static char blobwozzle[100 ]__initdata ; + error = -EINVAL ;if (length <0 )/* sorry, but loff_t says... */ goto out;
_
puts the array in .init.data on my fairly old toolchain.