From c1a6eac1694b1236115ee6e93a4efbf02d05fea3 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Tue, 28 Oct 2014 17:15:47 +0000 Subject: staging: comedi: widen subdevice number argument in ioctl handlers For the `COMEDI_LOCK`, `COMEDI_UNLOCK`, `COMEDI_CANCEL`, and `COMEDI_POLL` ioctls the third argument is a comedi subdevice number. This is passed as an `unsigned long`, but when it is passed down to the ioctl command-specific handler functions `do_lock_ioctl()`, `do_unlock_ioctl()`, `do_cancel_ioctl()`, and `do_poll_ioctl()`, the value has been narrowed to an `unsigned int`. Pass through the argument as an `unsigned long` to avoid truncating the value on 64-bit architectures. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedi_fops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/staging/comedi/comedi_fops.c') diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index a9b7fe52d380..f9f61bda92e2 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1641,7 +1641,7 @@ static int do_cmdtest_ioctl(struct comedi_device *dev, */ -static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, +static int do_lock_ioctl(struct comedi_device *dev, unsigned long arg, void *file) { int ret = 0; @@ -1678,7 +1678,7 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, This function isn't protected by the semaphore, since we already own the lock. */ -static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, +static int do_unlock_ioctl(struct comedi_device *dev, unsigned long arg, void *file) { struct comedi_subdevice *s; @@ -1713,7 +1713,7 @@ static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, nothing */ -static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, +static int do_cancel_ioctl(struct comedi_device *dev, unsigned long arg, void *file) { struct comedi_subdevice *s; @@ -1750,7 +1750,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, nothing */ -static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg, +static int do_poll_ioctl(struct comedi_device *dev, unsigned long arg, void *file) { struct comedi_subdevice *s; -- cgit v1.2.3-55-g7522