Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765148AbYCUXRJ (ORCPT ); Fri, 21 Mar 2008 19:17:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763343AbYCUXBE (ORCPT ); Fri, 21 Mar 2008 19:01:04 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:49213 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932160AbYCUXBA (ORCPT ); Fri, 21 Mar 2008 19:01:00 -0400 Message-Id: <20080321224412.552492999@sous-sol.org> References: <20080321224250.144333319@sous-sol.org> User-Agent: quilt/0.46-1 Date: Fri, 21 Mar 2008 15:43:33 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Ivan Kokshaysky , Richard Henderson , Tony Luck , Anton Blanchard , Paul Mackerras , Adrian Bunk , Kamalesh Babulal , Rusty Russell , Mike Pagano , Greg Kroah-Hartman Subject: [patch 43/76] moduleparam: fix alpha, ia64 and ppc64 compile failures Content-Disposition: inline; filename=moduleparam-fix-alpha-ia64-and-ppc64-compile-failures.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2848 Lines: 69 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Ivan Kokshaysky [upstream commit: 91d35dd9] On alpha, ia64 and ppc64 only relocations to local data can go into read-only sections. The vast majority of module parameters use the global generic param_set_*/param_get_* functions, so the 'const' attribute for struct kernel_param is not only useless, but it also causes compile failures due to 'section type conflict' in those rare cases where param_set/get are local functions. This fixes http://bugzilla.kernel.org/show_bug.cgi?id=8964 Signed-off-by: Ivan Kokshaysky Cc: Richard Henderson Cc: Tony Luck Cc: Anton Blanchard Cc: Paul Mackerras Cc: Adrian Bunk Cc: Kamalesh Babulal Cc: Rusty Russell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Mike Pagano [chrisw@sous-sol.org: backport to 2.6.24.3] Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- include/linux/moduleparam.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -62,6 +62,16 @@ struct kparam_array void *elem; }; +/* On alpha, ia64 and ppc64 relocations to global data cannot go into + read-only sections (which is part of respective UNIX ABI on these + platforms). So 'const' makes no sense and even causes compile failures + with some compilers. */ +#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64) +#define __moduleparam_const +#else +#define __moduleparam_const const +#endif + /* This is the fundamental function for registering boot/module parameters. perm sets the visibility in sysfs: 000 means it's not there, read bits mean it's readable, write bits mean it's @@ -71,7 +81,7 @@ struct kparam_array static int __param_perm_check_##name __attribute__((unused)) = \ BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ static const char __param_str_##name[] = prefix #name; \ - static struct kernel_param const __param_##name \ + static struct kernel_param __moduleparam_const __param_##name \ __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, { arg } } -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/