diff options
author | Dan Streetman <ddstreet@ieee.org> | 2015-06-16 16:47:52 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-06-23 01:57:37 -0400 |
commit | 5104b7d7678b0029417f6ac08243773a77259ac6 (patch) | |
tree | bf1a7a2703674d474db5618302cf8b5acf3f8adc /kernel/params.c | |
parent | 74c3dea355245c17ee407a3ce3ea34f55b40f2eb (diff) |
module: make perm const
Change the struct kernel_param.perm field to a const, as it should never
be changed.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (cut from larger patch)
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/params.c b/kernel/params.c index e906874da5fc..a8b09f6c87dc 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -395,12 +395,11 @@ EXPORT_SYMBOL(param_ops_invbool); | |||
395 | 395 | ||
396 | int param_set_bint(const char *val, const struct kernel_param *kp) | 396 | int param_set_bint(const char *val, const struct kernel_param *kp) |
397 | { | 397 | { |
398 | struct kernel_param boolkp; | 398 | /* Match bool exactly, by re-using it. */ |
399 | struct kernel_param boolkp = *kp; | ||
399 | bool v; | 400 | bool v; |
400 | int ret; | 401 | int ret; |
401 | 402 | ||
402 | /* Match bool exactly, by re-using it. */ | ||
403 | boolkp = *kp; | ||
404 | boolkp.arg = &v; | 403 | boolkp.arg = &v; |
405 | 404 | ||
406 | ret = param_set_bool(val, &boolkp); | 405 | ret = param_set_bool(val, &boolkp); |
@@ -480,9 +479,8 @@ static int param_array_get(char *buffer, const struct kernel_param *kp) | |||
480 | { | 479 | { |
481 | int i, off, ret; | 480 | int i, off, ret; |
482 | const struct kparam_array *arr = kp->arr; | 481 | const struct kparam_array *arr = kp->arr; |
483 | struct kernel_param p; | 482 | struct kernel_param p = *kp; |
484 | 483 | ||
485 | p = *kp; | ||
486 | for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i++) { | 484 | for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i++) { |
487 | if (i) | 485 | if (i) |
488 | buffer[off++] = ','; | 486 | buffer[off++] = ','; |