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
nexedi
linux
Commits
bec737de
Commit
bec737de
authored
Jun 23, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: trivial drivers/isdn/* annotations
parent
f4a4c86b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
81 deletions
+77
-81
drivers/isdn/capi/capi.c
drivers/isdn/capi/capi.c
+20
-22
drivers/isdn/i4l/isdn_common.c
drivers/isdn/i4l/isdn_common.c
+39
-39
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_net.c
+10
-11
drivers/isdn/i4l/isdn_net.h
drivers/isdn/i4l/isdn_net.h
+2
-2
drivers/isdn/i4l/isdn_tty.c
drivers/isdn/i4l/isdn_tty.c
+4
-4
drivers/isdn/i4l/isdn_x25iface.c
drivers/isdn/i4l/isdn_x25iface.c
+2
-3
No files found.
drivers/isdn/capi/capi.c
View file @
bec737de
...
...
@@ -650,7 +650,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
/* -------- file_operations for capidev ----------------------------- */
static
ssize_t
capi_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
ppos
)
capi_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
capidev
*
cdev
=
(
struct
capidev
*
)
file
->
private_data
;
struct
sk_buff
*
skb
;
...
...
@@ -693,7 +693,7 @@ capi_read(struct file *file, char *buf, size_t count, loff_t *ppos)
}
static
ssize_t
capi_write
(
struct
file
*
file
,
const
char
*
buf
,
size_t
count
,
loff_t
*
ppos
)
capi_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
capidev
*
cdev
=
(
struct
capidev
*
)
file
->
private_data
;
struct
sk_buff
*
skb
;
...
...
@@ -766,6 +766,7 @@ capi_ioctl(struct inode *inode, struct file *file,
struct
capi20_appl
*
ap
=
&
cdev
->
ap
;
capi_ioctl_struct
data
;
int
retval
=
-
EINVAL
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
switch
(
cmd
)
{
case
CAPI_REGISTER
:
...
...
@@ -773,7 +774,7 @@ capi_ioctl(struct inode *inode, struct file *file,
if
(
ap
->
applid
)
return
-
EEXIST
;
if
(
copy_from_user
(
&
cdev
->
ap
.
rparam
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
cdev
->
ap
.
rparam
,
argp
,
sizeof
(
struct
capi_register_params
)))
return
-
EFAULT
;
...
...
@@ -789,14 +790,13 @@ capi_ioctl(struct inode *inode, struct file *file,
case
CAPI_GET_VERSION
:
{
if
(
copy_from_user
((
void
*
)
&
data
.
contr
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
data
.
contr
,
argp
,
sizeof
(
data
.
contr
)))
return
-
EFAULT
;
cdev
->
errcode
=
capi20_get_version
(
data
.
contr
,
&
data
.
version
);
if
(
cdev
->
errcode
)
return
-
EIO
;
if
(
copy_to_user
(
(
void
*
)
arg
,
(
void
*
)
&
data
.
version
,
if
(
copy_to_user
(
argp
,
&
data
.
version
,
sizeof
(
data
.
version
)))
return
-
EFAULT
;
}
...
...
@@ -804,20 +804,20 @@ capi_ioctl(struct inode *inode, struct file *file,
case
CAPI_GET_SERIAL
:
{
if
(
copy_from_user
(
(
void
*
)
&
data
.
contr
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
data
.
contr
,
argp
,
sizeof
(
data
.
contr
)))
return
-
EFAULT
;
cdev
->
errcode
=
capi20_get_serial
(
data
.
contr
,
data
.
serial
);
if
(
cdev
->
errcode
)
return
-
EIO
;
if
(
copy_to_user
(
(
void
*
)
arg
,
(
void
*
)
data
.
serial
,
if
(
copy_to_user
(
argp
,
data
.
serial
,
sizeof
(
data
.
serial
)))
return
-
EFAULT
;
}
return
0
;
case
CAPI_GET_PROFILE
:
{
if
(
copy_from_user
(
(
void
*
)
&
data
.
contr
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
data
.
contr
,
argp
,
sizeof
(
data
.
contr
)))
return
-
EFAULT
;
...
...
@@ -826,8 +826,8 @@ capi_ioctl(struct inode *inode, struct file *file,
if
(
cdev
->
errcode
)
return
-
EIO
;
retval
=
copy_to_user
(
(
void
*
)
arg
,
(
void
*
)
&
data
.
profile
.
ncontroller
,
retval
=
copy_to_user
(
argp
,
&
data
.
profile
.
ncontroller
,
sizeof
(
data
.
profile
.
ncontroller
));
}
else
{
...
...
@@ -835,8 +835,7 @@ capi_ioctl(struct inode *inode, struct file *file,
if
(
cdev
->
errcode
)
return
-
EIO
;
retval
=
copy_to_user
((
void
*
)
arg
,
(
void
*
)
&
data
.
profile
,
retval
=
copy_to_user
(
argp
,
&
data
.
profile
,
sizeof
(
data
.
profile
));
}
if
(
retval
)
...
...
@@ -846,14 +845,14 @@ capi_ioctl(struct inode *inode, struct file *file,
case
CAPI_GET_MANUFACTURER
:
{
if
(
copy_from_user
(
(
void
*
)
&
data
.
contr
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
data
.
contr
,
argp
,
sizeof
(
data
.
contr
)))
return
-
EFAULT
;
cdev
->
errcode
=
capi20_get_manufacturer
(
data
.
contr
,
data
.
manufacturer
);
if
(
cdev
->
errcode
)
return
-
EIO
;
if
(
copy_to_user
(
(
void
*
)
arg
,
(
void
*
)
data
.
manufacturer
,
if
(
copy_to_user
(
argp
,
data
.
manufacturer
,
sizeof
(
data
.
manufacturer
)))
return
-
EFAULT
;
...
...
@@ -863,7 +862,7 @@ capi_ioctl(struct inode *inode, struct file *file,
data
.
errcode
=
cdev
->
errcode
;
cdev
->
errcode
=
CAPI_NOERROR
;
if
(
arg
)
{
if
(
copy_to_user
(
(
void
*
)
arg
,
(
void
*
)
&
data
.
errcode
,
if
(
copy_to_user
(
argp
,
&
data
.
errcode
,
sizeof
(
data
.
errcode
)))
return
-
EFAULT
;
}
...
...
@@ -879,7 +878,7 @@ capi_ioctl(struct inode *inode, struct file *file,
struct
capi_manufacturer_cmd
mcmd
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
if
(
copy_from_user
(
(
void
*
)
&
mcmd
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
mcmd
,
argp
,
sizeof
(
mcmd
)))
return
-
EFAULT
;
return
capi20_manufacturer
(
mcmd
.
cmd
,
mcmd
.
data
);
...
...
@@ -890,7 +889,7 @@ capi_ioctl(struct inode *inode, struct file *file,
case
CAPI_CLR_FLAGS
:
{
unsigned
userflags
;
if
(
copy_from_user
(
(
void
*
)
&
userflags
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
userflags
,
argp
,
sizeof
(
userflags
)))
return
-
EFAULT
;
if
(
cmd
==
CAPI_SET_FLAGS
)
...
...
@@ -901,7 +900,7 @@ capi_ioctl(struct inode *inode, struct file *file,
return
0
;
case
CAPI_GET_FLAGS
:
if
(
copy_to_user
(
(
void
*
)
arg
,
(
void
*
)
&
cdev
->
userflags
,
if
(
copy_to_user
(
argp
,
&
cdev
->
userflags
,
sizeof
(
cdev
->
userflags
)))
return
-
EFAULT
;
return
0
;
...
...
@@ -914,8 +913,7 @@ capi_ioctl(struct inode *inode, struct file *file,
#endif
/* CONFIG_ISDN_CAPI_MIDDLEWARE */
unsigned
ncci
;
int
count
=
0
;
if
(
copy_from_user
((
void
*
)
&
ncci
,
(
void
*
)
arg
,
sizeof
(
ncci
)))
if
(
copy_from_user
(
&
ncci
,
argp
,
sizeof
(
ncci
)))
return
-
EFAULT
;
down
(
&
cdev
->
ncci_list_sem
);
...
...
@@ -940,7 +938,7 @@ capi_ioctl(struct inode *inode, struct file *file,
struct
capiminor
*
mp
;
unsigned
ncci
;
int
unit
=
0
;
if
(
copy_from_user
(
(
void
*
)
&
ncci
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
ncci
,
argp
,
sizeof
(
ncci
)))
return
-
EFAULT
;
down
(
&
cdev
->
ncci_list_sem
);
...
...
drivers/isdn/i4l/isdn_common.c
View file @
bec737de
...
...
@@ -64,7 +64,7 @@ static isdn_divert_if *divert_if; /* = NULL */
#endif
/* CONFIG_ISDN_DIVERSION */
static
int
isdn_writebuf_stub
(
int
,
int
,
const
u_char
*
,
int
,
int
);
static
int
isdn_writebuf_stub
(
int
,
int
,
const
u_char
__user
*
,
int
);
static
void
set_global_features
(
void
);
static
int
isdn_wildmat
(
char
*
s
,
char
*
p
);
...
...
@@ -937,7 +937,7 @@ isdn_info_update(void)
}
static
ssize_t
isdn_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
off
)
isdn_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
off
)
{
uint
minor
=
MINOR
(
file
->
f_dentry
->
d_inode
->
i_rdev
);
int
len
=
0
;
...
...
@@ -1044,7 +1044,7 @@ isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
}
static
ssize_t
isdn_write
(
struct
file
*
file
,
const
char
*
buf
,
size_t
count
,
loff_t
*
off
)
isdn_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
off
)
{
uint
minor
=
MINOR
(
file
->
f_dentry
->
d_inode
->
i_rdev
);
int
drvidx
;
...
...
@@ -1159,7 +1159,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
int
chidx
;
int
ret
;
int
i
;
char
*
p
;
char
__user
*
p
;
char
*
s
;
union
iocpar
{
char
name
[
10
];
...
...
@@ -1168,6 +1168,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
isdn_net_ioctl_phone
phone
;
isdn_net_ioctl_cfg
cfg
;
}
iocpar
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
#define name iocpar.name
#define bname iocpar.bname
...
...
@@ -1183,9 +1184,9 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
(
INF_DV
<<
16
));
case
IIOCGETCPS
:
if
(
arg
)
{
ulong
*
p
=
(
ulong
*
)
arg
;
ulong
__user
*
p
=
argp
;
int
i
;
if
((
ret
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
arg
,
if
((
ret
=
verify_area
(
VERIFY_WRITE
,
p
,
sizeof
(
ulong
)
*
ISDN_MAX_CHANNELS
*
2
)))
return
ret
;
for
(
i
=
0
;
i
<
ISDN_MAX_CHANNELS
;
i
++
)
{
...
...
@@ -1201,9 +1202,9 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
/* Get peer phone number of a connected
* isdn network interface */
if
(
arg
)
{
if
(
copy_from_user
(
(
char
*
)
&
phone
,
(
char
*
)
arg
,
sizeof
(
phone
)))
if
(
copy_from_user
(
&
phone
,
argp
,
sizeof
(
phone
)))
return
-
EFAULT
;
return
isdn_net_getpeer
(
&
phone
,
(
isdn_net_ioctl_phone
*
)
arg
);
return
isdn_net_getpeer
(
&
phone
,
argp
);
}
else
return
-
EINVAL
;
#endif
...
...
@@ -1241,7 +1242,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETAIF
:
/* Add a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
name
,
(
char
*
)
arg
,
sizeof
(
name
)))
if
(
copy_from_user
(
name
,
argp
,
sizeof
(
name
)))
return
-
EFAULT
;
s
=
name
;
}
else
{
...
...
@@ -1250,7 +1251,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
ret
=
down_interruptible
(
&
dev
->
sem
);
if
(
ret
)
return
ret
;
if
((
s
=
isdn_net_new
(
s
,
NULL
)))
{
if
(
copy_to_user
(
(
char
*
)
arg
,
s
,
strlen
(
s
)
+
1
)){
if
(
copy_to_user
(
argp
,
s
,
strlen
(
s
)
+
1
)){
ret
=
-
EFAULT
;
}
else
{
ret
=
0
;
...
...
@@ -1262,14 +1263,14 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETASL
:
/* Add a slave to a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
bname
,
(
char
*
)
arg
,
sizeof
(
bname
)
-
1
))
if
(
copy_from_user
(
bname
,
argp
,
sizeof
(
bname
)
-
1
))
return
-
EFAULT
;
}
else
return
-
EINVAL
;
ret
=
down_interruptible
(
&
dev
->
sem
);
if
(
ret
)
return
ret
;
if
((
s
=
isdn_net_newslave
(
bname
)))
{
if
(
copy_to_user
(
(
char
*
)
arg
,
s
,
strlen
(
s
)
+
1
)){
if
(
copy_to_user
(
argp
,
s
,
strlen
(
s
)
+
1
)){
ret
=
-
EFAULT
;
}
else
{
ret
=
0
;
...
...
@@ -1281,7 +1282,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETDIF
:
/* Delete a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
name
,
(
char
*
)
arg
,
sizeof
(
name
)))
if
(
copy_from_user
(
name
,
argp
,
sizeof
(
name
)))
return
-
EFAULT
;
ret
=
down_interruptible
(
&
dev
->
sem
);
if
(
ret
)
return
ret
;
...
...
@@ -1293,7 +1294,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETSCF
:
/* Set configurable parameters of a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
(
char
*
)
&
cfg
,
(
char
*
)
arg
,
sizeof
(
cfg
)))
if
(
copy_from_user
(
&
cfg
,
argp
,
sizeof
(
cfg
)))
return
-
EFAULT
;
return
isdn_net_setcfg
(
&
cfg
);
}
else
...
...
@@ -1301,10 +1302,10 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETGCF
:
/* Get configurable parameters of a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
(
char
*
)
&
cfg
,
(
char
*
)
arg
,
sizeof
(
cfg
)))
if
(
copy_from_user
(
&
cfg
,
argp
,
sizeof
(
cfg
)))
return
-
EFAULT
;
if
(
!
(
ret
=
isdn_net_getcfg
(
&
cfg
)))
{
if
(
copy_to_user
(
(
char
*
)
arg
,
(
char
*
)
&
cfg
,
sizeof
(
cfg
)))
if
(
copy_to_user
(
argp
,
&
cfg
,
sizeof
(
cfg
)))
return
-
EFAULT
;
}
return
ret
;
...
...
@@ -1313,7 +1314,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETANM
:
/* Add a phone-number to a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
(
char
*
)
&
phone
,
(
char
*
)
arg
,
sizeof
(
phone
)))
if
(
copy_from_user
(
&
phone
,
argp
,
sizeof
(
phone
)))
return
-
EFAULT
;
ret
=
down_interruptible
(
&
dev
->
sem
);
if
(
ret
)
return
ret
;
...
...
@@ -1325,11 +1326,11 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETGNM
:
/* Get list of phone-numbers of a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
(
char
*
)
&
phone
,
(
char
*
)
arg
,
sizeof
(
phone
)))
if
(
copy_from_user
(
&
phone
,
argp
,
sizeof
(
phone
)))
return
-
EFAULT
;
ret
=
down_interruptible
(
&
dev
->
sem
);
if
(
ret
)
return
ret
;
ret
=
isdn_net_getphones
(
&
phone
,
(
char
*
)
arg
);
ret
=
isdn_net_getphones
(
&
phone
,
argp
);
up
(
&
dev
->
sem
);
return
ret
;
}
else
...
...
@@ -1337,7 +1338,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETDNM
:
/* Delete a phone-number of a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
(
char
*
)
&
phone
,
(
char
*
)
arg
,
sizeof
(
phone
)))
if
(
copy_from_user
(
&
phone
,
argp
,
sizeof
(
phone
)))
return
-
EFAULT
;
ret
=
down_interruptible
(
&
dev
->
sem
);
if
(
ret
)
return
ret
;
...
...
@@ -1349,7 +1350,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETDIL
:
/* Force dialing of a network-interface */
if
(
arg
)
{
if
(
copy_from_user
(
name
,
(
char
*
)
arg
,
sizeof
(
name
)))
if
(
copy_from_user
(
name
,
argp
,
sizeof
(
name
)))
return
-
EFAULT
;
return
isdn_net_force_dial
(
name
);
}
else
...
...
@@ -1358,13 +1359,13 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCNETALN
:
if
(
!
arg
)
return
-
EINVAL
;
if
(
copy_from_user
(
name
,
(
char
*
)
arg
,
sizeof
(
name
)))
if
(
copy_from_user
(
name
,
argp
,
sizeof
(
name
)))
return
-
EFAULT
;
return
isdn_ppp_dial_slave
(
name
);
case
IIOCNETDLN
:
if
(
!
arg
)
return
-
EINVAL
;
if
(
copy_from_user
(
name
,
(
char
*
)
arg
,
sizeof
(
name
)))
if
(
copy_from_user
(
name
,
argp
,
sizeof
(
name
)))
return
-
EFAULT
;
return
isdn_ppp_hangup_slave
(
name
);
#endif
...
...
@@ -1372,7 +1373,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
/* Force hangup of a network-interface */
if
(
!
arg
)
return
-
EINVAL
;
if
(
copy_from_user
(
name
,
(
char
*
)
arg
,
sizeof
(
name
)))
if
(
copy_from_user
(
name
,
argp
,
sizeof
(
name
)))
return
-
EFAULT
;
return
isdn_net_force_hangup
(
name
);
break
;
...
...
@@ -1394,7 +1395,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
if
(
arg
)
{
int
i
;
char
*
p
;
if
(
copy_from_user
(
(
char
*
)
&
iocts
,
(
char
*
)
arg
,
if
(
copy_from_user
(
&
iocts
,
argp
,
sizeof
(
isdn_ioctl_struct
)))
return
-
EFAULT
;
if
(
strlen
(
iocts
.
drvid
))
{
...
...
@@ -1422,10 +1423,10 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCGETPRF
:
/* Get all Modem-Profiles */
if
(
arg
)
{
char
*
p
=
(
char
*
)
arg
;
char
__user
*
p
=
argp
;
int
i
;
if
((
ret
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
arg
,
if
((
ret
=
verify_area
(
VERIFY_WRITE
,
argp
,
(
ISDN_MODEM_NUMREG
+
ISDN_MSNLEN
+
ISDN_LMSNLEN
)
*
ISDN_MAX_CHANNELS
)))
return
ret
;
...
...
@@ -1449,10 +1450,10 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
case
IIOCSETPRF
:
/* Set all Modem-Profiles */
if
(
arg
)
{
char
*
p
=
(
char
*
)
arg
;
char
__user
*
p
=
argp
;
int
i
;
if
((
ret
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
if
((
ret
=
verify_area
(
VERIFY_READ
,
argp
,
(
ISDN_MODEM_NUMREG
+
ISDN_MSNLEN
+
ISDN_LMSNLEN
)
*
ISDN_MAX_CHANNELS
)))
return
ret
;
...
...
@@ -1478,8 +1479,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
/* Set/Get MSN->EAZ-Mapping for a driver */
if
(
arg
)
{
if
(
copy_from_user
((
char
*
)
&
iocts
,
(
char
*
)
arg
,
if
(
copy_from_user
(
&
iocts
,
argp
,
sizeof
(
isdn_ioctl_struct
)))
return
-
EFAULT
;
if
(
strlen
(
iocts
.
drvid
))
{
...
...
@@ -1496,7 +1496,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
if
(
cmd
==
IIOCSETMAP
)
{
int
loop
=
1
;
p
=
(
char
*
)
iocts
.
arg
;
p
=
(
char
__user
*
)
iocts
.
arg
;
i
=
0
;
while
(
loop
)
{
int
j
=
0
;
...
...
@@ -1524,7 +1524,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
break
;
}
}
else
{
p
=
(
char
*
)
iocts
.
arg
;
p
=
(
char
__user
*
)
iocts
.
arg
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
sprintf
(
bname
,
"%s%s"
,
strlen
(
dev
->
drv
[
drvidx
]
->
msn2eaz
[
i
])
?
...
...
@@ -1540,7 +1540,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
return
-
EINVAL
;
case
IIOCDBGVAR
:
if
(
arg
)
{
if
(
copy_to_user
(
(
char
*
)
arg
,
(
char
*
)
&
dev
,
sizeof
(
ulong
)))
if
(
copy_to_user
(
argp
,
&
dev
,
sizeof
(
ulong
)))
return
-
EFAULT
;
return
0
;
}
else
...
...
@@ -1554,7 +1554,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
if
(
arg
)
{
int
i
;
char
*
p
;
if
(
copy_from_user
(
(
char
*
)
&
iocts
,
(
char
*
)
arg
,
sizeof
(
isdn_ioctl_struct
)))
if
(
copy_from_user
(
&
iocts
,
argp
,
sizeof
(
isdn_ioctl_struct
)))
return
-
EFAULT
;
if
(
strlen
(
iocts
.
drvid
))
{
if
((
p
=
strchr
(
iocts
.
drvid
,
','
)))
...
...
@@ -1569,16 +1569,16 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
drvidx
=
0
;
if
(
drvidx
==
-
1
)
return
-
ENODEV
;
if
((
ret
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
arg
,
if
((
ret
=
verify_area
(
VERIFY_WRITE
,
argp
,
sizeof
(
isdn_ioctl_struct
))))
return
ret
;
c
.
driver
=
drvidx
;
c
.
command
=
ISDN_CMD_IOCTL
;
c
.
arg
=
cmd
;
memcpy
(
c
.
parm
.
num
,
(
char
*
)
&
iocts
.
arg
,
sizeof
(
ulong
));
memcpy
(
c
.
parm
.
num
,
&
iocts
.
arg
,
sizeof
(
ulong
));
ret
=
isdn_command
(
&
c
);
memcpy
(
(
char
*
)
&
iocts
.
arg
,
c
.
parm
.
num
,
sizeof
(
ulong
));
if
(
copy_to_user
(
(
char
*
)
arg
,
&
iocts
,
sizeof
(
isdn_ioctl_struct
)))
memcpy
(
&
iocts
.
arg
,
c
.
parm
.
num
,
sizeof
(
ulong
));
if
(
copy_to_user
(
argp
,
&
iocts
,
sizeof
(
isdn_ioctl_struct
)))
return
-
EFAULT
;
return
ret
;
}
else
...
...
drivers/isdn/i4l/isdn_net.c
View file @
bec737de
...
...
@@ -315,7 +315,7 @@ isdn_net_unbind_channel(isdn_net_local * lp)
unsigned
long
last_jiffies
=
-
HZ
;
void
isdn_net_autohup
()
isdn_net_autohup
(
void
)
{
isdn_net_dev
*
p
=
dev
->
netdev
;
int
anymore
;
...
...
@@ -1443,15 +1443,14 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/* get/set keepalive period */
case
SIOCGKEEPPERIOD
:
len
=
(
unsigned
long
)
sizeof
(
lp
->
cisco_keepalive_period
);
if
(
copy_to_user
(
(
char
*
)
ifr
->
ifr_ifru
.
ifru
_data
,
(
int
*
)
&
lp
->
cisco_keepalive_period
,
len
))
if
(
copy_to_user
(
ifr
->
ifr
_data
,
&
lp
->
cisco_keepalive_period
,
len
))
rc
=
-
EFAULT
;
break
;
case
SIOCSKEEPPERIOD
:
tmp
=
lp
->
cisco_keepalive_period
;
len
=
(
unsigned
long
)
sizeof
(
lp
->
cisco_keepalive_period
);
if
(
copy_from_user
((
int
*
)
&
period
,
(
char
*
)
ifr
->
ifr_ifru
.
ifru_data
,
len
))
if
(
copy_from_user
(
&
period
,
ifr
->
ifr_data
,
len
))
rc
=
-
EFAULT
;
if
((
period
>
0
)
&&
(
period
<=
32767
))
lp
->
cisco_keepalive_period
=
period
;
...
...
@@ -1470,14 +1469,14 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/* get/set debugging */
case
SIOCGDEBSERINT
:
len
=
(
unsigned
long
)
sizeof
(
lp
->
cisco_debserint
);
if
(
copy_to_user
(
(
char
*
)
ifr
->
ifr_ifru
.
ifru
_data
,
(
char
*
)
&
lp
->
cisco_debserint
,
len
))
if
(
copy_to_user
(
ifr
->
ifr
_data
,
&
lp
->
cisco_debserint
,
len
))
rc
=
-
EFAULT
;
break
;
case
SIOCSDEBSERINT
:
len
=
(
unsigned
long
)
sizeof
(
lp
->
cisco_debserint
);
if
(
copy_from_user
(
(
char
*
)
&
debserint
,
(
char
*
)
ifr
->
ifr_ifru
.
ifru
_data
,
len
))
if
(
copy_from_user
(
&
debserint
,
ifr
->
ifr
_data
,
len
))
rc
=
-
EFAULT
;
if
((
debserint
>=
0
)
&&
(
debserint
<=
64
))
lp
->
cisco_debserint
=
debserint
;
...
...
@@ -2968,7 +2967,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
* This might sleep and must be called with the isdn semaphore down.
*/
int
isdn_net_getphones
(
isdn_net_ioctl_phone
*
phone
,
char
*
phones
)
isdn_net_getphones
(
isdn_net_ioctl_phone
*
phone
,
char
__user
*
phones
)
{
isdn_net_dev
*
p
=
isdn_net_findif
(
phone
->
name
);
int
inout
=
phone
->
outgoing
&
1
;
...
...
@@ -3001,7 +3000,7 @@ isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones)
* to user space.
*/
int
isdn_net_getpeer
(
isdn_net_ioctl_phone
*
phone
,
isdn_net_ioctl_phone
*
peer
)
isdn_net_getpeer
(
isdn_net_ioctl_phone
*
phone
,
isdn_net_ioctl_phone
__user
*
peer
)
{
isdn_net_dev
*
p
=
isdn_net_findif
(
phone
->
name
);
int
ch
,
dv
,
idx
;
...
...
drivers/isdn/i4l/isdn_net.h
View file @
bec737de
...
...
@@ -39,8 +39,8 @@ extern int isdn_net_stat_callback(int, isdn_ctrl *);
extern
int
isdn_net_setcfg
(
isdn_net_ioctl_cfg
*
);
extern
int
isdn_net_getcfg
(
isdn_net_ioctl_cfg
*
);
extern
int
isdn_net_addphone
(
isdn_net_ioctl_phone
*
);
extern
int
isdn_net_getphones
(
isdn_net_ioctl_phone
*
,
char
*
);
extern
int
isdn_net_getpeer
(
isdn_net_ioctl_phone
*
,
isdn_net_ioctl_phone
*
);
extern
int
isdn_net_getphones
(
isdn_net_ioctl_phone
*
,
char
__user
*
);
extern
int
isdn_net_getpeer
(
isdn_net_ioctl_phone
*
,
isdn_net_ioctl_phone
__user
*
);
extern
int
isdn_net_delphone
(
isdn_net_ioctl_phone
*
);
extern
int
isdn_net_find_icall
(
int
,
int
,
int
,
setup_parm
*
);
extern
void
isdn_net_hangup
(
struct
net_device
*
);
...
...
drivers/isdn/i4l/isdn_tty.c
View file @
bec737de
...
...
@@ -1359,14 +1359,14 @@ isdn_tty_unthrottle(struct tty_struct *tty)
* allows RS485 driver to be written in user space.
*/
static
int
isdn_tty_get_lsr_info
(
modem_info
*
info
,
uint
*
value
)
isdn_tty_get_lsr_info
(
modem_info
*
info
,
uint
__user
*
value
)
{
u_char
status
;
uint
result
;
status
=
info
->
lsr
;
result
=
((
status
&
UART_LSR_TEMT
)
?
TIOCSER_TEMT
:
0
);
return
put_user
(
result
,
(
uint
*
)
value
);
return
put_user
(
result
,
value
);
}
...
...
@@ -1468,12 +1468,12 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
#ifdef ISDN_DEBUG_MODEM_IOCTL
printk
(
KERN_DEBUG
"ttyI%d ioctl TIOCGSOFTCAR
\n
"
,
info
->
line
);
#endif
return
put_user
(
C_CLOCAL
(
tty
)
?
1
:
0
,
(
ulong
*
)
arg
);
return
put_user
(
C_CLOCAL
(
tty
)
?
1
:
0
,
(
ulong
__user
*
)
arg
);
case
TIOCSSOFTCAR
:
#ifdef ISDN_DEBUG_MODEM_IOCTL
printk
(
KERN_DEBUG
"ttyI%d ioctl TIOCSSOFTCAR
\n
"
,
info
->
line
);
#endif
if
(
get_user
(
arg
,
(
ulong
*
)
arg
))
if
(
get_user
(
arg
,
(
ulong
__user
*
)
arg
))
return
-
EFAULT
;
tty
->
termios
->
c_cflag
=
((
tty
->
termios
->
c_cflag
&
~
CLOCAL
)
|
...
...
drivers/isdn/i4l/isdn_x25iface.c
View file @
bec737de
...
...
@@ -79,7 +79,7 @@ static int pdata_is_bad( ix25_pdata_t * pda ){
/* create a new x25 interface protocol instance
*/
struct
concap_proto
*
isdn_x25iface_proto_new
()
struct
concap_proto
*
isdn_x25iface_proto_new
(
void
)
{
ix25_pdata_t
*
tmp
=
kmalloc
(
sizeof
(
ix25_pdata_t
),
GFP_KERNEL
);
IX25DEBUG
(
"isdn_x25iface_proto_new
\n
"
);
...
...
@@ -275,8 +275,7 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
int
isdn_x25iface_xmit
(
struct
concap_proto
*
cprot
,
struct
sk_buff
*
skb
)
{
unsigned
char
firstbyte
=
skb
->
data
[
0
];
unsigned
*
state
=
&
(
(
(
ix25_pdata_t
*
)
(
cprot
->
proto_data
)
)
->
state
);
enum
wan_states
*
state
=
&
((
ix25_pdata_t
*
)
cprot
->
proto_data
)
->
state
;
int
ret
=
0
;
IX25DEBUG
(
"isdn_x25iface_xmit: %s first=%x state=%d
\n
"
,
MY_DEVNAME
(
cprot
->
net_dev
),
firstbyte
,
*
state
);
switch
(
firstbyte
){
...
...
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