Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752418AbdCDTXZ (ORCPT ); Sat, 4 Mar 2017 14:23:25 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35845 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752353AbdCDTXY (ORCPT ); Sat, 4 Mar 2017 14:23:24 -0500 From: Cheah Kok Cheong To: abbotti@mev.co.uk, hsweeten@visionengravers.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org Cc: linux-kernel@vger.kernel.org, Cheah Kok Cheong Subject: [PATCH 1/2] Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type Date: Sun, 5 Mar 2017 03:22:32 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1436 Lines: 36 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 --- drivers/staging/comedi/comedi_fops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 57e8599..354d264 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; -- 2.7.4