Commit d1d78d20 authored by Cheah Kok Cheong's avatar Cheah Kok Cheong Committed by Greg Kroah-Hartman

Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type

Change to unsigned to allow removal of negative value check in
init section. Use smaller data type since the max possible
value currently is 48.
Signed-off-by: default avatarCheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d27ca88
......@@ -76,8 +76,8 @@ struct comedi_file {
#define COMEDI_NUM_SUBDEVICE_MINORS \
(COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
static int comedi_num_legacy_minors;
module_param(comedi_num_legacy_minors, int, 0444);
static unsigned short comedi_num_legacy_minors;
module_param(comedi_num_legacy_minors, ushort, 0444);
MODULE_PARM_DESC(comedi_num_legacy_minors,
"number of comedi minor devices to reserve for non-auto-configured devices (default 0)"
);
......@@ -2857,8 +2857,7 @@ static int __init comedi_init(void)
pr_info("version " COMEDI_RELEASE " - http://www.comedi.org\n");
if (comedi_num_legacy_minors < 0 ||
comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
if (comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
pr_err("invalid value for module parameter \"comedi_num_legacy_minors\". Valid values are 0 through %i.\n",
COMEDI_NUM_BOARD_MINORS);
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment