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
3e83f872
Commit
3e83f872
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/md annotation
parent
bd12c17c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
drivers/md/dm-ioctl.c
drivers/md/dm-ioctl.c
+3
-3
drivers/md/md.c
drivers/md/md.c
+14
-13
No files found.
drivers/md/dm-ioctl.c
View file @
3e83f872
...
@@ -1133,7 +1133,7 @@ static ioctl_fn lookup_ioctl(unsigned int cmd)
...
@@ -1133,7 +1133,7 @@ static ioctl_fn lookup_ioctl(unsigned int cmd)
* As well as checking the version compatibility this always
* As well as checking the version compatibility this always
* copies the kernel interface version out.
* copies the kernel interface version out.
*/
*/
static
int
check_version
(
unsigned
int
cmd
,
struct
dm_ioctl
*
user
)
static
int
check_version
(
unsigned
int
cmd
,
struct
dm_ioctl
__user
*
user
)
{
{
uint32_t
version
[
3
];
uint32_t
version
[
3
];
int
r
=
0
;
int
r
=
0
;
...
@@ -1168,7 +1168,7 @@ static void free_params(struct dm_ioctl *param)
...
@@ -1168,7 +1168,7 @@ static void free_params(struct dm_ioctl *param)
vfree
(
param
);
vfree
(
param
);
}
}
static
int
copy_params
(
struct
dm_ioctl
*
user
,
struct
dm_ioctl
**
param
)
static
int
copy_params
(
struct
dm_ioctl
__user
*
user
,
struct
dm_ioctl
**
param
)
{
{
struct
dm_ioctl
tmp
,
*
dmi
;
struct
dm_ioctl
tmp
,
*
dmi
;
...
@@ -1225,7 +1225,7 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
...
@@ -1225,7 +1225,7 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
int
r
=
0
;
int
r
=
0
;
unsigned
int
cmd
;
unsigned
int
cmd
;
struct
dm_ioctl
*
param
;
struct
dm_ioctl
*
param
;
struct
dm_ioctl
*
user
=
(
struct
dm_ioctl
*
)
u
;
struct
dm_ioctl
__user
*
user
=
(
struct
dm_ioctl
__user
*
)
u
;
ioctl_fn
fn
=
NULL
;
ioctl_fn
fn
=
NULL
;
size_t
param_size
;
size_t
param_size
;
...
...
drivers/md/md.c
View file @
3e83f872
...
@@ -1934,7 +1934,7 @@ static int autostart_array(dev_t startdev)
...
@@ -1934,7 +1934,7 @@ static int autostart_array(dev_t startdev)
}
}
static
int
get_version
(
void
*
arg
)
static
int
get_version
(
void
__user
*
arg
)
{
{
mdu_version_t
ver
;
mdu_version_t
ver
;
...
@@ -1948,7 +1948,7 @@ static int get_version(void * arg)
...
@@ -1948,7 +1948,7 @@ static int get_version(void * arg)
return
0
;
return
0
;
}
}
static
int
get_array_info
(
mddev_t
*
mddev
,
void
*
arg
)
static
int
get_array_info
(
mddev_t
*
mddev
,
void
__user
*
arg
)
{
{
mdu_array_info_t
info
;
mdu_array_info_t
info
;
int
nr
,
working
,
active
,
failed
,
spare
;
int
nr
,
working
,
active
,
failed
,
spare
;
...
@@ -1998,7 +1998,7 @@ static int get_array_info(mddev_t * mddev, void * arg)
...
@@ -1998,7 +1998,7 @@ static int get_array_info(mddev_t * mddev, void * arg)
return
0
;
return
0
;
}
}
static
int
get_disk_info
(
mddev_t
*
mddev
,
void
*
arg
)
static
int
get_disk_info
(
mddev_t
*
mddev
,
void
__user
*
arg
)
{
{
mdu_disk_info_t
info
;
mdu_disk_info_t
info
;
unsigned
int
nr
;
unsigned
int
nr
;
...
@@ -2389,7 +2389,8 @@ static int md_ioctl(struct inode *inode, struct file *file,
...
@@ -2389,7 +2389,8 @@ static int md_ioctl(struct inode *inode, struct file *file,
{
{
char
b
[
BDEVNAME_SIZE
];
char
b
[
BDEVNAME_SIZE
];
int
err
=
0
;
int
err
=
0
;
struct
hd_geometry
*
loc
=
(
struct
hd_geometry
*
)
arg
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
struct
hd_geometry
__user
*
loc
=
argp
;
mddev_t
*
mddev
=
NULL
;
mddev_t
*
mddev
=
NULL
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
...
@@ -2402,7 +2403,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
...
@@ -2402,7 +2403,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
switch
(
cmd
)
switch
(
cmd
)
{
{
case
RAID_VERSION
:
case
RAID_VERSION
:
err
=
get_version
(
(
void
*
)
arg
);
err
=
get_version
(
argp
);
goto
done
;
goto
done
;
case
PRINT_RAID_DEBUG
:
case
PRINT_RAID_DEBUG
:
...
@@ -2482,7 +2483,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
...
@@ -2482,7 +2483,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
mdu_array_info_t
info
;
mdu_array_info_t
info
;
if
(
!
arg
)
if
(
!
arg
)
memset
(
&
info
,
0
,
sizeof
(
info
));
memset
(
&
info
,
0
,
sizeof
(
info
));
else
if
(
copy_from_user
(
&
info
,
(
void
*
)
arg
,
sizeof
(
info
)))
{
else
if
(
copy_from_user
(
&
info
,
argp
,
sizeof
(
info
)))
{
err
=
-
EFAULT
;
err
=
-
EFAULT
;
goto
abort_unlock
;
goto
abort_unlock
;
}
}
...
@@ -2513,11 +2514,11 @@ static int md_ioctl(struct inode *inode, struct file *file,
...
@@ -2513,11 +2514,11 @@ static int md_ioctl(struct inode *inode, struct file *file,
switch
(
cmd
)
switch
(
cmd
)
{
{
case
GET_ARRAY_INFO
:
case
GET_ARRAY_INFO
:
err
=
get_array_info
(
mddev
,
(
void
*
)
arg
);
err
=
get_array_info
(
mddev
,
argp
);
goto
done_unlock
;
goto
done_unlock
;
case
GET_DISK_INFO
:
case
GET_DISK_INFO
:
err
=
get_disk_info
(
mddev
,
(
void
*
)
arg
);
err
=
get_disk_info
(
mddev
,
argp
);
goto
done_unlock
;
goto
done_unlock
;
case
RESTART_ARRAY_RW
:
case
RESTART_ARRAY_RW
:
...
@@ -2543,18 +2544,18 @@ static int md_ioctl(struct inode *inode, struct file *file,
...
@@ -2543,18 +2544,18 @@ static int md_ioctl(struct inode *inode, struct file *file,
err
=
-
EINVAL
;
err
=
-
EINVAL
;
goto
abort_unlock
;
goto
abort_unlock
;
}
}
err
=
put_user
(
2
,
(
char
*
)
&
loc
->
heads
);
err
=
put_user
(
2
,
(
char
__user
*
)
&
loc
->
heads
);
if
(
err
)
if
(
err
)
goto
abort_unlock
;
goto
abort_unlock
;
err
=
put_user
(
4
,
(
char
*
)
&
loc
->
sectors
);
err
=
put_user
(
4
,
(
char
__user
*
)
&
loc
->
sectors
);
if
(
err
)
if
(
err
)
goto
abort_unlock
;
goto
abort_unlock
;
err
=
put_user
(
get_capacity
(
mddev
->
gendisk
)
/
8
,
err
=
put_user
(
get_capacity
(
mddev
->
gendisk
)
/
8
,
(
short
*
)
&
loc
->
cylinders
);
(
short
__user
*
)
&
loc
->
cylinders
);
if
(
err
)
if
(
err
)
goto
abort_unlock
;
goto
abort_unlock
;
err
=
put_user
(
get_start_sect
(
inode
->
i_bdev
),
err
=
put_user
(
get_start_sect
(
inode
->
i_bdev
),
(
long
*
)
&
loc
->
start
);
(
long
__user
*
)
&
loc
->
start
);
goto
done_unlock
;
goto
done_unlock
;
}
}
...
@@ -2573,7 +2574,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
...
@@ -2573,7 +2574,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
case
ADD_NEW_DISK
:
case
ADD_NEW_DISK
:
{
{
mdu_disk_info_t
info
;
mdu_disk_info_t
info
;
if
(
copy_from_user
(
&
info
,
(
void
*
)
arg
,
sizeof
(
info
)))
if
(
copy_from_user
(
&
info
,
argp
,
sizeof
(
info
)))
err
=
-
EFAULT
;
err
=
-
EFAULT
;
else
else
err
=
add_new_disk
(
mddev
,
&
info
);
err
=
add_new_disk
(
mddev
,
&
info
);
...
...
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