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
2d0d1430
Commit
2d0d1430
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: drivers/char/i8 annotation
parent
9e220970
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
drivers/char/i8k.c
drivers/char/i8k.c
+11
-11
No files found.
drivers/char/i8k.c
View file @
2d0d1430
...
...
@@ -79,7 +79,7 @@ MODULE_PARM_DESC(force, "Force loading without checking for supported models");
MODULE_PARM_DESC
(
restricted
,
"Allow fan control if SYS_ADMIN capability set"
);
MODULE_PARM_DESC
(
power_status
,
"Report power status in /proc/i8k"
);
static
ssize_t
i8k_read
(
struct
file
*
,
char
*
,
size_t
,
loff_t
*
);
static
ssize_t
i8k_read
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
static
int
i8k_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
);
...
...
@@ -330,10 +330,10 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
int
val
;
int
speed
;
unsigned
char
buff
[
16
];
int
__user
*
argp
=
(
int
__user
*
)
arg
;
if
(
!
arg
)
{
if
(
!
arg
p
)
return
-
EINVAL
;
}
switch
(
cmd
)
{
case
I8K_BIOS_VERSION
:
...
...
@@ -358,14 +358,14 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
break
;
case
I8K_GET_SPEED
:
if
(
copy_from_user
(
&
val
,
(
int
*
)
arg
,
sizeof
(
int
)))
{
if
(
copy_from_user
(
&
val
,
argp
,
sizeof
(
int
)))
{
return
-
EFAULT
;
}
val
=
i8k_get_fan_speed
(
val
);
break
;
case
I8K_GET_FAN
:
if
(
copy_from_user
(
&
val
,
(
int
*
)
arg
,
sizeof
(
int
)))
{
if
(
copy_from_user
(
&
val
,
argp
,
sizeof
(
int
)))
{
return
-
EFAULT
;
}
val
=
i8k_get_fan_status
(
val
);
...
...
@@ -375,10 +375,10 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
if
(
restricted
&&
!
capable
(
CAP_SYS_ADMIN
))
{
return
-
EPERM
;
}
if
(
copy_from_user
(
&
val
,
(
int
*
)
arg
,
sizeof
(
int
)))
{
if
(
copy_from_user
(
&
val
,
argp
,
sizeof
(
int
)))
{
return
-
EFAULT
;
}
if
(
copy_from_user
(
&
speed
,
(
int
*
)
arg
+
1
,
sizeof
(
int
)))
{
if
(
copy_from_user
(
&
speed
,
argp
+
1
,
sizeof
(
int
)))
{
return
-
EFAULT
;
}
val
=
i8k_set_fan
(
val
,
speed
);
...
...
@@ -394,17 +394,17 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
switch
(
cmd
)
{
case
I8K_BIOS_VERSION
:
if
(
copy_to_user
(
(
int
*
)
arg
,
&
val
,
4
))
{
if
(
copy_to_user
(
argp
,
&
val
,
4
))
{
return
-
EFAULT
;
}
break
;
case
I8K_MACHINE_ID
:
if
(
copy_to_user
(
(
int
*
)
arg
,
buff
,
16
))
{
if
(
copy_to_user
(
argp
,
buff
,
16
))
{
return
-
EFAULT
;
}
break
;
default:
if
(
copy_to_user
(
(
int
*
)
arg
,
&
val
,
sizeof
(
int
)))
{
if
(
copy_to_user
(
argp
,
&
val
,
sizeof
(
int
)))
{
return
-
EFAULT
;
}
break
;
...
...
@@ -462,7 +462,7 @@ static int i8k_get_info(char *buffer, char **start, off_t fpos, int length)
return
n
;
}
static
ssize_t
i8k_read
(
struct
file
*
f
,
char
*
buffer
,
size_t
len
,
loff_t
*
fpos
)
static
ssize_t
i8k_read
(
struct
file
*
f
,
char
__user
*
buffer
,
size_t
len
,
loff_t
*
fpos
)
{
int
n
;
char
info
[
128
];
...
...
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