Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753386AbbGNQqp (ORCPT ); Tue, 14 Jul 2015 12:46:45 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:34196 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753081AbbGNQqm (ORCPT ); Tue, 14 Jul 2015 12:46:42 -0400 Subject: [PATCH v2 3/8] MIPS: MT: Remove "weak" from vpe_run() declaration To: Ralf Baechle From: Bjorn Helgaas Cc: Andrew Bresticker , linux-mips@linux-mips.org, James Hogan , linux-kernel@vger.kernel.org Date: Tue, 14 Jul 2015 11:46:38 -0500 Message-ID: <20150714164638.1541.68971.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150714164142.1541.92710.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150714164142.1541.92710.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2209 Lines: 60 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 Signed-off-by: Bjorn Helgaas --- 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/