[PATCH 7/7] staging: comedi: comedi_compat.c: use long unlocked_ioctl return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The `unlocked_ioctl` and `compat_ioctl` file operations are both defined
to return a `long` (I don't know why).  Comedi's `compat_ioctl` handler
`comedi_compat_ioctl()` and its helper functions currently assume the
`unlocked_ioctl` handler return value will fit in an `int` (which it
does, in fact).  Change it to pass through the full `long` return value.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/comedi_compat32.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
index 24078b9..06ccf3c 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -87,8 +87,8 @@ struct comedi32_insnlist_struct {
 };
 
 /* Handle translated ioctl. */
-static int translated_ioctl(struct file *file, unsigned int cmd,
-			    unsigned long arg)
+static long translated_ioctl(struct file *file, unsigned int cmd,
+			     unsigned long arg)
 {
 	if (file->f_op->unlocked_ioctl)
 		return file->f_op->unlocked_ioctl(file, cmd, arg);
@@ -97,7 +97,7 @@ static int translated_ioctl(struct file *file, unsigned int cmd,
 }
 
 /* Handle 32-bit COMEDI_CHANINFO ioctl. */
-static int compat_chaninfo(struct file *file, unsigned long arg)
+static long compat_chaninfo(struct file *file, unsigned long arg)
 {
 	struct comedi_chaninfo __user *chaninfo;
 	struct comedi32_chaninfo_struct __user *chaninfo32;
@@ -131,7 +131,7 @@ static int compat_chaninfo(struct file *file, unsigned long arg)
 }
 
 /* Handle 32-bit COMEDI_RANGEINFO ioctl. */
-static int compat_rangeinfo(struct file *file, unsigned long arg)
+static long compat_rangeinfo(struct file *file, unsigned long arg)
 {
 	struct comedi_rangeinfo __user *rangeinfo;
 	struct comedi32_rangeinfo_struct __user *rangeinfo32;
@@ -264,7 +264,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
 }
 
 /* Handle 32-bit COMEDI_CMD ioctl. */
-static int compat_cmd(struct file *file, unsigned long arg)
+static long compat_cmd(struct file *file, unsigned long arg)
 {
 	struct comedi_cmd __user *cmd;
 	struct comedi32_cmd_struct __user *cmd32;
@@ -290,11 +290,12 @@ static int compat_cmd(struct file *file, unsigned long arg)
 }
 
 /* Handle 32-bit COMEDI_CMDTEST ioctl. */
-static int compat_cmdtest(struct file *file, unsigned long arg)
+static long compat_cmdtest(struct file *file, unsigned long arg)
 {
 	struct comedi_cmd __user *cmd;
 	struct comedi32_cmd_struct __user *cmd32;
-	int rc, err;
+	long rc;
+	int err;
 
 	cmd32 = compat_ptr(arg);
 	cmd = compat_alloc_user_space(sizeof(*cmd));
@@ -344,7 +345,7 @@ static int get_compat_insn(struct comedi_insn __user *insn,
 }
 
 /* Handle 32-bit COMEDI_INSNLIST ioctl. */
-static int compat_insnlist(struct file *file, unsigned long arg)
+static long compat_insnlist(struct file *file, unsigned long arg)
 {
 	struct combined_insnlist {
 		struct comedi_insnlist insnlist;
@@ -394,7 +395,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
 }
 
 /* Handle 32-bit COMEDI_INSN ioctl. */
-static int compat_insn(struct file *file, unsigned long arg)
+static long compat_insn(struct file *file, unsigned long arg)
 {
 	struct comedi_insn __user *insn;
 	struct comedi32_insn_struct __user *insn32;
@@ -417,7 +418,7 @@ static int compat_insn(struct file *file, unsigned long arg)
  */
 long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	int rc;
+	long rc;
 
 	switch (cmd) {
 	case COMEDI_DEVCONFIG:
-- 
2.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux