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
138b97b6
Commit
138b97b6
authored
Jun 03, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: sonypi annotiation
parent
03ac97d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
drivers/char/sonypi.c
drivers/char/sonypi.c
+13
-11
No files found.
drivers/char/sonypi.c
View file @
138b97b6
...
...
@@ -461,8 +461,9 @@ static int sonypi_misc_open(struct inode * inode, struct file * file) {
return
0
;
}
static
ssize_t
sonypi_misc_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
static
ssize_t
sonypi_misc_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
DECLARE_WAITQUEUE
(
wait
,
current
);
ssize_t
i
=
count
;
unsigned
char
c
;
...
...
@@ -504,6 +505,7 @@ static unsigned int sonypi_misc_poll(struct file *file, poll_table * wait) {
static
int
sonypi_misc_ioctl
(
struct
inode
*
ip
,
struct
file
*
fp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
int
ret
=
0
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
u8
val8
;
u16
val16
;
...
...
@@ -514,11 +516,11 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
ret
=
-
EIO
;
break
;
}
if
(
copy_to_user
(
(
u8
*
)
arg
,
&
val8
,
sizeof
(
val8
)))
if
(
copy_to_user
(
argp
,
&
val8
,
sizeof
(
val8
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCSBRT
:
if
(
copy_from_user
(
&
val8
,
(
u8
*
)
arg
,
sizeof
(
val8
)))
{
if
(
copy_from_user
(
&
val8
,
argp
,
sizeof
(
val8
)))
{
ret
=
-
EFAULT
;
break
;
}
...
...
@@ -530,7 +532,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
ret
=
-
EIO
;
break
;
}
if
(
copy_to_user
(
(
u16
*
)
arg
,
&
val16
,
sizeof
(
val16
)))
if
(
copy_to_user
(
argp
,
&
val16
,
sizeof
(
val16
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCGBAT1REM
:
...
...
@@ -538,7 +540,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
ret
=
-
EIO
;
break
;
}
if
(
copy_to_user
(
(
u16
*
)
arg
,
&
val16
,
sizeof
(
val16
)))
if
(
copy_to_user
(
argp
,
&
val16
,
sizeof
(
val16
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCGBAT2CAP
:
...
...
@@ -546,7 +548,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
ret
=
-
EIO
;
break
;
}
if
(
copy_to_user
(
(
u16
*
)
arg
,
&
val16
,
sizeof
(
val16
)))
if
(
copy_to_user
(
argp
,
&
val16
,
sizeof
(
val16
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCGBAT2REM
:
...
...
@@ -554,7 +556,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
ret
=
-
EIO
;
break
;
}
if
(
copy_to_user
(
(
u16
*
)
arg
,
&
val16
,
sizeof
(
val16
)))
if
(
copy_to_user
(
argp
,
&
val16
,
sizeof
(
val16
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCGBATFLAGS
:
...
...
@@ -563,16 +565,16 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
break
;
}
val8
&=
0x07
;
if
(
copy_to_user
(
(
u8
*
)
arg
,
&
val8
,
sizeof
(
val8
)))
if
(
copy_to_user
(
argp
,
&
val8
,
sizeof
(
val8
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCGBLUE
:
val8
=
sonypi_device
.
bluetooth_power
;
if
(
copy_to_user
(
(
u8
*
)
arg
,
&
val8
,
sizeof
(
val8
)))
if
(
copy_to_user
(
argp
,
&
val8
,
sizeof
(
val8
)))
ret
=
-
EFAULT
;
break
;
case
SONYPI_IOCSBLUE
:
if
(
copy_from_user
(
&
val8
,
(
u8
*
)
arg
,
sizeof
(
val8
)))
{
if
(
copy_from_user
(
&
val8
,
argp
,
sizeof
(
val8
)))
{
ret
=
-
EFAULT
;
break
;
}
...
...
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