Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752893AbbGNRN2 (ORCPT ); Tue, 14 Jul 2015 13:13:28 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:33809 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbbGNRN1 (ORCPT ); Tue, 14 Jul 2015 13:13:27 -0400 MIME-Version: 1.0 In-Reply-To: <20150714164647.1541.42503.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150714164142.1541.92710.stgit@bhelgaas-glaptop2.roam.corp.google.com> <20150714164647.1541.42503.stgit@bhelgaas-glaptop2.roam.corp.google.com> Date: Tue, 14 Jul 2015 10:13:26 -0700 X-Google-Sender-Auth: UI2-Od8aJ59-K0FWGDVrWRAsbkI Message-ID: Subject: Re: [PATCH v2 4/8] MIPS: Remove "weak" from get_c0_perfcount_int() declaration From: Andrew Bresticker To: Bjorn Helgaas Cc: Ralf Baechle , Linux-MIPS , James Hogan , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 29 Hi Bjorn, On Tue, Jul 14, 2015 at 9:46 AM, Bjorn Helgaas wrote: > 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")). > > get_c0_perfcount_int() is defined in several files. Every definition is > weak, so I assume Kconfig prevents two or more from being included. The > callers contain identical default code used when get_c0_perfcount_int() > isn't defined at all. > > Add a weak get_c0_perfcount_int() definition with the default code and > remove the weak annotation from the declaration. > > Then the platform implementations will be strong and will override the weak > default. If multiple platforms are ever configured in, we'll get a link > error instead of calling a random platform's implementation. > > Signed-off-by: Bjorn Helgaas > CC: Andrew Bresticker Reviewed-by: Andrew Bresticker -- 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/