Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Simplify the weak annotation with __weak

Found by

$ find arch/mips/ -name "*.c" | xargs -i grep -H weak {} | grep -v __weak

[Ralf: Made this bulletproof by including <linux/compiler.h>]

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/874/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Wu Zhangjin and committed by
Ralf Baechle
e52dd9fc aae7e8da

+6 -5
+2 -2
arch/mips/boot/compressed/dbg.c
··· 5 5 * please select SYS_SUPPORTS_ZBOOT_UART16550 for your machine. othewise, you 6 6 * need to implement your own putc(). 7 7 */ 8 - 8 + #include <linux/compiler.h> 9 9 #include <linux/init.h> 10 10 #include <linux/types.h> 11 11 12 - void __attribute__ ((weak)) putc(char c) 12 + void __weak putc(char c) 13 13 { 14 14 } 15 15
+4 -3
arch/mips/oprofile/common.c
··· 6 6 * Copyright (C) 2004, 2005 Ralf Baechle 7 7 * Copyright (C) 2005 MIPS Technologies, Inc. 8 8 */ 9 + #include <linux/compiler.h> 9 10 #include <linux/errno.h> 10 11 #include <linux/init.h> 11 12 #include <linux/oprofile.h> ··· 15 14 16 15 #include "op_impl.h" 17 16 18 - extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak)); 19 - extern struct op_mips_model op_model_rm9000_ops __attribute__((weak)); 20 - extern struct op_mips_model op_model_loongson2_ops __attribute__((weak)); 17 + extern struct op_mips_model op_model_mipsxx_ops __weak; 18 + extern struct op_mips_model op_model_rm9000_ops __weak; 19 + extern struct op_mips_model op_model_loongson2_ops __weak; 21 20 22 21 static struct op_mips_model *model; 23 22