Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5c6a8747
Commit
5c6a8747
authored
Apr 25, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comedi: get rid of indirection via translated_ioctl()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e0d0bf8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedi_fops.c
+8
-18
No files found.
drivers/staging/comedi/comedi_fops.c
View file @
5c6a8747
...
@@ -2871,16 +2871,6 @@ struct comedi32_insnlist_struct {
...
@@ -2871,16 +2871,6 @@ struct comedi32_insnlist_struct {
compat_uptr_t
insns
;
/* 32-bit 'struct comedi_insn *' */
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. */
/* Handle 32-bit COMEDI_CHANINFO ioctl. */
static
int
compat_chaninfo
(
struct
file
*
file
,
unsigned
long
arg
)
static
int
compat_chaninfo
(
struct
file
*
file
,
unsigned
long
arg
)
{
{
...
@@ -2912,7 +2902,7 @@ 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
)
if
(
err
)
return
-
EFAULT
;
return
-
EFAULT
;
return
translat
ed_ioctl
(
file
,
COMEDI_CHANINFO
,
(
unsigned
long
)
chaninfo
);
return
comedi_unlock
ed_ioctl
(
file
,
COMEDI_CHANINFO
,
(
unsigned
long
)
chaninfo
);
}
}
/* Handle 32-bit COMEDI_RANGEINFO ioctl. */
/* Handle 32-bit COMEDI_RANGEINFO ioctl. */
...
@@ -2942,7 +2932,7 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
...
@@ -2942,7 +2932,7 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
if
(
err
)
if
(
err
)
return
-
EFAULT
;
return
-
EFAULT
;
return
translat
ed_ioctl
(
file
,
COMEDI_RANGEINFO
,
return
comedi_unlock
ed_ioctl
(
file
,
COMEDI_RANGEINFO
,
(
unsigned
long
)
rangeinfo
);
(
unsigned
long
)
rangeinfo
);
}
}
...
@@ -3063,7 +3053,7 @@ static int compat_cmd(struct file *file, unsigned long arg)
...
@@ -3063,7 +3053,7 @@ static int compat_cmd(struct file *file, unsigned long arg)
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
rc
=
translat
ed_ioctl
(
file
,
COMEDI_CMD
,
(
unsigned
long
)
cmd
);
rc
=
comedi_unlock
ed_ioctl
(
file
,
COMEDI_CMD
,
(
unsigned
long
)
cmd
);
if
(
rc
==
-
EAGAIN
)
{
if
(
rc
==
-
EAGAIN
)
{
/* Special case: copy cmd back to user. */
/* Special case: copy cmd back to user. */
err
=
put_compat_cmd
(
cmd32
,
cmd
);
err
=
put_compat_cmd
(
cmd32
,
cmd
);
...
@@ -3088,7 +3078,7 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
...
@@ -3088,7 +3078,7 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
rc
=
translat
ed_ioctl
(
file
,
COMEDI_CMDTEST
,
(
unsigned
long
)
cmd
);
rc
=
comedi_unlock
ed_ioctl
(
file
,
COMEDI_CMDTEST
,
(
unsigned
long
)
cmd
);
if
(
rc
<
0
)
if
(
rc
<
0
)
return
rc
;
return
rc
;
...
@@ -3174,7 +3164,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
...
@@ -3174,7 +3164,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
return
rc
;
return
rc
;
}
}
return
translat
ed_ioctl
(
file
,
COMEDI_INSNLIST
,
return
comedi_unlock
ed_ioctl
(
file
,
COMEDI_INSNLIST
,
(
unsigned
long
)
&
s
->
insnlist
);
(
unsigned
long
)
&
s
->
insnlist
);
}
}
...
@@ -3192,7 +3182,7 @@ static int compat_insn(struct file *file, unsigned long arg)
...
@@ -3192,7 +3182,7 @@ static int compat_insn(struct file *file, unsigned long arg)
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
return
translat
ed_ioctl
(
file
,
COMEDI_INSN
,
(
unsigned
long
)
insn
);
return
comedi_unlock
ed_ioctl
(
file
,
COMEDI_INSN
,
(
unsigned
long
)
insn
);
}
}
/*
/*
...
@@ -3212,7 +3202,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
...
@@ -3212,7 +3202,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
case
COMEDI_BUFINFO
:
case
COMEDI_BUFINFO
:
/* Just need to translate the pointer argument. */
/* Just need to translate the pointer argument. */
arg
=
(
unsigned
long
)
compat_ptr
(
arg
);
arg
=
(
unsigned
long
)
compat_ptr
(
arg
);
rc
=
translat
ed_ioctl
(
file
,
cmd
,
arg
);
rc
=
comedi_unlock
ed_ioctl
(
file
,
cmd
,
arg
);
break
;
break
;
case
COMEDI_LOCK
:
case
COMEDI_LOCK
:
case
COMEDI_UNLOCK
:
case
COMEDI_UNLOCK
:
...
@@ -3221,7 +3211,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
...
@@ -3221,7 +3211,7 @@ static long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
case
COMEDI_SETRSUBD
:
case
COMEDI_SETRSUBD
:
case
COMEDI_SETWSUBD
:
case
COMEDI_SETWSUBD
:
/* No translation needed. */
/* No translation needed. */
rc
=
translat
ed_ioctl
(
file
,
cmd
,
arg
);
rc
=
comedi_unlock
ed_ioctl
(
file
,
cmd
,
arg
);
break
;
break
;
case
COMEDI32_CHANINFO
:
case
COMEDI32_CHANINFO
:
rc
=
compat_chaninfo
(
file
,
arg
);
rc
=
compat_chaninfo
(
file
,
arg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment