diff options
author | Matthias Kaehlcke <mka@chromium.org> | 2017-07-24 21:27:25 -0400 |
---|---|---|
committer | Jessica Yu <jeyu@kernel.org> | 2017-07-29 17:39:23 -0400 |
commit | 0bf8bf50eddc7511b52461bae798cbfaa0157a34 (patch) | |
tree | 9fc326596f74eeac810ce1c12f87adc0fa1a6021 | |
parent | 5279631271b32201243c60308a8987bd585e4460 (diff) |
module: Remove const attribute from alias for MODULE_DEVICE_TABLE
MODULE_DEVICE_TABLE(type, name) creates an alias of type 'extern const
typeof(name)'. If 'name' is already constant the 'const' attribute is
specified twice, which is not allowed in C89 (see discussion at
https://lkml.org/lkml/2017/5/23/1440). Since the kernel is built with
-std=gnu89 clang generates warnings like this:
drivers/thermal/x86_pkg_temp_thermal.c:509:1: warning: duplicate 'const'
declaration specifier
[-Wduplicate-decl-specifier]
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);
^
./include/linux/module.h:212:8: note: expanded from macro 'MODULE_DEVICE_TABLE'
extern const typeof(name) __mod_##type##__##name##_device_table
Remove the const attribute from the alias to avoid the duplicate
specifier. After all it is only an alias and the attribute shouldn't
have any effect.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
-rw-r--r-- | include/linux/module.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index e7bdd549e527..fe5aa3736707 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -209,7 +209,7 @@ extern void cleanup_module(void); | |||
209 | #ifdef MODULE | 209 | #ifdef MODULE |
210 | /* Creates an alias so file2alias.c can find device table. */ | 210 | /* Creates an alias so file2alias.c can find device table. */ |
211 | #define MODULE_DEVICE_TABLE(type, name) \ | 211 | #define MODULE_DEVICE_TABLE(type, name) \ |
212 | extern const typeof(name) __mod_##type##__##name##_device_table \ | 212 | extern typeof(name) __mod_##type##__##name##_device_table \ |
213 | __attribute__ ((unused, alias(__stringify(name)))) | 213 | __attribute__ ((unused, alias(__stringify(name)))) |
214 | #else /* !MODULE */ | 214 | #else /* !MODULE */ |
215 | #define MODULE_DEVICE_TABLE(type, name) | 215 | #define MODULE_DEVICE_TABLE(type, name) |