Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbaJPNt3 (ORCPT ); Thu, 16 Oct 2014 09:49:29 -0400 Received: from mail-qc0-f178.google.com ([209.85.216.178]:35644 "EHLO mail-qc0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752597AbaJPNt0 (ORCPT ); Thu, 16 Oct 2014 09:49:26 -0400 MIME-Version: 1.0 In-Reply-To: References: <20141015165957.4063.66741.stgit@bhelgaas-glaptop2.roam.corp.google.com> <20141015170617.4063.2807.stgit@bhelgaas-glaptop2.roam.corp.google.com> From: Bjorn Helgaas Date: Thu, 16 Oct 2014 07:49:05 -0600 Message-ID: Subject: Re: [PATCH v1 05/10] MIPS: MT: Move "weak" from vpe_run() declaration to definition To: Jason Wessel , Ralf Baechle , Ingo Molnar , John Stultz , Eric Paris , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton Cc: "linux-kernel@vger.kernel.org" , "linux-mips@linux-mips.org" , Stephen Rothwell Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Stephen] On Wed, Oct 15, 2014 at 5:28 PM, Bjorn Helgaas wrote: > [+cc linux-mips] > > On Wed, Oct 15, 2014 at 11:06 AM, Bjorn Helgaas wrote: >> When the "weak" attribute is on a declaration in a header file, every >> definition where the header is included becomes weak, and the linker >> chooses one definition based on link order (see 10629d711ed7 ("PCI: Remove >> __weak annotation from pcibios_get_phb_of_node decl")). >> >> Move the "weak" attribute from the declaration to the default definition so >> we always prefer a non-weak definition over the weak one, independent of >> link order. >> >> Signed-off-by: Bjorn Helgaas >> CC: linux-mips@linux-mips.org >> --- >> arch/mips/include/asm/vpe.h | 2 +- >> arch/mips/kernel/vpe-mt.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 7849f3978fea..80e70dbd1f64 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-mt.c b/arch/mips/kernel/vpe-mt.c >> index 2e003b11a098..0e5899a2cd96 100644 >> --- a/arch/mips/kernel/vpe-mt.c >> +++ b/arch/mips/kernel/vpe-mt.c >> @@ -23,7 +23,7 @@ static int major; >> static int hw_tcs, hw_vpes; >> >> /* We are prepared so configure and start the VPE... */ >> -int vpe_run(struct vpe *v) >> +int __weak vpe_run(struct vpe *v) >> { >> unsigned long flags, val, dmt_flag; >> struct vpe_notifications *notifier; >> Just FYI, this patch was in linux-next today, but I dropped it temporarily because Fengguang's auto-builder found the following issue with it: All error/warnings: arch/mips/kernel/vpe.c: In function 'vpe_release': >> arch/mips/kernel/vpe.c:830:29: error: the address of 'vpe_run' will always evaluate as 'true' [-Werror=address] if ((vpe_elfload(v) >= 0) && vpe_run) { ^ cc1: all warnings being treated as errors -- 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/