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
529bbe46
Commit
529bbe46
authored
May 29, 2004
by
Alexander Viro
Committed by
Linus Torvalds
May 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: trivial part of drivers/scsi/* annotation
parent
5d5cdc9b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
15 deletions
+16
-15
drivers/scsi/ide-scsi.c
drivers/scsi/ide-scsi.c
+2
-2
drivers/scsi/osst.c
drivers/scsi/osst.c
+4
-4
drivers/scsi/scsi_devinfo.c
drivers/scsi/scsi_devinfo.c
+1
-1
drivers/scsi/scsi_proc.c
drivers/scsi/scsi_proc.c
+1
-1
drivers/scsi/sd.c
drivers/scsi/sd.c
+4
-3
drivers/scsi/st.c
drivers/scsi/st.c
+4
-4
No files found.
drivers/scsi/ide-scsi.c
View file @
529bbe46
...
@@ -745,7 +745,7 @@ static const char *idescsi_info (struct Scsi_Host *host)
...
@@ -745,7 +745,7 @@ static const char *idescsi_info (struct Scsi_Host *host)
return
"SCSI host adapter emulation for IDE ATAPI devices"
;
return
"SCSI host adapter emulation for IDE ATAPI devices"
;
}
}
static
int
idescsi_ioctl
(
Scsi_Device
*
dev
,
int
cmd
,
void
*
arg
)
static
int
idescsi_ioctl
(
Scsi_Device
*
dev
,
int
cmd
,
void
__user
*
arg
)
{
{
idescsi_scsi_t
*
scsi
=
scsihost_to_idescsi
(
dev
->
host
);
idescsi_scsi_t
*
scsi
=
scsihost_to_idescsi
(
dev
->
host
);
...
@@ -756,7 +756,7 @@ static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
...
@@ -756,7 +756,7 @@ static int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
clear_bit
(
IDESCSI_SG_TRANSFORM
,
&
scsi
->
transform
);
clear_bit
(
IDESCSI_SG_TRANSFORM
,
&
scsi
->
transform
);
return
0
;
return
0
;
}
else
if
(
cmd
==
SG_GET_TRANSFORM
)
}
else
if
(
cmd
==
SG_GET_TRANSFORM
)
return
put_user
(
test_bit
(
IDESCSI_SG_TRANSFORM
,
&
scsi
->
transform
),
(
int
*
)
arg
);
return
put_user
(
test_bit
(
IDESCSI_SG_TRANSFORM
,
&
scsi
->
transform
),
(
int
__user
*
)
arg
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
...
drivers/scsi/osst.c
View file @
529bbe46
...
@@ -4725,6 +4725,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
...
@@ -4725,6 +4725,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
Scsi_Request
*
SRpnt
=
NULL
;
Scsi_Request
*
SRpnt
=
NULL
;
OS_Scsi_Tape
*
STp
=
file
->
private_data
;
OS_Scsi_Tape
*
STp
=
file
->
private_data
;
char
*
name
=
tape_name
(
STp
);
char
*
name
=
tape_name
(
STp
);
void
__user
*
p
=
(
void
__user
*
)
arg
;
if
(
down_interruptible
(
&
STp
->
lock
))
if
(
down_interruptible
(
&
STp
->
lock
))
return
-
ERESTARTSYS
;
return
-
ERESTARTSYS
;
...
@@ -4765,7 +4766,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
...
@@ -4765,7 +4766,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
goto
out
;
goto
out
;
}
}
i
=
copy_from_user
((
char
*
)
&
mtc
,
(
char
*
)
arg
,
sizeof
(
struct
mtop
));
i
=
copy_from_user
((
char
*
)
&
mtc
,
p
,
sizeof
(
struct
mtop
));
if
(
i
)
{
if
(
i
)
{
retval
=
(
-
EFAULT
);
retval
=
(
-
EFAULT
);
goto
out
;
goto
out
;
...
@@ -5003,8 +5004,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
...
@@ -5003,8 +5004,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
STp
->
drv_buffer
!=
0
)
STp
->
drv_buffer
!=
0
)
mt_status
.
mt_gstat
|=
GMT_IM_REP_EN
(
0xffffffff
);
mt_status
.
mt_gstat
|=
GMT_IM_REP_EN
(
0xffffffff
);
i
=
copy_to_user
((
char
*
)
arg
,
(
char
*
)
&
mt_status
,
i
=
copy_to_user
(
p
,
&
mt_status
,
sizeof
(
struct
mtget
));
sizeof
(
struct
mtget
));
if
(
i
)
{
if
(
i
)
{
retval
=
(
-
EFAULT
);
retval
=
(
-
EFAULT
);
goto
out
;
goto
out
;
...
@@ -5031,7 +5031,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
...
@@ -5031,7 +5031,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
goto
out
;
goto
out
;
}
}
mt_pos
.
mt_blkno
=
blk
;
mt_pos
.
mt_blkno
=
blk
;
i
=
copy_to_user
(
(
char
*
)
arg
,
(
char
*
)
(
&
mt_pos
)
,
sizeof
(
struct
mtpos
));
i
=
copy_to_user
(
p
,
&
mt_pos
,
sizeof
(
struct
mtpos
));
if
(
i
)
if
(
i
)
retval
=
-
EFAULT
;
retval
=
-
EFAULT
;
goto
out
;
goto
out
;
...
...
drivers/scsi/scsi_devinfo.c
View file @
529bbe46
...
@@ -433,7 +433,7 @@ static int proc_scsi_devinfo_read(char *buffer, char **start,
...
@@ -433,7 +433,7 @@ static int proc_scsi_devinfo_read(char *buffer, char **start,
* To add a black/white list entry for vendor and model with an integer
* To add a black/white list entry for vendor and model with an integer
* value of flag to the scsi device info list.
* value of flag to the scsi device info list.
*/
*/
static
int
proc_scsi_devinfo_write
(
struct
file
*
file
,
const
char
*
buf
,
static
int
proc_scsi_devinfo_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
unsigned
long
length
,
void
*
data
)
unsigned
long
length
,
void
*
data
)
{
{
char
*
buffer
;
char
*
buffer
;
...
...
drivers/scsi/scsi_proc.c
View file @
529bbe46
...
@@ -54,7 +54,7 @@ static int proc_scsi_read(char *buffer, char **start, off_t offset,
...
@@ -54,7 +54,7 @@ static int proc_scsi_read(char *buffer, char **start, off_t offset,
return
n
;
return
n
;
}
}
static
int
proc_scsi_write_proc
(
struct
file
*
file
,
const
char
*
buf
,
static
int
proc_scsi_write_proc
(
struct
file
*
file
,
const
char
__user
*
buf
,
unsigned
long
count
,
void
*
data
)
unsigned
long
count
,
void
*
data
)
{
{
struct
Scsi_Host
*
shost
=
data
;
struct
Scsi_Host
*
shost
=
data
;
...
...
drivers/scsi/sd.c
View file @
529bbe46
...
@@ -511,7 +511,7 @@ static int sd_release(struct inode *inode, struct file *filp)
...
@@ -511,7 +511,7 @@ static int sd_release(struct inode *inode, struct file *filp)
return
0
;
return
0
;
}
}
static
int
sd_hdio_getgeo
(
struct
block_device
*
bdev
,
struct
hd_geometry
*
loc
)
static
int
sd_hdio_getgeo
(
struct
block_device
*
bdev
,
struct
hd_geometry
__user
*
loc
)
{
{
struct
scsi_disk
*
sdkp
=
scsi_disk
(
bdev
->
bd_disk
);
struct
scsi_disk
*
sdkp
=
scsi_disk
(
bdev
->
bd_disk
);
struct
scsi_device
*
sdp
=
sdkp
->
device
;
struct
scsi_device
*
sdp
=
sdkp
->
device
;
...
@@ -536,7 +536,7 @@ static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc)
...
@@ -536,7 +536,7 @@ static int sd_hdio_getgeo(struct block_device *bdev, struct hd_geometry *loc)
if
(
put_user
(
diskinfo
[
2
],
&
loc
->
cylinders
))
if
(
put_user
(
diskinfo
[
2
],
&
loc
->
cylinders
))
return
-
EFAULT
;
return
-
EFAULT
;
if
(
put_user
((
unsigned
)
get_start_sect
(
bdev
),
if
(
put_user
((
unsigned
)
get_start_sect
(
bdev
),
(
unsigned
long
*
)
&
loc
->
start
))
(
unsigned
long
__user
*
)
&
loc
->
start
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
}
...
@@ -561,6 +561,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
...
@@ -561,6 +561,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
struct
block_device
*
bdev
=
inode
->
i_bdev
;
struct
block_device
*
bdev
=
inode
->
i_bdev
;
struct
gendisk
*
disk
=
bdev
->
bd_disk
;
struct
gendisk
*
disk
=
bdev
->
bd_disk
;
struct
scsi_device
*
sdp
=
scsi_disk
(
disk
)
->
device
;
struct
scsi_device
*
sdp
=
scsi_disk
(
disk
)
->
device
;
void
__user
*
p
=
(
void
__user
*
)
arg
;
int
error
;
int
error
;
SCSI_LOG_IOCTL
(
1
,
printk
(
"sd_ioctl: disk=%s, cmd=0x%x
\n
"
,
SCSI_LOG_IOCTL
(
1
,
printk
(
"sd_ioctl: disk=%s, cmd=0x%x
\n
"
,
...
@@ -578,7 +579,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
...
@@ -578,7 +579,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
if
(
cmd
==
HDIO_GETGEO
)
{
if
(
cmd
==
HDIO_GETGEO
)
{
if
(
!
arg
)
if
(
!
arg
)
return
-
EINVAL
;
return
-
EINVAL
;
return
sd_hdio_getgeo
(
bdev
,
(
struct
hd_geometry
*
)
arg
);
return
sd_hdio_getgeo
(
bdev
,
p
);
}
}
/*
/*
...
...
drivers/scsi/st.c
View file @
529bbe46
...
@@ -3109,6 +3109,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
...
@@ -3109,6 +3109,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
ST_mode
*
STm
;
ST_mode
*
STm
;
ST_partstat
*
STps
;
ST_partstat
*
STps
;
char
*
name
=
tape_name
(
STp
);
char
*
name
=
tape_name
(
STp
);
void
__user
*
p
=
(
void
__user
*
)
arg
;
if
(
down_interruptible
(
&
STp
->
lock
))
if
(
down_interruptible
(
&
STp
->
lock
))
return
-
ERESTARTSYS
;
return
-
ERESTARTSYS
;
...
@@ -3144,7 +3145,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
...
@@ -3144,7 +3145,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
goto
out
;
goto
out
;
}
}
i
=
copy_from_user
(
(
char
*
)
&
mtc
,
(
char
*
)
arg
,
sizeof
(
struct
mtop
));
i
=
copy_from_user
(
&
mtc
,
p
,
sizeof
(
struct
mtop
));
if
(
i
)
{
if
(
i
)
{
retval
=
(
-
EFAULT
);
retval
=
(
-
EFAULT
);
goto
out
;
goto
out
;
...
@@ -3380,8 +3381,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
...
@@ -3380,8 +3381,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
if
(
STp
->
cleaning_req
)
if
(
STp
->
cleaning_req
)
mt_status
.
mt_gstat
|=
GMT_CLN
(
0xffffffff
);
mt_status
.
mt_gstat
|=
GMT_CLN
(
0xffffffff
);
i
=
copy_to_user
((
char
*
)
arg
,
(
char
*
)
&
(
mt_status
),
i
=
copy_to_user
(
p
,
&
mt_status
,
sizeof
(
struct
mtget
));
sizeof
(
struct
mtget
));
if
(
i
)
{
if
(
i
)
{
retval
=
(
-
EFAULT
);
retval
=
(
-
EFAULT
);
goto
out
;
goto
out
;
...
@@ -3402,7 +3402,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
...
@@ -3402,7 +3402,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
goto
out
;
goto
out
;
}
}
mt_pos
.
mt_blkno
=
blk
;
mt_pos
.
mt_blkno
=
blk
;
i
=
copy_to_user
(
(
char
*
)
arg
,
(
char
*
)
(
&
mt_pos
)
,
sizeof
(
struct
mtpos
));
i
=
copy_to_user
(
p
,
&
mt_pos
,
sizeof
(
struct
mtpos
));
if
(
i
)
if
(
i
)
retval
=
(
-
EFAULT
);
retval
=
(
-
EFAULT
);
goto
out
;
goto
out
;
...
...
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