From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752217AbdG2Vsf (ORCPT ); Sat, 29 Jul 2017 17:48:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbdG2Vse (ORCPT ); Sat, 29 Jul 2017 17:48:34 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E4A222B66 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jeyu@kernel.org Date: Sat, 29 Jul 2017 23:48:25 +0200 From: Jessica Yu To: Matthias Kaehlcke Cc: Rusty Russell , linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Kees Cook , Arnd Bergmann , Doug Anderson , Grant Grundler , Greg Hackmann , Michael Davidson , Nick Desaulniers , Alexander Potapenko , Bernhard.Rosenkranzer@linaro.org Subject: Re: module: Remove const attribute from alias for MODULE_DEVICE_TABLE Message-ID: <20170729214825.mwwadicdayicomln@redbean> References: <20170725012725.120097-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170725012725.120097-1-mka@chromium.org> X-OS: Linux redbean 4.11.9-200.fc25.x86_64 x86_64 User-Agent: NeoMutt/20170714 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Matthias Kaehlcke [24/07/17 18:27 -0700]: >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 Applied, thanks! Jessica > include/linux/module.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >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); > #ifdef MODULE > /* Creates an alias so file2alias.c can find device table. */ > #define MODULE_DEVICE_TABLE(type, name) \ >-extern const typeof(name) __mod_##type##__##name##_device_table \ >+extern typeof(name) __mod_##type##__##name##_device_table \ > __attribute__ ((unused, alias(__stringify(name)))) > #else /* !MODULE */ > #define MODULE_DEVICE_TABLE(type, name) >-- >2.14.0.rc0.284.gd933b75aa4-goog >