Weak header file declarations are error-prone because they make every
definition weak, and the linker chooses one based on link order (see
10629d711ed7 ("PCI: Remove __weak annotation from pcibios_get_phb_of_node
decl")).

That's not a problem for vpe_run() because Kconfig ensures there's exactly
one definition if we build vpe.o:

  - vpe_run() is defined in arch/mips/kernel/vpe-mt.c if
    CONFIG_MIPS_VPE_LOADER_MT=y

  - vpe_run() is defined in arch/mips/mti-malta/malta-amon.c if
    CONFIG_MIPS_VPE_LOADER_CMP=y

  - CONFIG_MIPS_VPE_LOADER_MT and CONFIG_MIPS_VPE_LOADER_CMP cannot both be
    set (MIPS_VPE_LOADER_CMP depends on MIPS_VPE_LOADER && MIPS_CMP;
    MIPS_VPE_LOADER_MT depends on MIPS_VPE_LOADER && !MIPS_CMP)

Remove "weak" from the vpe_run() declaration and don't test whether
vpe_run() is defined.

Simplification-by: James Hogan <james.ho...@imgtec.com>
Signed-off-by: Bjorn Helgaas <bhelg...@google.com>
---
 arch/mips/include/asm/vpe.h |    2 +-
 arch/mips/kernel/vpe.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/vpe.h b/arch/mips/include/asm/vpe.h
index 7849f39..80e70db 100644
--- a/arch/mips/include/asm/vpe.h
+++ b/arch/mips/include/asm/vpe.h
@@ -122,7 +122,7 @@ void release_vpe(struct vpe *v);
 void *alloc_progmem(unsigned long len);
 void release_progmem(void *ptr);
 
-int __weak vpe_run(struct vpe *v);
+int vpe_run(struct vpe *v);
 void cleanup_tc(struct tc *tc);
 
 int __init vpe_module_init(void);
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 11da314..1fd05b5 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -827,7 +827,7 @@ static int vpe_release(struct inode *inode, struct file 
*filp)
 
        hdr = (Elf_Ehdr *) v->pbuffer;
        if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) == 0) {
-               if ((vpe_elfload(v) >= 0) && vpe_run) {
+               if (vpe_elfload(v) >= 0) {
                        vpe_run(v);
                } else {
                        pr_warn("VPE loader: ELF load failed.\n");

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to