Skip to content

Commit 5c6a874

Browse files
author
Al Viro
committed
comedi: get rid of indirection via translated_ioctl()
Signed-off-by: Al Viro <[email protected]>
1 parent e0d0bf8 commit 5c6a874

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

drivers/staging/comedi/comedi_fops.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,16 +2871,6 @@ struct comedi32_insnlist_struct {
28712871
compat_uptr_t insns; /* 32-bit 'struct comedi_insn *' */
28722872
};
28732873

2874-
/* Handle translated ioctl. */
2875-
static int translated_ioctl(struct file *file, unsigned int cmd,
2876-
unsigned long arg)
2877-
{
2878-
if (file->f_op->unlocked_ioctl)
2879-
return file->f_op->unlocked_ioctl(file, cmd, arg);
2880-
2881-
return -ENOTTY;
2882-
}
2883-
28842874
/* Handle 32-bit COMEDI_CHANINFO ioctl. */
28852875
static int compat_chaninfo(struct file *file, unsigned long arg)
28862876
{
@@ -2912,7 +2902,7 @@ static int compat_chaninfo(struct file *file, unsigned long arg)
29122902
if (err)
29132903
return -EFAULT;
29142904

2915-
return translated_ioctl(file, COMEDI_CHANINFO, (unsigned long)chaninfo);
2905+
return comedi_unlocked_ioctl(file, COMEDI_CHANINFO, (unsigned long)chaninfo);
29162906
}
29172907

29182908
/* Handle 32-bit COMEDI_RANGEINFO ioctl. */
@@ -2942,7 +2932,7 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
29422932
if (err)
29432933
return -EFAULT;
29442934

2945-
return translated_ioctl(file, COMEDI_RANGEINFO,
2935+
return comedi_unlocked_ioctl(file, COMEDI_RANGEINFO,
29462936
(unsigned long)rangeinfo);
29472937
}
29482938

@@ -3063,7 +3053,7 @@ static int compat_cmd(struct file *file, unsigned long arg)
30633053
if (rc)
30643054
return rc;
30653055

3066-
rc = translated_ioctl(file, COMEDI_CMD, (unsigned long)cmd);
3056+
rc = comedi_unlocked_ioctl(file, COMEDI_CMD, (unsigned long)cmd);
30673057
if (rc == -EAGAIN) {
30683058
/* Special case: copy cmd back to user. */
30693059
err = put_compat_cmd(cmd32, cmd);
@@ -3088,7 +3078,7 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
30883078
if (rc)
30893079
return rc;
30903080

3091-
rc = translated_ioctl(file, COMEDI_CMDTEST, (unsigned long)cmd);
3081+
rc = comedi_unlocked_ioctl(file, COMEDI_CMDTEST, (unsigned long)cmd);
30923082
if (rc < 0)
30933083
return rc;
30943084

@@ -3174,7 +3164,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
31743164
return rc;
31753165
}
31763166

3177-
return translated_ioctl(file, COMEDI_INSNLIST,
3167+
return comedi_unlocked_ioctl(file, COMEDI_INSNLIST,
31783168
(unsigned long)&s->insnlist);
31793169
}
31803170

@@ -3192,7 +3182,7 @@ static int compat_insn(struct file *file, unsigned long arg)
31923182
if (rc)
31933183
return rc;
31943184

3195-
return translated_ioctl(file, COMEDI_INSN, (unsigned long)insn);
3185+
return comedi_unlocked_ioctl(file, COMEDI_INSN, (unsigned long)insn);
31963186
}
31973187

31983188
/*
@@ -3212,7 +3202,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
32123202
case COMEDI_BUFINFO:
32133203
/* Just need to translate the pointer argument. */
32143204
arg = (unsigned long)compat_ptr(arg);
3215-
rc = translated_ioctl(file, cmd, arg);
3205+
rc = comedi_unlocked_ioctl(file, cmd, arg);
32163206
break;
32173207
case COMEDI_LOCK:
32183208
case COMEDI_UNLOCK:
@@ -3221,7 +3211,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
32213211
case COMEDI_SETRSUBD:
32223212
case COMEDI_SETWSUBD:
32233213
/* No translation needed. */
3224-
rc = translated_ioctl(file, cmd, arg);
3214+
rc = comedi_unlocked_ioctl(file, cmd, arg);
32253215
break;
32263216
case COMEDI32_CHANINFO:
32273217
rc = compat_chaninfo(file, arg);

0 commit comments

Comments
 (0)