Skip to content

Commit af6cf95

Browse files
nathanchancempe
authored andcommitted
powerpc/maple: Fix declaration made after definition
When building ppc64 defconfig, Clang errors (trimmed for brevity): arch/powerpc/platforms/maple/setup.c:365:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] machine_device_initcall(maple, maple_cpc925_edac_setup); ^ machine_device_initcall expands to __define_machine_initcall, which in turn has the macro machine_is used in it, which declares mach_##name with an __attribute__((weak)). define_machine actually defines mach_##name, which in this file happens before the declaration, hence the warning. To fix this, move define_machine after machine_device_initcall so that the declaration occurs before the definition, which matches how machine_device_initcall and define_machine work throughout arch/powerpc. While we're here, remove some spaces before tabs. Fixes: 8f101a0 ("edac: cpc925 MC platform device setup") Reported-by: Nick Desaulniers <[email protected]> Suggested-by: Ilie Halip <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent adde871 commit af6cf95

File tree

1 file changed

+17
-17
lines changed
  • arch/powerpc/platforms/maple

1 file changed

+17
-17
lines changed

arch/powerpc/platforms/maple/setup.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -291,23 +291,6 @@ static int __init maple_probe(void)
291291
return 1;
292292
}
293293

294-
define_machine(maple) {
295-
.name = "Maple",
296-
.probe = maple_probe,
297-
.setup_arch = maple_setup_arch,
298-
.init_IRQ = maple_init_IRQ,
299-
.pci_irq_fixup = maple_pci_irq_fixup,
300-
.pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
301-
.restart = maple_restart,
302-
.halt = maple_halt,
303-
.get_boot_time = maple_get_boot_time,
304-
.set_rtc_time = maple_set_rtc_time,
305-
.get_rtc_time = maple_get_rtc_time,
306-
.calibrate_decr = generic_calibrate_decr,
307-
.progress = maple_progress,
308-
.power_save = power4_idle,
309-
};
310-
311294
#ifdef CONFIG_EDAC
312295
/*
313296
* Register a platform device for CPC925 memory controller on
@@ -364,3 +347,20 @@ static int __init maple_cpc925_edac_setup(void)
364347
}
365348
machine_device_initcall(maple, maple_cpc925_edac_setup);
366349
#endif
350+
351+
define_machine(maple) {
352+
.name = "Maple",
353+
.probe = maple_probe,
354+
.setup_arch = maple_setup_arch,
355+
.init_IRQ = maple_init_IRQ,
356+
.pci_irq_fixup = maple_pci_irq_fixup,
357+
.pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
358+
.restart = maple_restart,
359+
.halt = maple_halt,
360+
.get_boot_time = maple_get_boot_time,
361+
.set_rtc_time = maple_set_rtc_time,
362+
.get_rtc_time = maple_get_rtc_time,
363+
.calibrate_decr = generic_calibrate_decr,
364+
.progress = maple_progress,
365+
.power_save = power4_idle,
366+
};

0 commit comments

Comments
 (0)