summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-04-25 18:23:17 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-28 20:29:17 -0400
commit5c6a8747e0cff47071d6ad3fcfe6f86713cf543a (patch)
tree09aaefc3f9d0f1659c25683e09cb377fdf64417c /drivers/staging
parente0d0bf8a28eb04efd997478ef3d82319cdef9455 (diff)
comedi: get rid of indirection via translated_ioctl()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/comedi_fops.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 9dfb81dfe43c..ecd29f28673c 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2871,16 +2871,6 @@ struct comedi32_insnlist_struct {
compat_uptr_t insns; /* 32-bit 'struct comedi_insn *' */
};
-/* Handle translated ioctl. */
-static int 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);
-
- return -ENOTTY;
-}
-
/* Handle 32-bit COMEDI_CHANINFO ioctl. */
static int compat_chaninfo(struct file *file, unsigned long arg)
{
@@ -2912,7 +2902,7 @@ static int compat_chaninfo(struct file *file, unsigned long arg)
if (err)
return -EFAULT;
- return translated_ioctl(file, COMEDI_CHANINFO, (unsigned long)chaninfo);
+ return comedi_unlocked_ioctl(file, COMEDI_CHANINFO, (unsigned long)chaninfo);
}
/* Handle 32-bit COMEDI_RANGEINFO ioctl. */
@@ -2942,7 +2932,7 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
if (err)
return -EFAULT;
- return translated_ioctl(file, COMEDI_RANGEINFO,
+ return comedi_unlocked_ioctl(file, COMEDI_RANGEINFO,
(unsigned long)rangeinfo);
}
@@ -3063,7 +3053,7 @@ static int compat_cmd(struct file *file, unsigned long arg)
if (rc)
return rc;
- rc = translated_ioctl(file, COMEDI_CMD, (unsigned long)cmd);
+ rc = comedi_unlocked_ioctl(file, COMEDI_CMD, (unsigned long)cmd);
if (rc == -EAGAIN) {
/* Special case: copy cmd back to user. */
err = put_compat_cmd(cmd32, cmd);
@@ -3088,7 +3078,7 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
if (rc)
return rc;
- rc = translated_ioctl(file, COMEDI_CMDTEST, (unsigned long)cmd);
+ rc = comedi_unlocked_ioctl(file, COMEDI_CMDTEST, (unsigned long)cmd);
if (rc < 0)
return rc;
@@ -3174,7 +3164,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
return rc;
}
- return translated_ioctl(file, COMEDI_INSNLIST,
+ return comedi_unlocked_ioctl(file, COMEDI_INSNLIST,
(unsigned long)&s->insnlist);
}
@@ -3192,7 +3182,7 @@ static int compat_insn(struct file *file, unsigned long arg)
if (rc)
return rc;
- return translated_ioctl(file, COMEDI_INSN, (unsigned long)insn);
+ return comedi_unlocked_ioctl(file, COMEDI_INSN, (unsigned long)insn);
}
/*
@@ -3212,7 +3202,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
case COMEDI_BUFINFO:
/* Just need to translate the pointer argument. */
arg = (unsigned long)compat_ptr(arg);
- rc = translated_ioctl(file, cmd, arg);
+ rc = comedi_unlocked_ioctl(file, cmd, arg);
break;
case COMEDI_LOCK:
case COMEDI_UNLOCK:
@@ -3221,7 +3211,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
case COMEDI_SETRSUBD:
case COMEDI_SETWSUBD:
/* No translation needed. */
- rc = translated_ioctl(file, cmd, arg);
+ rc = comedi_unlocked_ioctl(file, cmd, arg);
break;
case COMEDI32_CHANINFO:
rc = compat_chaninfo(file, arg);