[U-Boot] [RFC][PATCH] Code Clean-up (weak functions)
Remy Bohmer
linux at bohmer.net
Sat Dec 13 23:48:44 CET 2008
Hello Graeme,
2008/12/13 Graeme Russ <graeme.russ at gmail.com>:
> This patch makes all definitions, declarations and usages of weak functions
> consistent.
>
> Signed-off-by: Graeme Russ <graeme.russ at gmail.com>
Just curious:
What is the relation of this patch to the problem discussed earlier:
http://www.mail-archive.com/u-boot@lists.denx.de/msg05367.html
Does this patch repair anything, or could it maybe break things?
I ask this because the weak linking seemed not work as many expected,
and I guess you cannot test all architectures/boards...
> - If the weak alias decleration exceeds 80 columns, the __attribute__ is placed
> on the following line, indented by one tab
The benefit on 1 line would be that it is easy recognisable with grep
which instance of a function is actually being used (or in fact should
be used due to the fuzzy behaviour of weak in U-boot...) without
having to go through all the code. That benefit is gone when it is
moved across different lines.
Maybe it is an idea to move the attribute(weak,...) construction to a
macro, like in Linux:
#define __weak __attribute__((weak))
In that case it can be changed easier when a non-GCC compiler is being
used, and would keep the lines shorter, such that it still fits on 1
line?
> All instances have been replaced by empty functions with an alias. e.g.
> void __do_something (args) {}
> do_something(args) __atttribute__((weak, alias("__do_something")));
Notice that in Linux, the 'alias' construction is not being used
massively. Can it be removed here also, or is it somehow mandatory
here?
Removing it would keep the lines short as well...
Kind Regards,
Remy
>
> - There is no purely weak functions and therfore no longer code like:
> if (do_something)
> do_somthing();
>
> board/incaip/incaip.c | 2 +-
> board/purple/purple.c | 2 +-
> board/tb0229/tb0229.c | 2 +-
> .../xilinx/ppc405-generic/xilinx_ppc405_generic.c | 1 -
> common/cmd_boot.c | 6 ++--
> common/cmd_bootm.c | 6 +++-
> common/cmd_elf.c | 4 +-
> common/cmd_ide.c | 6 ++--
> common/cmd_log.c | 3 +-
> common/main.c | 3 +-
> common/serial.c | 3 +-
> cpu/at32ap/cpu.c | 6 +++-
> cpu/blackfin/cpu.h | 2 +-
> cpu/blackfin/reset.c | 6 +++-
> cpu/mips/cpu.c | 8 +++---
> cpu/mpc8xxx/ddr/util.c | 5 ++-
> cpu/ppc4xx/44x_spd_ddr.c | 3 +-
> cpu/ppc4xx/44x_spd_ddr2.c | 3 +-
> cpu/ppc4xx/4xx_pci.c | 3 +-
> cpu/ppc4xx/4xx_pcie.c | 2 +-
> cpu/ppc4xx/fdt.c | 3 +-
> drivers/mtd/cfi_flash.c | 24 +++++++++++++------
> drivers/net/mcfmii.c | 3 +-
> include/asm-avr32/arch-at32ap700x/clk.h | 2 +-
> include/asm-mips/reboot.h | 2 +-
> include/common.h | 2 +-
> lib_arm/board.c | 21 +++++++++++-----
> lib_ppc/board.c | 6 +++-
> lib_ppc/interrupts.c | 4 +-
> 29 files changed, 86 insertions(+), 57 deletions(-)
>
> diff --git a/board/incaip/incaip.c b/board/incaip/incaip.c
> index 3b30970..3ee3ac9 100644
> --- a/board/incaip/incaip.c
> +++ b/board/incaip/incaip.c
> @@ -31,7 +31,7 @@
>
> extern uint incaip_get_cpuclk(void);
>
> -void _machine_restart(void)
> +void machine_restart(void)
> {
> *INCA_IP_WDT_RST_REQ = 0x3f;
> }
> diff --git a/board/purple/purple.c b/board/purple/purple.c
> index 54bef65..c243487 100644
> --- a/board/purple/purple.c
> +++ b/board/purple/purple.c
> @@ -54,7 +54,7 @@ extern int asc_serial_getc (void);
> extern int asc_serial_tstc (void);
> extern void asc_serial_setbrg (void);
>
> -void _machine_restart(void)
> +void machine_restart(void)
> {
> void (*f)(void) = (void *) 0xbfc00000;
>
> diff --git a/board/tb0229/tb0229.c b/board/tb0229/tb0229.c
> index d3f05b2..f74573b 100644
> --- a/board/tb0229/tb0229.c
> +++ b/board/tb0229/tb0229.c
> @@ -16,7 +16,7 @@
> #include <asm/reboot.h>
> #include <pci.h>
>
> -void _machine_restart(void)
> +void machine_restart(void)
> {
> void (*f)(void) = (void *) 0xbfc00000;
>
> diff --git a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c
> index 9bd1770..57ffdc8 100644
> --- a/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c
> +++ b/board/xilinx/ppc405-generic/xilinx_ppc405_generic.c
> @@ -25,7 +25,6 @@ ulong __get_PCI_freq(void)
> {
> return 0;
> }
> -
> ulong get_PCI_freq(void) __attribute__((weak, alias("__get_PCI_freq")));
>
> int __board_pre_init(void)
> diff --git a/common/cmd_boot.c b/common/cmd_boot.c
> index 6024ffe..7d77b8d 100644
> --- a/common/cmd_boot.c
> +++ b/common/cmd_boot.c
> @@ -28,12 +28,12 @@
> #include <command.h>
> #include <net.h>
>
> -/* Allow ports to override the default behavior */
> -__attribute__((weak))
> -unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
> +unsigned long __do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
> {
> return entry (argc, argv);
> }
> +unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
> + __attribute__((weak, alias("__do_go_exec")));
>
> int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> {
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index a8f85e9..137cf65 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -159,13 +159,15 @@ void __board_lmb_reserve(struct lmb *lmb)
> {
> /* please define platform specific board_lmb_reserve() */
> }
> -void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
> +void board_lmb_reserve(struct lmb *lmb)
> + __attribute__((weak, alias("__board_lmb_reserve")));
>
> void __arch_lmb_reserve(struct lmb *lmb)
> {
> /* please define platform specific arch_lmb_reserve() */
> }
> -void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));
> +void arch_lmb_reserve(struct lmb *lmb)
> + __attribute__((weak, alias("__arch_lmb_reserve")));
>
> #if defined(__ARM__)
> #define IH_INITRD_ARCH IH_ARCH_ARM
> diff --git a/common/cmd_elf.c b/common/cmd_elf.c
> index 27a4b73..4cd2975 100644
> --- a/common/cmd_elf.c
> +++ b/common/cmd_elf.c
> @@ -27,8 +27,6 @@ DECLARE_GLOBAL_DATA_PTR;
> int valid_elf_image (unsigned long addr);
> unsigned long load_elf_image (unsigned long addr);
>
> -/* Allow ports to override the default behavior */
> -__attribute__((weak))
> unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
> {
> unsigned long ret;
> @@ -52,6 +50,8 @@ unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *ar
>
> return ret;
> }
> +unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
> + __attribute__((weak, alias("__do_bootelf_exec")));
>
> /* ======================================================================
> * Interpreter command to boot an arbitrary ELF image from memory.
> diff --git a/common/cmd_ide.c b/common/cmd_ide.c
> index db05f76..0b890f0 100644
> --- a/common/cmd_ide.c
> +++ b/common/cmd_ide.c
> @@ -529,7 +529,7 @@ __ide_outb(int dev, int port, unsigned char val)
> outb(val, (ATA_CURR_BASE(dev)+CONFIG_SYS_ATA_PORT_ADDR(port)));
> }
> void inline ide_outb (int dev, int port, unsigned char val)
> - __attribute__((weak, alias("__ide_outb")));
> + __attribute__((weak, alias("__ide_outb")));
>
> unsigned char inline
> __ide_inb(int dev, int port)
> @@ -541,7 +541,7 @@ __ide_inb(int dev, int port)
> return val;
> }
> unsigned char inline ide_inb(int dev, int port)
> - __attribute__((weak, alias("__ide_inb")));
> + __attribute__((weak, alias("__ide_inb")));
>
> #ifdef CONFIG_TUNE_PIO
> int inline
> @@ -550,7 +550,7 @@ __ide_set_piomode(int pio_mode)
> return 0;
> }
> int inline ide_set_piomode(int pio_mode)
> - __attribute__((weak, alias("__ide_set_piomode")));
> + __attribute__((weak, alias("__ide_set_piomode")));
> #endif
>
> void ide_init (void)
> diff --git a/common/cmd_log.c b/common/cmd_log.c
> index febdb90..854c30d 100644
> --- a/common/cmd_log.c
> +++ b/common/cmd_log.c
> @@ -70,7 +70,8 @@ unsigned long __logbuffer_base(void)
> {
> return CONFIG_SYS_SDRAM_BASE + gd->bd->bi_memsize - LOGBUFF_LEN;
> }
> -unsigned long logbuffer_base (void) __attribute__((weak, alias("__logbuffer_base")));
> +unsigned long logbuffer_base (void)
> + __attribute__((weak, alias("__logbuffer_base")));
>
> void logbuff_init_ptrs (void)
> {
> diff --git a/common/main.c b/common/main.c
> index a999a5d..5b9da3b 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -48,7 +48,8 @@ DECLARE_GLOBAL_DATA_PTR;
> * Board-specific Platform code can reimplement show_boot_progress () if needed
> */
> void inline __show_boot_progress (int val) {}
> -void inline show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress")));
> +void inline show_boot_progress (int val)
> + __attribute__((weak, alias("__show_boot_progress")));
>
> #if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
> extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* for do_reset() prototype */
> diff --git a/common/serial.c b/common/serial.c
> index b38d1e7..a7c6946 100644
> --- a/common/serial.c
> +++ b/common/serial.c
> @@ -75,7 +75,8 @@ struct serial_device *__default_serial_console (void)
> #endif
> }
>
> -struct serial_device *default_serial_console(void) __attribute__((weak, alias("__default_serial_console")));
> +struct serial_device *default_serial_console(void)
> + __attribute__((weak, alias("__default_serial_console")));
> #endif
>
> int serial_register (struct serial_device *dev)
> diff --git a/cpu/at32ap/cpu.c b/cpu/at32ap/cpu.c
> index f92d3e2..4e7eded 100644
> --- a/cpu/at32ap/cpu.c
> +++ b/cpu/at32ap/cpu.c
> @@ -43,6 +43,9 @@
>
> DECLARE_GLOBAL_DATA_PTR;
>
> +void inline __gclk_init(void) {}
> +void inline gclk_init (void) __attribute__((weak, alias("__gclk_init")));
> +
> int cpu_init(void)
> {
> extern void _evba(void);
> @@ -65,8 +68,7 @@ int cpu_init(void)
> sysreg_write(EVBA, (unsigned long)&_evba);
> asm volatile("csrf %0" : : "i"(SYSREG_EM_OFFSET));
>
> - if(gclk_init)
> - gclk_init();
> + gclk_init();
>
> return 0;
> }
> diff --git a/cpu/blackfin/cpu.h b/cpu/blackfin/cpu.h
> index 0a13c28..5aa1787 100644
> --- a/cpu/blackfin/cpu.h
> +++ b/cpu/blackfin/cpu.h
> @@ -27,7 +27,7 @@
>
> #include <command.h>
>
> -void board_reset(void) __attribute__((__weak__));
> +void board_reset(void);
> void bfin_reset_or_hang(void) __attribute__((__noreturn__));
> void bfin_panic(struct pt_regs *reg);
> void dump(struct pt_regs *regs);
> diff --git a/cpu/blackfin/reset.c b/cpu/blackfin/reset.c
> index d1e34b3..e89b980 100644
> --- a/cpu/blackfin/reset.c
> +++ b/cpu/blackfin/reset.c
> @@ -65,6 +65,9 @@ void bfin_reset(void)
> }
> }
>
> +void inline __board_reset(void) {}
> +void inline board_reset (void) __attribute__((weak, alias("__board_reset")));
> +
> /* We need to trampoline ourselves up into L1 since our linker
> * does not have relaxtion support and will only generate a
> * PC relative call with a 25 bit immediate. This is not enough
> @@ -73,8 +76,7 @@ void bfin_reset(void)
> __attribute__ ((__noreturn__))
> static inline void bfin_reset_trampoline(void)
> {
> - if (board_reset)
> - board_reset();
> + board_reset();
> while (1)
> asm("jump (%0);" : : "a" (bfin_reset));
> }
> diff --git a/cpu/mips/cpu.c b/cpu/mips/cpu.c
> index b7180b0..84c4730 100644
> --- a/cpu/mips/cpu.c
> +++ b/cpu/mips/cpu.c
> @@ -38,13 +38,13 @@
> : \
> : "i" (op), "R" (*(unsigned char *)(addr)))
>
> -void __attribute__((weak)) _machine_restart(void)
> -{
> -}
> +void inline __machine_restart(void) {}
> +void inline machine_restart (void)
> + __attribute__((weak, alias("__machine_restart")));
>
> int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> {
> - _machine_restart();
> + machine_restart();
>
> fprintf(stderr, "*** reset failed ***\n");
> return 0;
> diff --git a/cpu/mpc8xxx/ddr/util.c b/cpu/mpc8xxx/ddr/util.c
> index 27c135b..56de559 100644
> --- a/cpu/mpc8xxx/ddr/util.c
> +++ b/cpu/mpc8xxx/ddr/util.c
> @@ -97,7 +97,8 @@ __fsl_ddr_set_lawbar(const common_timing_params_t *memctl_common_params,
> }
> }
>
> -__attribute__((weak, alias("__fsl_ddr_set_lawbar"))) void
> +void
> fsl_ddr_set_lawbar(const common_timing_params_t *memctl_common_params,
> unsigned int memctl_interleaved,
> - unsigned int ctrl_num);
> + unsigned int ctrl_num)
> + __attribute__((weak, alias("__fsl_ddr_set_lawbar")));
> diff --git a/cpu/ppc4xx/44x_spd_ddr.c b/cpu/ppc4xx/44x_spd_ddr.c
> index 153391e..79976a3 100644
> --- a/cpu/ppc4xx/44x_spd_ddr.c
> +++ b/cpu/ppc4xx/44x_spd_ddr.c
> @@ -79,7 +79,8 @@ void __spd_ddr_init_hang (void)
> {
> hang ();
> }
> -void spd_ddr_init_hang (void) __attribute__((weak, alias("__spd_ddr_init_hang")));
> +void spd_ddr_init_hang (void)
> + __attribute__((weak, alias("__spd_ddr_init_hang")));
>
> /*-----------------------------------------------------------------------------+
> | General Definition
> diff --git a/cpu/ppc4xx/44x_spd_ddr2.c b/cpu/ppc4xx/44x_spd_ddr2.c
> index b40e4b1..d456b97 100644
> --- a/cpu/ppc4xx/44x_spd_ddr2.c
> +++ b/cpu/ppc4xx/44x_spd_ddr2.c
> @@ -171,7 +171,8 @@ void __spd_ddr_init_hang (void)
> {
> hang ();
> }
> -void spd_ddr_init_hang (void) __attribute__((weak, alias("__spd_ddr_init_hang")));
> +void spd_ddr_init_hang (void)
> + __attribute__((weak, alias("__spd_ddr_init_hang")));
>
> /*
> * To provide an interface for board specific config values in this common
> diff --git a/cpu/ppc4xx/4xx_pci.c b/cpu/ppc4xx/4xx_pci.c
> index e8871fc..b1f90b8 100644
> --- a/cpu/ppc4xx/4xx_pci.c
> +++ b/cpu/ppc4xx/4xx_pci.c
> @@ -89,7 +89,8 @@ int __pci_pre_init(struct pci_controller *hose)
> {
> return 1;
> }
> -int pci_pre_init(struct pci_controller *hose) __attribute__((weak, alias("__pci_pre_init")));
> +int pci_pre_init(struct pci_controller *hose)
> + __attribute__((weak, alias("__pci_pre_init")));
>
> #if defined(CONFIG_405GP) || defined(CONFIG_405EP)
>
> diff --git a/cpu/ppc4xx/4xx_pcie.c b/cpu/ppc4xx/4xx_pcie.c
> index fd40d8a..970932b 100644
> --- a/cpu/ppc4xx/4xx_pcie.c
> +++ b/cpu/ppc4xx/4xx_pcie.c
> @@ -729,7 +729,7 @@ int __ppc4xx_init_pcie_port_hw(int port, int rootport)
> #endif /* CONFIG_405EX */
>
> int ppc4xx_init_pcie_port_hw(int port, int rootport)
> -__attribute__((weak, alias("__ppc4xx_init_pcie_port_hw")));
> + __attribute__((weak, alias("__ppc4xx_init_pcie_port_hw")));
>
> /*
> * We map PCI Express configuration access into the 512MB regions
> diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
> index c55e1cf..cd6ed58 100644
> --- a/cpu/ppc4xx/fdt.c
> +++ b/cpu/ppc4xx/fdt.c
> @@ -72,7 +72,8 @@ void __ft_board_setup(void *blob, bd_t *bd)
> fdt_strerror(rc));
> }
> }
> -void ft_board_setup(void *blob, bd_t *bd) __attribute__((weak, alias("__ft_board_setup")));
> +void ft_board_setup(void *blob, bd_t *bd
> + __attribute__((weak, alias("__ft_board_setup")));
>
> /*
> * Fixup all PCIe nodes by setting the device_type property
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index e8afe99..5055274 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -251,14 +251,22 @@ static u64 __flash_read64(void *addr)
> }
>
> #ifdef CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
> -void flash_write8(u8 value, void *addr)__attribute__((weak, alias("__flash_write8")));
> -void flash_write16(u16 value, void *addr)__attribute__((weak, alias("__flash_write16")));
> -void flash_write32(u32 value, void *addr)__attribute__((weak, alias("__flash_write32")));
> -void flash_write64(u64 value, void *addr)__attribute__((weak, alias("__flash_write64")));
> -u8 flash_read8(void *addr)__attribute__((weak, alias("__flash_read8")));
> -u16 flash_read16(void *addr)__attribute__((weak, alias("__flash_read16")));
> -u32 flash_read32(void *addr)__attribute__((weak, alias("__flash_read32")));
> -u64 flash_read64(void *addr)__attribute__((weak, alias("__flash_read64")));
> +void flash_write8(u8 value, void *addr)
> + __attribute__((weak, alias("__flash_write8")));
> +void flash_write16(u16 value, void *addr)
> + __attribute__((weak, alias("__flash_write16")));
> +void flash_write32(u32 value, void *addr)
> + __attribute__((weak, alias("__flash_write32")));
> +void flash_write64(u64 value, void *addr)
> + __attribute__((weak, alias("__flash_write64")));
> +u8 flash_read8(void *addr)
> + __attribute__((weak, alias("__flash_read8")));
> +u16 flash_read16(void *addr)
> + __attribute__((weak, alias("__flash_read16")));
> +u32 flash_read32(void *addr)
> + __attribute__((weak, alias("__flash_read32")));
> +u64 flash_read64(void *addr)
> + __attribute__((weak, alias("__flash_read64")));
> #else
> #define flash_write8 __flash_write8
> #define flash_write16 __flash_write16
> diff --git a/drivers/net/mcfmii.c b/drivers/net/mcfmii.c
> index 2b733c6..41e1c94 100644
> --- a/drivers/net/mcfmii.c
> +++ b/drivers/net/mcfmii.c
> @@ -218,8 +218,6 @@ int mii_discover_phy(struct eth_device *dev)
> }
> #endif /* CONFIG_SYS_DISCOVER_PHY */
>
> -void mii_init(void) __attribute__((weak,alias("__mii_init")));
> -
> void __mii_init(void)
> {
> FEC_INFO_T *info;
> @@ -269,6 +267,7 @@ void __mii_init(void)
> info->dup_spd = miiphy_duplex(dev->name, info->phy_addr) << 16;
> info->dup_spd |= miiphy_speed(dev->name, info->phy_addr);
> }
> +void mii_init(void) __attribute__((weak,alias("__mii_init")));
>
> /*
> * Read and write a MII PHY register, routines used by MII Utilities
> diff --git a/include/asm-avr32/arch-at32ap700x/clk.h b/include/asm-avr32/arch-at32ap700x/clk.h
> index 7817572..7a23fd8 100644
> --- a/include/asm-avr32/arch-at32ap700x/clk.h
> +++ b/include/asm-avr32/arch-at32ap700x/clk.h
> @@ -82,7 +82,7 @@ static inline unsigned long get_spi_clk_rate(unsigned int dev_id)
> #endif
>
> extern void clk_init(void);
> -extern void gclk_init(void) __attribute__((weak));
> +extern void gclk_init(void);
>
> /* Board code may need the SDRAM base clock as a compile-time constant */
> #define SDRAMC_BUS_HZ (MAIN_CLK_RATE >> CONFIG_SYS_CLKDIV_HSB)
> diff --git a/include/asm-mips/reboot.h b/include/asm-mips/reboot.h
> index 978d206..26885c0 100644
> --- a/include/asm-mips/reboot.h
> +++ b/include/asm-mips/reboot.h
> @@ -9,6 +9,6 @@
> #ifndef _ASM_REBOOT_H
> #define _ASM_REBOOT_H
>
> -extern void _machine_restart(void);
> +extern void machine_restart(void);
>
> #endif /* _ASM_REBOOT_H */
> diff --git a/include/common.h b/include/common.h
> index 5968036..6583f00 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -693,7 +693,7 @@ int pcmcia_init (void);
> /*
> * Board-specific Platform code can reimplement show_boot_progress () if needed
> */
> -void __attribute__((weak)) show_boot_progress (int val);
> +void show_boot_progress (int val);
>
> #ifdef CONFIG_INIT_CRITICAL
> #error CONFIG_INIT_CRITICAL is deprecated!
> diff --git a/lib_arm/board.c b/lib_arm/board.c
> index 2358beb..67b9469 100644
> --- a/lib_arm/board.c
> +++ b/lib_arm/board.c
> @@ -123,19 +123,26 @@ void *sbrk (ptrdiff_t increment)
> * May be supplied by boards if desired
> */
> void inline __coloured_LED_init (void) {}
> -void inline coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init")));
> +void inline coloured_LED_init (void)
> + __attribute__((weak, alias("__coloured_LED_init")));
> void inline __red_LED_on (void) {}
> -void inline red_LED_on (void) __attribute__((weak, alias("__red_LED_on")));
> +void inline red_LED_on (void)
> + __attribute__((weak, alias("__red_LED_on")));
> void inline __red_LED_off(void) {}
> -void inline red_LED_off(void) __attribute__((weak, alias("__red_LED_off")));
> +void inline red_LED_off(void)
> + __attribute__((weak, alias("__red_LED_off")));
> void inline __green_LED_on(void) {}
> -void inline green_LED_on(void) __attribute__((weak, alias("__green_LED_on")));
> +void inline green_LED_on(void)
> + __attribute__((weak, alias("__green_LED_on")));
> void inline __green_LED_off(void) {}
> -void inline green_LED_off(void)__attribute__((weak, alias("__green_LED_off")));
> +void inline green_LED_off(void)
> + __attribute__((weak, alias("__green_LED_off")));
> void inline __yellow_LED_on(void) {}
> -void inline yellow_LED_on(void)__attribute__((weak, alias("__yellow_LED_on")));
> +void inline yellow_LED_on(void)
> + __attribute__((weak, alias("__yellow_LED_on")));
> void inline __yellow_LED_off(void) {}
> -void inline yellow_LED_off(void)__attribute__((weak, alias("__yellow_LED_off")));
> +void inline yellow_LED_off(void)
> + __attribute__((weak, alias("__yellow_LED_off")));
>
> /************************************************************************
> * Init Utilities *
> diff --git a/lib_ppc/board.c b/lib_ppc/board.c
> index 289a32a..caebc2b 100644
> --- a/lib_ppc/board.c
> +++ b/lib_ppc/board.c
> @@ -206,7 +206,8 @@ void __board_add_ram_info(int use_default)
> {
> /* please define platform specific board_add_ram_info() */
> }
> -void board_add_ram_info(int) __attribute__((weak, alias("__board_add_ram_info")));
> +void board_add_ram_info(int)
> + __attribute__((weak, alias("__board_add_ram_info")));
>
>
> static int init_func_ram (void)
> @@ -643,7 +644,8 @@ int __is_sata_supported(void)
> * board have such issue.*/
> return 1;
> }
> -int is_sata_supported(void) __attribute__((weak, alias("__is_sata_supported")));
> +int is_sata_supported(void)
> + __attribute__((weak, alias("__is_sata_supported")));
>
> /************************************************************************
> *
> diff --git a/lib_ppc/interrupts.c b/lib_ppc/interrupts.c
> index f603170..696259b 100644
> --- a/lib_ppc/interrupts.c
> +++ b/lib_ppc/interrupts.c
> @@ -32,12 +32,12 @@
> #endif
>
> #ifdef CONFIG_SHOW_ACTIVITY
> -void board_show_activity (ulong) __attribute__((weak, alias("__board_show_activity")));
> -
> void __board_show_activity (ulong dummy)
> {
> return;
> }
> +void board_show_activity (ulong)
> + __attribute__((weak, alias("__board_show_activity")));
> #endif /* CONFIG_SHOW_ACTIVITY */
>
> #ifndef CONFIG_SYS_WATCHDOG_FREQ
> --
> 1.6.0.2.GIT
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
More information about the U-Boot
mailing list