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
7ca9ab3b
Commit
7ca9ab3b
authored
May 28, 2004
by
Alexander Viro
Committed by
Linus Torvalds
May 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: drivers/pci __user annotation
parent
f49b24c5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
drivers/pci/proc.c
drivers/pci/proc.c
+6
-6
drivers/pci/syscall.c
drivers/pci/syscall.c
+9
-9
No files found.
drivers/pci/proc.c
View file @
7ca9ab3b
...
...
@@ -89,7 +89,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
if
((
pos
&
3
)
&&
cnt
>
2
)
{
unsigned
short
val
;
pci_read_config_word
(
dev
,
pos
,
&
val
);
__put_user
(
cpu_to_le16
(
val
),
(
unsigned
short
*
)
buf
);
__put_user
(
cpu_to_le16
(
val
),
(
unsigned
short
__user
*
)
buf
);
buf
+=
2
;
pos
+=
2
;
cnt
-=
2
;
...
...
@@ -98,7 +98,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
while
(
cnt
>=
4
)
{
unsigned
int
val
;
pci_read_config_dword
(
dev
,
pos
,
&
val
);
__put_user
(
cpu_to_le32
(
val
),
(
unsigned
int
*
)
buf
);
__put_user
(
cpu_to_le32
(
val
),
(
unsigned
int
__user
*
)
buf
);
buf
+=
4
;
pos
+=
4
;
cnt
-=
4
;
...
...
@@ -107,7 +107,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
if
(
cnt
>=
2
)
{
unsigned
short
val
;
pci_read_config_word
(
dev
,
pos
,
&
val
);
__put_user
(
cpu_to_le16
(
val
),
(
unsigned
short
*
)
buf
);
__put_user
(
cpu_to_le16
(
val
),
(
unsigned
short
__user
*
)
buf
);
buf
+=
2
;
pos
+=
2
;
cnt
-=
2
;
...
...
@@ -158,7 +158,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
if
((
pos
&
3
)
&&
cnt
>
2
)
{
unsigned
short
val
;
__get_user
(
val
,
(
unsigned
short
*
)
buf
);
__get_user
(
val
,
(
unsigned
short
__user
*
)
buf
);
pci_write_config_word
(
dev
,
pos
,
le16_to_cpu
(
val
));
buf
+=
2
;
pos
+=
2
;
...
...
@@ -167,7 +167,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
while
(
cnt
>=
4
)
{
unsigned
int
val
;
__get_user
(
val
,
(
unsigned
int
*
)
buf
);
__get_user
(
val
,
(
unsigned
int
__user
*
)
buf
);
pci_write_config_dword
(
dev
,
pos
,
le32_to_cpu
(
val
));
buf
+=
4
;
pos
+=
4
;
...
...
@@ -176,7 +176,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
if
(
cnt
>=
2
)
{
unsigned
short
val
;
__get_user
(
val
,
(
unsigned
short
*
)
buf
);
__get_user
(
val
,
(
unsigned
short
__user
*
)
buf
);
pci_write_config_word
(
dev
,
pos
,
le16_to_cpu
(
val
));
buf
+=
2
;
pos
+=
2
;
...
...
drivers/pci/syscall.c
View file @
7ca9ab3b
...
...
@@ -57,13 +57,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
switch
(
len
)
{
case
1
:
err
=
put_user
(
byte
,
(
unsigned
char
*
)
buf
);
err
=
put_user
(
byte
,
(
unsigned
char
__user
*
)
buf
);
break
;
case
2
:
err
=
put_user
(
word
,
(
unsigned
short
*
)
buf
);
err
=
put_user
(
word
,
(
unsigned
short
__user
*
)
buf
);
break
;
case
4
:
err
=
put_user
(
dword
,
(
unsigned
int
*
)
buf
);
err
=
put_user
(
dword
,
(
unsigned
int
__user
*
)
buf
);
break
;
};
return
err
;
...
...
@@ -74,13 +74,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
they get instead of a machine check on x86. */
switch
(
len
)
{
case
1
:
put_user
(
-
1
,
(
unsigned
char
*
)
buf
);
put_user
(
-
1
,
(
unsigned
char
__user
*
)
buf
);
break
;
case
2
:
put_user
(
-
1
,
(
unsigned
short
*
)
buf
);
put_user
(
-
1
,
(
unsigned
short
__user
*
)
buf
);
break
;
case
4
:
put_user
(
-
1
,
(
unsigned
int
*
)
buf
);
put_user
(
-
1
,
(
unsigned
int
__user
*
)
buf
);
break
;
};
return
err
;
...
...
@@ -106,7 +106,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
lock_kernel
();
switch
(
len
)
{
case
1
:
err
=
get_user
(
byte
,
(
u8
*
)
buf
);
err
=
get_user
(
byte
,
(
u8
__user
*
)
buf
);
if
(
err
)
break
;
err
=
pci_write_config_byte
(
dev
,
off
,
byte
);
...
...
@@ -115,7 +115,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
break
;
case
2
:
err
=
get_user
(
word
,
(
u16
*
)
buf
);
err
=
get_user
(
word
,
(
u16
__user
*
)
buf
);
if
(
err
)
break
;
err
=
pci_write_config_word
(
dev
,
off
,
word
);
...
...
@@ -124,7 +124,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
break
;
case
4
:
err
=
get_user
(
dword
,
(
u32
*
)
buf
);
err
=
get_user
(
dword
,
(
u32
__user
*
)
buf
);
if
(
err
)
break
;
err
=
pci_write_config_dword
(
dev
,
off
,
dword
);
...
...
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