aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorCheah Kok Cheong <thrust73@gmail.com>2017-03-08 02:13:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-09 14:08:58 +0100
commitd1d78d20800f8e1bd41518d45d5a3d604d9b1040 (patch)
treecb7df19d51651c428d1976c194a76fe0882f13c9 /drivers/staging/comedi/comedi_fops.c
parentstaging: ks7010: fix spelling mistake (diff)
downloadwireguard-linux-d1d78d20800f8e1bd41518d45d5a3d604d9b1040.tar.xz
wireguard-linux-d1d78d20800f8e1bd41518d45d5a3d604d9b1040.zip
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: Cheah Kok Cheong <thrust73@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 8deac8d9225d..92d864fc08ac 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -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;