Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5104b7d7 authored by Dan Streetman's avatar Dan Streetman Committed by Rusty Russell
Browse files

module: make perm const



Change the struct kernel_param.perm field to a const, as it should never
be changed.

Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (cut from larger patch)
parent 74c3dea3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -68,7 +68,7 @@ enum {
struct kernel_param {
struct kernel_param {
	const char *name;
	const char *name;
	const struct kernel_param_ops *ops;
	const struct kernel_param_ops *ops;
	u16 perm;
	const u16 perm;
	s8 level;
	s8 level;
	u8 flags;
	u8 flags;
	union {
	union {
+3 −5
Original line number Original line Diff line number Diff line
@@ -395,12 +395,11 @@ EXPORT_SYMBOL(param_ops_invbool);


int param_set_bint(const char *val, const struct kernel_param *kp)
int param_set_bint(const char *val, const struct kernel_param *kp)
{
{
	struct kernel_param boolkp;
	/* Match bool exactly, by re-using it. */
	struct kernel_param boolkp = *kp;
	bool v;
	bool v;
	int ret;
	int ret;


	/* Match bool exactly, by re-using it. */
	boolkp = *kp;
	boolkp.arg = &v;
	boolkp.arg = &v;


	ret = param_set_bool(val, &boolkp);
	ret = param_set_bool(val, &boolkp);
@@ -480,9 +479,8 @@ static int param_array_get(char *buffer, const struct kernel_param *kp)
{
{
	int i, off, ret;
	int i, off, ret;
	const struct kparam_array *arr = kp->arr;
	const struct kparam_array *arr = kp->arr;
	struct kernel_param p;
	struct kernel_param p = *kp;


	p = *kp;
	for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i++) {
	for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i++) {
		if (i)
		if (i)
			buffer[off++] = ',';
			buffer[off++] = ',';