Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.4 /include/linux/moduleparam.h

Filename:/include/linux/moduleparam.h
Lines Added:11
Lines Deleted:1
Also changed in: (Previous) 2.6.24.4-rc3  2.6.24.4-rc2  2.6.24.4-rc1  2.6.24-git22  2.6.24-git21  2.6.24-git20 
(Following) 2.6.24.5  2.6.24.6  2.6.24.7  2.6.25-rc7  2.6.25-rc8  2.6.25-rc9 

Location
[  2.6.24.4
  [  include
    [  linux
       o  moduleparam.h

Patch

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 13410b2..c1d64c2 100644
--- 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 } }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.