linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 00/10] Remove weak function declarations
@ 2014-10-15 17:05 Bjorn Helgaas
  2014-10-15 17:05 ` [PATCH v1 01/10] audit: Remove "weak" from audit_classify_compat_syscall() declaration Bjorn Helgaas
                   ` (10 more replies)
  0 siblings, 11 replies; 48+ messages in thread
From: Bjorn Helgaas @ 2014-10-15 17:05 UTC (permalink / raw)
  To: Jason Wessel, Ralf Baechle, Ingo Molnar, John Stultz, Eric Paris,
	H. Peter Anvin, Thomas Gleixner, Andrew Morton
  Cc: linux-kernel

A common usage of "weak" is for a default implementation of a function.
An architecture that needs something different can supply a non-weak
("strong") implementation, with the expectation that the linker will select
the strong version and discard the weak default version.

We have a few function declarations in header files annotated as "weak".
That causes every *every* definition to be marked "weak", which means there
is no strong version at all.  In this case, the linker selects one of the
weak versions based on link order.  I don't think this is what we want.

These patches remove almost all the weak annotations from header files
(MIPS still uses it for get_c0_compare_int(), apparently relying on the
fact that a weak symbol need not be defined at all).  In most cases, the
default implementation was already marked weak at the definition.  When it
wasn't, I added that.

It might be simplest if I ask Linus to pull these all as a group from my
branch [1].  I'll look for acks from the following people.  If I don't see
an ack, I'll drop the patch and you can take it yourself or ignore it as
you wish.

  Eric:                    audit
  Thomas, Ingo, or Peter:  x86
  Ralf:                    MIPS
  John or Thomas:          clocksource
  Jason:                   kgdb
  Ingo:                    uprobes
  Andrew:                  vmcore, memory-hotplug

I don't know whether these fix any actual bugs.  We *did* have a bug like
this on MIPS a while ago (10629d711ed7 ("PCI: Remove __weak annotation from
pcibios_get_phb_of_node decl")), so it's possible that they do fix
something.

[1] https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=remove-weak-function-declarations

---

Bjorn Helgaas (10):
      audit: Remove "weak" from audit_classify_compat_syscall() declaration
      x86, intel-mid: Remove "weak" from function declarations
      MIPS: CPC: Make mips_cpc_phys_base() static
      MIPS: Remove "weak" from platform_maar_init() declaration
      MIPS: MT: Move "weak" from vpe_run() declaration to definition
      clocksource: Remove "weak" from clocksource_default_clock() declaration
      vmcore: Remove "weak" from function declarations
      kgdb: Remove "weak" from kgdb_arch_pc() declaration
      memory-hotplug: Remove "weak" from memory_block_size_bytes() declaration
      uprobes: Remove "weak" from function declarations


 arch/mips/include/asm/maar.h                       |    2 +-
 arch/mips/include/asm/mips-cpc.h                   |   10 ----------
 arch/mips/include/asm/vpe.h                        |    2 +-
 arch/mips/kernel/mips-cpc.c                        |    2 +-
 arch/mips/kernel/vpe-mt.c                          |    2 +-
 arch/x86/platform/intel-mid/intel_mid_weak_decls.h |    7 +++----
 include/linux/audit.h                              |    2 +-
 include/linux/clocksource.h                        |    2 +-
 include/linux/crash_dump.h                         |   15 +++++++--------
 include/linux/kgdb.h                               |    2 +-
 include/linux/memory.h                             |    2 +-
 include/linux/uprobes.h                            |   14 +++++++-------
 12 files changed, 25 insertions(+), 37 deletions(-)

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2014-10-21 20:05 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-15 17:05 [PATCH v1 00/10] Remove weak function declarations Bjorn Helgaas
2014-10-15 17:05 ` [PATCH v1 01/10] audit: Remove "weak" from audit_classify_compat_syscall() declaration Bjorn Helgaas
2014-10-15 23:25   ` Bjorn Helgaas
2014-10-16 17:02     ` Richard Guy Briggs
2014-10-15 17:05 ` [PATCH v1 02/10] x86, intel-mid: Remove "weak" from function declarations Bjorn Helgaas
2014-10-15 23:26   ` Bjorn Helgaas
2014-10-17  0:42     ` sathyanarayanan kuppuswamy
2014-10-17  1:41       ` David Cohen
2014-10-20 16:15         ` Bjorn Helgaas
2014-10-20 17:55           ` David Cohen
2014-10-16  5:09   ` Ingo Molnar
2014-10-15 17:06 ` [PATCH v1 03/10] MIPS: CPC: Make mips_cpc_phys_base() static Bjorn Helgaas
2014-10-15 23:27   ` Bjorn Helgaas
2014-10-15 23:28     ` Bjorn Helgaas
2014-10-21 20:03       ` Bjorn Helgaas
2014-10-15 17:06 ` [PATCH v1 04/10] MIPS: Remove "weak" from platform_maar_init() declaration Bjorn Helgaas
2014-10-15 23:27   ` Bjorn Helgaas
2014-10-21 20:04     ` Bjorn Helgaas
2014-10-15 17:06 ` [PATCH v1 05/10] MIPS: MT: Move "weak" from vpe_run() declaration to definition Bjorn Helgaas
2014-10-15 23:28   ` Bjorn Helgaas
2014-10-16 13:49     ` Bjorn Helgaas
2014-10-21 20:05       ` Bjorn Helgaas
2014-10-15 17:06 ` [PATCH v1 06/10] clocksource: Remove "weak" from clocksource_default_clock() declaration Bjorn Helgaas
2014-10-15 17:36   ` John Stultz
2014-10-15 23:30   ` Bjorn Helgaas
2014-10-16  7:22     ` Martin Schwidefsky
2014-10-16 13:40       ` Bjorn Helgaas
2014-10-16 13:45         ` Martin Schwidefsky
2014-10-16  5:10   ` Ingo Molnar
2014-10-15 17:06 ` [PATCH v1 07/10] vmcore: Remove "weak" from function declarations Bjorn Helgaas
2014-10-15 23:31   ` Bjorn Helgaas
2014-10-15 23:44     ` Bjorn Helgaas
2014-10-16  7:23       ` Martin Schwidefsky
2014-10-16 20:11       ` Vivek Goyal
2014-10-15 17:06 ` [PATCH v1 08/10] kgdb: Remove "weak" from kgdb_arch_pc() declaration Bjorn Helgaas
2014-10-15 23:35   ` Bjorn Helgaas
2014-10-16 13:38     ` Vineet Gupta
2014-10-17  7:59       ` Vineet Gupta
2014-10-20 16:20         ` Bjorn Helgaas
2014-10-16  0:07   ` Harvey Harrison
2014-10-15 17:06 ` [PATCH v1 09/10] memory-hotplug: Remove "weak" from memory_block_size_bytes() declaration Bjorn Helgaas
2014-10-15 23:38   ` Bjorn Helgaas
2014-10-16  7:23     ` Martin Schwidefsky
2014-10-15 17:06 ` [PATCH v1 10/10] uprobes: Remove "weak" from function declarations Bjorn Helgaas
2014-10-15 23:42   ` Bjorn Helgaas
2014-10-16  5:10   ` Ingo Molnar
2014-10-16  5:57   ` Srikar Dronamraju
2014-10-15 18:27 ` [PATCH v1 00/10] Remove weak " Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).