1. 31 3月, 2009 1 次提交
    • R
      module: include other structures in module version check · 8c8ef42a
      Rusty Russell 提交于
      With CONFIG_MODVERSIONS, we version 'struct module' using a dummy
      export, but other things matter too:
      
      1) 'struct modversion_info' determines the layout of the __versions section,
      2) 'struct kernel_param' determines the layout of the __params section,
      3) 'struct kernel_symbol' determines __ksymtab*.
      4) 'struct marker' determines __markers.
      5) 'struct tracepoint' determines __tracepoints.
      
      So we rename 'struct_module' to 'module_layout' and include these in
      the signature.  Now it's general we can add others later on without
      confusion.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      8c8ef42a
  2. 25 3月, 2009 1 次提交
    • E
      platform: introduce module id table for platform devices · 57fee4a5
      Eric Miao 提交于
      Now platform_device is being widely used on SoC processors where the
      peripherals are attached to the system bus, which is simple enough.
      
      However, silicon IPs for these SoCs are usually shared heavily across
      a family of processors, even products from different companies.  This
      makes the original simple driver name based matching insufficient, or
      simply not straight-forward.
      
      Introduce a module id table for platform devices, and makes it clear
      that a platform driver is able to support some shared IP and handle
      slight differences across different platforms (by 'driver_data').
      Module alias is handled automatically when a MODULE_DEVICE_TABLE()
      is defined.
      
      To not disturb the current platform drivers too much, the matched id
      entry is recorded and can be retrieved by platform_get_device_id().
      Signed-off-by: NEric Miao <eric.miao@marvell.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      57fee4a5
  3. 17 2月, 2009 1 次提交
  4. 06 2月, 2009 1 次提交
    • T
      modpost: NOBITS sections may point beyond the end of the file · 56fc82c5
      Tejun Heo 提交于
      Impact: fix link failure on certain toolchains with specific configs
      
      Recent percpu change made x86_64 split .data.init section into three
      separate segments - data.init, percpu and data.init2.  data.init2 gets
      .data.nosave and .bss.* and is followed by .notes segment.  Depending
      on configuration both segments might contain no data, in which case
      the tool chain makes the section header to contain offset beyond the
      end of the file.
      
      modpost isn't too happy about it and fails build - as reported by
      Pawel Dziekonski:
      
          Building modules, stage 2.
          MODPOST 416 modules
          FATAL: vmlinux is truncated. sechdrs[i].sh_offset=10354688 >
          sizeof(*hrd)=64
          make[1]: *** [__modpost] Error 1
      
      Teach modpost that NOBITS section may point beyond the end of the file
      and that .modinfo can't be NOBITS.
      Reported-by: NPawel Dziekonski <dzieko@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      56fc82c5
  5. 21 1月, 2009 1 次提交
  6. 30 10月, 2008 1 次提交
  7. 15 10月, 2008 1 次提交
  8. 13 10月, 2008 1 次提交
    • D
      Automatic MODULE_ALIAS() for DMI match tables. · d945b697
      David Woodhouse 提交于
      This makes modpost handle MODULE_DEVICE_TABLE(dmi, xxxx).
      
      I had to change the string pointers in the match table to char arrays,
      and picked a size of 79 bytes almost at random -- do we need to make it
      bigger than that? I was a bit concerned about the 'bloat' this
      introduces into the match tables, but they should all be __initdata so
      it shouldn't matter too much.
      
      (Actually, modpost does go through the relocations and look at most of
      them; it wouldn't be impossible to make it handle string pointers -- but
      doesn't seem to be worth the effort, since they're __initdata).
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      d945b697
  9. 11 10月, 2008 1 次提交
    • G
      Staging: add TAINT_CRAP flag to drivers/staging modules · a9860bf0
      Greg Kroah-Hartman 提交于
      We need to add a flag for all code that is in the drivers/staging/
      directory to prevent all other kernel developers from worrying about
      issues here, and to notify users that the drivers might not be as good
      as they are normally used to.
      
      Based on code from Andreas Gruenbacher and Jeff Mahoney to provide a
      TAINT flag for the support level of a kernel module in the Novell
      enterprise kernel release.
      
      This is the code that actually modifies the modules, adding the flag to
      any files in the drivers/staging directory.
      
      Cc: Andreas Gruenbacher <agruen@suse.de>
      Cc: Jeff Mahoney <jeffm@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a9860bf0
  10. 07 10月, 2008 1 次提交
    • M
      Marker depmod fix core kernel list · 87f3b6b6
      Mathieu Desnoyers 提交于
      * Theodore Ts'o (tytso@mit.edu) wrote:
      >
      > I've been playing with adding some markers into ext4 to see if they
      > could be useful in solving some problems along with Systemtap.  It
      > appears, though, that as of 2.6.27-rc8, markers defined in code which is
      > compiled directly into the kernel (i.e., not as modules) don't show up
      > in Module.markers:
      >
      > kvm_trace_entryexit arch/x86/kvm/kvm-intel  %u %p %u %u %u %u %u %u
      > kvm_trace_handler arch/x86/kvm/kvm-intel  %u %p %u %u %u %u %u %u
      > kvm_trace_entryexit arch/x86/kvm/kvm-amd  %u %p %u %u %u %u %u %u
      > kvm_trace_handler arch/x86/kvm/kvm-amd  %u %p %u %u %u %u %u %u
      >
      > (Note the lack of any of the kernel_sched_* markers, and the markers I
      > added for ext4_* and jbd2_* are missing as wel.)
      >
      > Systemtap apparently depends on in-kernel trace_mark being recorded in
      > Module.markers, and apparently it's been claimed that it used to be
      > there.  Is this a bug in systemtap, or in how Module.markers is getting
      > built?   And is there a file that contains the equivalent information
      > for markers located in non-modules code?
      
      I think the problem comes from "markers: fix duplicate modpost entry"
      (commit d35cb360)
      
      Especially :
      
        -   add_marker(mod, marker, fmt);
        +   if (!mod->skip)
        +     add_marker(mod, marker, fmt);
          }
          return;
         fail:
      
      Here is a fix that should take care if this problem.
      
      Thanks for the bug report!
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Tested-by: N"Theodore Ts'o" <tytso@mit.edu>
      CC: Greg KH <greg@kroah.com>
      CC: David Smith <dsmith@redhat.com>
      CC: Roland McGrath <roland@redhat.com>
      CC: Sam Ravnborg <sam@ravnborg.org>
      CC: Wenji Huang <wenji.huang@oracle.com>
      CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      87f3b6b6
  11. 22 8月, 2008 1 次提交
  12. 31 7月, 2008 1 次提交
  13. 25 7月, 2008 1 次提交
  14. 23 7月, 2008 1 次提交
    • M
      markers: fix duplicate modpost entry · d35cb360
      Mathieu Desnoyers 提交于
      When a kernel was rebuilt, the previous Module.markers was not cleared.
      It caused markers with different format strings to appear as duplicates
      when a markers was changed.  This problem is present since
      scripts/mod/modpost.c started to generate Module.markers, commit
      b2e3e658
      
      It therefore applies to 2.6.25, 2.6.26 and linux-next.
      
      I merely merged the patches from Roland, Wenji and Takashi here.
      
      Credits to
      Roland McGrath <roland@redhat.com>
      Wenji Huang <wenji.huang@oracle.com>
      and
      Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
      
      for providing the individual fixes.
      
      - Changelog :
        - Integrated Takashi's Makefile modification to clear Module.markers upon
          make clean.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Wenji Huang <wenji.huang@oracle.com>
      Cc: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d35cb360
  15. 22 7月, 2008 1 次提交
  16. 14 7月, 2008 1 次提交
  17. 12 6月, 2008 1 次提交
    • S
      kbuild: ignore powerpc specific symbols in modpost · 4d7365d6
      Sam Ravnborg 提交于
      Kumar Gala <galak@kernel.crashing.org> wrote:
      We have a case in powerpc in which we want to link some library
      routines with all module objects.  The routines are intended for
      handling out-of-line function call register save/restore so having
      them as EXPORT_SYMBOL() is counter productive (we do also need to
      link the same "library" code into the kernel).
      
      Without this patch a powerpc build would error out and fail
      to build modules with the added register save/restore module.
      
      There were two obvious solutions:
      1) To link the .o file before the modpost stage
      2) To ignore the symbols in modpost
      
      Option 1) was ruled out because we do not have any separate
      linking stage for single file modules.
      
      This patch implements option 2 - and do so only for powerpc.
      
      The symbols we ignore are all undefined symbols named:
      _restgpr_*, _savegpr_*, _rest32gpr_*, _save32gpr_*
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      4d7365d6
  18. 11 5月, 2008 1 次提交
    • A
      kbuild: disable modpost warnings for linkonce sections · fd1db0a3
      Andi Kleen 提交于
      Disable modpost warnings for linkonce sections
      
      My build gives lots of warnings like
      
      WARNING: sound/core/snd.o (.gnu.linkonce.wi.mpspec_def.h.30779716): unexpected section name.
      The (.[number]+) following section name are ld generated and not expected.
      Did you forget to use "ax"/"aw" in a .S file?
      Note that for example <linux/init.h> contains
      section definitions for use in .S files.
      
      But for .linkonce. duplicated sections are actually ok and expected.
      So just disable the warning for this case.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      fd1db0a3
  19. 04 5月, 2008 1 次提交
    • J
      modpost: i2c aliases need no trailing wildcard · ac551828
      Jean Delvare 提交于
      Not all device types need a wildcard at the end of their module
      aliases. In particular, for i2c module aliases, the trailing wildcard
      is not only unneeded, it could also cause the wrong driver to be
      loaded.
      
      As I2C devices have no IDs, i2c module aliases are simple, arbitrary
      device names. For example:
      
      $ /sbin/modinfo lm90
      filename:       /lib/modules/2.6.25-git18/kernel/drivers/hwmon/lm90.ko
      author:         Jean Delvare <khali@linux-fr.org>
      description:    LM90/ADM1032 driver
      license:        GPL
      vermagic:       2.6.25-git18 mod_unload
      depends:        hwmon
      alias:          i2c:lm90*
      alias:          i2c:adm1032*
      alias:          i2c:lm99*
      alias:          i2c:lm86*
      alias:          i2c:max6657*
      alias:          i2c:adt7461*
      alias:          i2c:max6680*
      $
      
      This would cause trouble if one I2C chip name matches the beginning of
      another I2C chip name and both chips are supported by different
      drivers. For example, an i2c device named lm9042 would cause the lm90
      driver to be loaded, while it doesn't support that device. This case
      has yet to be seen in practice, but still, I'd like to fix it now. The
      cleanest fix is to remove the trailing wildcard from i2c module aliases.
      
      Here's a patch doing this.
      
      Not all device type aliases need a trailing wildcard, in particular
      the i2c aliases don't. Don't add a wildcard by default in do_table(),
      instead let each device type handler add it if needed.
      
      I have tested types acpi, dmi, eisa, i2c, ide, ieee1394, input, pci,
      pcmcia, platform, pnp, scsi, serio, ssb and usb. Other types (ccw, of,
      vio, parisc, sdio and virtio) are untested.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Acked-by: NJochen Friedrich <jochen@scram.de>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      ac551828
  20. 30 4月, 2008 1 次提交
    • J
      i2c: Add support for device alias names · d2653e92
      Jean Delvare 提交于
      Based on earlier work by Jon Smirl and Jochen Friedrich.
      
      This patch allows new-style i2c chip drivers to have alias names using
      the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
      point, the old i2c driver binding scheme (driver_name/type) is still
      supported.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Jochen Friedrich <jochen@scram.de>
      Cc: Jon Smirl <jonsmirl@gmail.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      d2653e92
  21. 27 4月, 2008 1 次提交
  22. 26 4月, 2008 2 次提交
    • R
      kbuild: support loading extra symbols in modpost · 2d04b5ae
      Richard Hacker 提交于
      This patch adds a new command line option -E to modpost, expecting a symbol
      file as an argument which is read prior to symbol processing. -E can be
      supplied multiple times for as many files as is needed.
      
      When building kernel modules that depend on other modules not in the main
      kernel tree, modpost complains about undefined symbols:
      # make -C /path/to/linux/kernel M=/path/to/my/module
      ...
      Building modules, stage 2.
      ....
      WARNING: "rt_copy_buf" [/home/rich/osc_etl_rtw/osc_kmod.ko] undefined!
      ...etc
      
      This situation occurs when modpost processes the new module's symbols. When
      it finds symbols not exported by the mainline kernel, it issues this warning.
      
      The patch adds a new command line option -e to modpost which expects a symbol
      file as an argument. The symbols listed in this file are added to modpost's
      symbol tables during startup. -e can be supplied as often as required.
      
      This patch works together with the second patch. It introduces a new make
      variable, KBUILD_EXTRA_SYMBOLS, which is used when calling modpost.
      Signed-off-by: NRichard Hacker <lerichi@gmx.net>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      2d04b5ae
    • S
      kbuild: error out on missing MODULE_LICENSE · eed7d279
      Sam Ravnborg 提交于
      Adrian Bunk suggested a build time check for
      missing MODULE_LICENSE annotation in modules.
      The build time check is fatal as we really
      want this fixed for all modules.
      In-tree modules should all have been fixed up by now.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Adrian Bunk <bunk@kernel.org>
      eed7d279
  23. 20 4月, 2008 1 次提交
    • K
      PNP: add all PNP card device id's as individual aliases · 0c81eed4
      Kay Sievers 提交于
      The current PNP combined card + devices module aliase can
      never ever match anything, because these values are not available
      all at the same time to request a module.
      
      Instead of adding the combined alias, we add the device id's
      all as individual aliases. Device id's are exported by the PNP
      bus and can now properly used to request the loading of a
      matching module.
      
      The module snd-sbawe currently exports aliases, which can never
      match anything:
        alias: pnp:cCTLXXXXdCTL0045dCTL0022*
        alias: pnp:cCTLXXXXdCTL0044dCTL0023*
        alias: pnp:cCTLXXXXdCTL0042dCTL0022*
        alias: pnp:cCTLXXXXdCTL0041dCTL0021*
        alias: pnp:cCTLXXXXdCTL0031dCTL0021*
        alias: pnp:cCTL00eddCTL0041dCTL0070*
        alias: pnp:cCTL00e9dCTL0045dCTL0022*
        alias: pnp:cCTL00e4dCTL0045dCTL0022*
        alias: pnp:cCTL00c7dCTL0045dCTL0022*
        alias: pnp:cCTL00c5dCTL0045dCTL0022*
        alias: pnp:cCTL00c3dCTL0045dCTL0022*
        alias: pnp:cCTL00c1dCTL0042dCTL0022*
        alias: pnp:cCTL00b2dCTL0044dCTL0023*
        alias: pnp:cCTL009edCTL0044dCTL0023*
        alias: pnp:cCTL009ddCTL0042dCTL0022*
        alias: pnp:cCTL009fdCTL0041dCTL0021*
        alias: pnp:cCTL009cdCTL0041dCTL0021*
        alias: pnp:cCTL009adCTL0041dCTL0021*
        alias: pnp:cCTL0054dCTL0031dCTL0021*
        alias: pnp:cCTL0048dCTL0031dCTL0021*
        alias: pnp:cCTL0047dCTL0031dCTL0021*
        alias: pnp:cCTL0046dCTL0031dCTL0021*
        alias: pnp:cCTL0045dCTL0031dCTL0021*
        alias: pnp:cCTL0044dCTL0031dCTL0021*
        alias: pnp:cCTL0043dCTL0031dCTL0021*
        alias: pnp:cCTL0042dCTL0031dCTL0021*
        alias: pnp:cCTL0039dCTL0031dCTL0021*
        alias: pnp:cCTL0035dCTL0031dCTL0021*
      
      With this patch it exports only the device id's, as properly
      matchable aliases:
        alias: pnp:dCTL0070*
        alias: pnp:dCTL0045*
        alias: pnp:dCTL0023*
        alias: pnp:dCTL0044*
        alias: pnp:dCTL0022*
        alias: pnp:dCTL0042*
        alias: pnp:dCTL0041*
        alias: pnp:dCTL0021*
        alias: pnp:dCTL0031*
      
      Now, the exported value of the PNP bus can be used to autoload
      a matching module:
        $ modprobe --first-time -n -v pnp:dCTL0045
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-rawmidi.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/mpu401/snd-mpu401-uart.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-hwdep.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb-common.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-csp.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-dsp.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/opl3/snd-opl3-lib.ko
        insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sbawe.ko
      
        $ grep CTL0045 /sys/bus/pnp/devices/*/id
        /sys/bus/pnp/devices/01:01.00/id:CTL0045
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0c81eed4
  24. 24 3月, 2008 1 次提交
  25. 20 2月, 2008 1 次提交
    • G
      kbuild: fix reversed symbol name order in modpost · b1d2675a
      Geert Uytterhoeven 提交于
      XXXINIT_TO_INIT and XXXEXIT_TO_EXIT warnings use the reversed symbol name order
      in the suggestion, e.g.:
      
          WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
          The function __meminit free_area_init_core() references
          a function __init setup_usemap().
          If free_area_init_core is only used by setup_usemap then
          annotate free_area_init_core with a matching annotation.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      b1d2675a
  26. 14 2月, 2008 1 次提交
    • M
      Linux Kernel Markers: create modpost file · b2e3e658
      Mathieu Desnoyers 提交于
      This adds some new magic in the MODPOST phase for CONFIG_MARKERS.  Analogous
      to the Module.symvers file, the build will now write a Module.markers file
      when CONFIG_MARKERS=y is set.  This file lists the name, defining module, and
      format string of each marker, separated by \t characters.  This simple text
      file can be used by offline build procedures for instrumentation code,
      analogous to how System.map and Module.symvers can be useful to have for
      kernels other than the one you are running right now.
      
      The strings are made easy to extract by having the __trace_mark macro define
      the name and format together in a single array called __mstrtab_* in the
      __markers_strings section.  This is straightforward and reliable as long as
      the marker structs are always defined by this macro.  It is an unreasonable
      amount of hairy work to extract the string pointers from the __markers section
      structs, which entails handling a relocation type for every machine under the
      sun.
      
      Mathieu :
      - Ran through checkpatch.pl
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: David Smith <dsmith@redhat.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b2e3e658
  27. 09 2月, 2008 2 次提交
  28. 03 2月, 2008 2 次提交
  29. 02 2月, 2008 1 次提交
    • G
      USB: handle idVendor of 0x0000 · de6f92b9
      Greg Kroah-Hartman 提交于
      Some crazy devices in the wild have a vendor id of 0x0000.  If we try to
      add a module alias with this id, we just can't do it due to a check in
      the file2alias.c file.  Change the test to verify that both the vendor
      and product ids are 0x0000 to show a real "blank" module alias.
      
      Note, the module-init-tools package also needs to be changed to properly
      generate the depmod tables.
      
      Cc: Janusz <janumix@poczta.fm>
      Cc: stable <stable@kernel.org>
      Cc: Jon Masters <jcm@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      de6f92b9
  30. 29 1月, 2008 8 次提交
    • S
      kbuild: warn about ld added unique sections · e241a630
      Sam Ravnborg 提交于
      If there is a mixture of specifying sections for code in gcc
      and assembler then if the assembler code do not add
      the "ax" flags the linker will see this as two different sections
      and generate unique sections for each. ld does so by adding a dot
      and a number.
      Teach modpost to warn if a section shows up that match this
      pattern - but do this only for non-debug sections.
      
      It will result in warnings like this:
      
      WARNING: vmlinux.o (.sched.text.1): unexpected section name.
      The (.[number]+) following section name are ld generated and not expected.
      Did you forget to use "ax"/"aw" in a .S file?
      Note that for example <linux/init.h> contains
      section definitions for use in .S files.
      
      All warnings seen with a defconfig build for:
      x86 (32+64bit) and sparc64 has been fixed (via respective maintainers).
      
      arm, powerpc (64 bit), s390 (32 bit), ia64, alpha, sh4 checked - no
      warnings seen with a defconfig build.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      e241a630
    • S
      kbuild: add verbose option to Section mismatch reporting in modpost · 588ccd73
      Sam Ravnborg 提交于
      If the config option CONFIG_SECTION_MISMATCH is not set and
      we see a Section mismatch present the following to the user:
      
      modpost: Found 1 section mismatch(es).
      To see additional details select "Enable full Section mismatch analysis"
      in the Kernel Hacking menu (CONFIG_SECTION_MISMATCH).
      
      If the option CONFIG_SECTION_MISMATCH is selected
      then be verbose in the Section mismatch reporting from mdopost.
      Sample outputs:
      
      WARNING: o-x86_64/vmlinux.o(.text+0x7396): Section mismatch in reference from the function discover_ebda() to the variable .init.data:ebda_addr
      The function  discover_ebda() references
      the variable __initdata ebda_addr.
      This is often because discover_ebda lacks a __initdata
      annotation or the annotation of ebda_addr is wrong.
      
      WARNING: o-x86_64/vmlinux.o(.data+0x74d58): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
      The variable pci_serial_quirks references
      the function __devexit pci_plx9050_exit()
      If the reference is valid then annotate the
      variable with __exit* (see linux/init.h) or name the variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      
      WARNING: o-x86_64/vmlinux.o(__ksymtab+0x630): Section mismatch in reference from the variable __ksymtab_arch_register_cpu to the function .cpuinit.text:arch_register_cpu()
      The symbol arch_register_cpu is exported and annotated __cpuinit
      Fix this by removing the __cpuinit annotation of arch_register_cpu or drop the export.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      588ccd73
    • A
      remove __attribute_used__ · 3ff6eecc
      Adrian Bunk 提交于
      Remove the deprecated __attribute_used__.
      
      [Introduce __section in a few places to silence checkpatch /sam]
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      3ff6eecc
    • S
      kbuild: simplified warning report in modpost · 58fb0d4f
      Sam Ravnborg 提交于
      Refactor code so the warning report function
      does nothing else than reporting warnings.
      As a side effect some other code paths were cleaned
      up by this.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      58fb0d4f
    • S
      kbuild: introduce a few helpers in modpost · ff13f926
      Sam Ravnborg 提交于
      Introducing helpers to retreive symbol and section
      names cleaned up the code a bit.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      ff13f926
    • S
      kbuild: use simpler section mismatch warnings in modpost · 157c23c8
      Sam Ravnborg 提交于
      The typical layout is now:
      WARNING: vmlinux.o(.text+0x372ec): Section mismatch: reference to .devinit.text:pci_scan_one_pbm in 'psycho_scan_bus'
      
      This is first step towards more readable warnings.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      157c23c8
    • S
      Use separate sections for __dev/__cpu/__mem code/data · eb8f6890
      Sam Ravnborg 提交于
      Introducing separate sections for __dev* (HOTPLUG),
      __cpu* (HOTPLUG_CPU) and __mem* (MEMORY_HOTPLUG)
      allows us to do a much more reliable Section mismatch
      check in modpost. We are no longer dependent on the actual
      configuration of for example HOTPLUG.
      
      This has the effect that all users see much more
      Section mismatch warnings than before because they
      were almost all hidden when HOTPLUG was enabled.
      The advantage of this is that when building a piece
      of code then it is much more likely that the Section
      mismatch errors are spotted and the warnings will be
      felt less random of nature.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Adrian Bunk <bunk@kernel.org>
      eb8f6890
    • S
      kbuild: check section names consistently in modpost · 6c5bd235
      Sam Ravnborg 提交于
      Now that match() is introduced use it consistently so
      we can share the section name definitions.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      6c5bd235