lkml.org 
[lkml]   [2015]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 4/8] MIPS: Remove "weak" from get_c0_perfcount_int() declaration
From
Hi Bjorn,

On Tue, Jul 14, 2015 at 9:46 AM, Bjorn Helgaas <bhelgaas@google.com> 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 <bhelgaas@google.com>
> CC: Andrew Bresticker <abrestic@chromium.org>

Reviewed-by: Andrew Bresticker <abrestic@chromium.org>


\
 
 \ /
  Last update: 2015-07-14 19:21    [W:0.045 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site