]> git.baikalelectronics.ru Git - kernel.git/commit
x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id"
authorBehan Webster <behanw@converseincode.com>
Thu, 13 Feb 2014 20:21:48 +0000 (12:21 -0800)
committerBehan Webster <behanw@converseincode.com>
Wed, 9 Apr 2014 20:44:35 +0000 (13:44 -0700)
commita3f61e61a67d389c9f71153d3d1cceb79f8f004b
tree99338cfe47d8dce3c97320de34b5926fa4788bb8
parent3fc705cfe34ad2c8da3795eb7776b1289e6d5e21
x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id"

Similar to the fix in db3e6bcb0aea5b6c03bfde501d28e5fc85c82cfe

MODULE_DEVICE_TABLE(x86cpu, ...) expects the struct to be called struct
x86cpu_device_id, and not struct x86_cpu_id which is what is used in the rest
of the kernel code.  Although gcc seems to ignore this error, clang fails
without this define to fix the name.

Code from drivers/thermal/x86_pkg_temp_thermal.c
static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = { ... };
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);

Error from clang:
drivers/thermal/x86_pkg_temp_thermal.c:577:1: error: variable has
      incomplete type 'const struct x86cpu_device_id'
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);
^
include/linux/module.h:145:3: note: expanded from macro
      'MODULE_DEVICE_TABLE'
  MODULE_GENERIC_TABLE(type##_device, name)
  ^
include/linux/module.h:87:32: note: expanded from macro
      'MODULE_GENERIC_TABLE'
extern const struct gtype##_id __mod_##gtype##_table            \
                               ^
<scratch space>:143:1: note: expanded from here
__mod_x86cpu_device_table
^
drivers/thermal/x86_pkg_temp_thermal.c:577:1: note: forward declaration of
      'struct x86cpu_device_id'
include/linux/module.h:145:3: note: expanded from macro
      'MODULE_DEVICE_TABLE'
  MODULE_GENERIC_TABLE(type##_device, name)
  ^
include/linux/module.h:87:21: note: expanded from macro
      'MODULE_GENERIC_TABLE'
extern const struct gtype##_id __mod_##gtype##_table            \
                    ^
<scratch space>:141:1: note: expanded from here
x86cpu_device_id
^
1 error generated.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/mod_devicetable.h