aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/moduleparam.h
diff options
context:
space:
mode:
authorRichard Kennedy <richard@rsk.demon.co.uk>2011-05-19 18:55:25 -0400
committerRusty Russell <rusty@rustcorp.com.au>2011-05-19 03:25:25 -0400
commitc5be0b2eb1ca05e0cd747f9c0ba552c6ee8827a0 (patch)
tree2252ad213e238dafec0d0a0d662ff1b53377b77a /include/linux/moduleparam.h
parenta288bd651f4180c224cfddf837a0416157a36661 (diff)
module: reorder kparam_array to remove alignment padding on 64 bit builds
Reorder structure kparam_array to remove 8 bytes of alignment padding on 64 bit builds, dropping its size from 40 to 32 bytes. Also update the macro module_param_array_named to initialise the structure using its member names to allow it to be changed without touching all its call sites. 'git grep' finds module_param_array in 1037 places so this patch will save a small amount of data space across many modules. Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r--include/linux/moduleparam.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 07b41951e3fa..ddaae98c53f9 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -67,9 +67,9 @@ struct kparam_string {
67struct kparam_array 67struct kparam_array
68{ 68{
69 unsigned int max; 69 unsigned int max;
70 unsigned int elemsize;
70 unsigned int *num; 71 unsigned int *num;
71 const struct kernel_param_ops *ops; 72 const struct kernel_param_ops *ops;
72 unsigned int elemsize;
73 void *elem; 73 void *elem;
74}; 74};
75 75
@@ -371,8 +371,9 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
371 */ 371 */
372#define module_param_array_named(name, array, type, nump, perm) \ 372#define module_param_array_named(name, array, type, nump, perm) \
373 static const struct kparam_array __param_arr_##name \ 373 static const struct kparam_array __param_arr_##name \
374 = { ARRAY_SIZE(array), nump, &param_ops_##type, \ 374 = { .max = ARRAY_SIZE(array), .num = nump, \
375 sizeof(array[0]), array }; \ 375 .ops = &param_ops_##type, \
376 .elemsize = sizeof(array[0]), .elem = array }; \
376 __module_param_call(MODULE_PARAM_PREFIX, name, \ 377 __module_param_call(MODULE_PARAM_PREFIX, name, \
377 &param_array_ops, \ 378 &param_array_ops, \
378 .arr = &__param_arr_##name, \ 379 .arr = &__param_arr_##name, \