HCoop
/
bpt
/
coccinelle.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
permit multiline comments and strings in macros
[bpt/coccinelle.git]
/
demos
/
video_usercopy.c
1
int
p20_ioctl
(
int
cmd
,
void
*
arg
) {
2
switch
(
cmd
) {
3
case
VIDIOGCTUNER
: {
4
struct
video_tuner v
;
5
if
(
copy_from_user
(&
v
,
arg
)!=
0
)
6
return
-
EFAULT
;
7
if
(
v
.
tuner
)
8
return
-
EINVAL
;
9
v
.
rangelow
=
87
*
16000
;
10
v
.
rangehigh
=
108
*
16000
;
11
if
(
copy_to_user
(
arg
,&
v
))
12
return
-
EFAULT
;
13
return
0
;
14
}
15
case
AGCTUNER
: {
16
struct
video_tuner v
;
17
if
(
copy_from_user
(&
v
,
arg
))
18
{
19
return
-
EFAULT
;
20
}
21
if
(
v
.
tuner
)
22
return
-
EINVAL
;
23
v
.
rangelow
=
0
;
24
v
.
rangehigh
=
0
;
25
if
(
copy_to_user
(
arg
,&
v
))
26
return
-
EFAULT
;
27
return
0
;
28
}
29
}
30
}