Skip to content

Commit

Permalink
module: make module param bint handle nul value
Browse files Browse the repository at this point in the history
Allow bint param accept nul values, just do same as bool param.

Signed-off-by: Dave Young <dyoung@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Dave Young authored and Rusty Russell committed Feb 14, 2012
1 parent d65b4e9 commit 10f296c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ static int parse_one(char *param,
for (i = 0; i < num_params; i++) {
if (parameq(param, params[i].name)) {
/* No one handled NULL, so do it here. */
if (!val && params[i].ops->set != param_set_bool)
if (!val && params[i].ops->set != param_set_bool
&& params[i].ops->set != param_set_bint)
return -EINVAL;
pr_debug("They are equal! Calling %p\n",
params[i].ops->set);
Expand Down

0 comments on commit 10f296c

Please sign in to comment.