Commit 38418a28 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: misc scsi annotation

osst.c, st.c, scsi_debug.c annotated.
parent 51a17275
...@@ -154,8 +154,8 @@ static int modes_defined = FALSE; ...@@ -154,8 +154,8 @@ static int modes_defined = FALSE;
static OSST_buffer *new_tape_buffer(int, int, int); static OSST_buffer *new_tape_buffer(int, int, int);
static int enlarge_buffer(OSST_buffer *, int); static int enlarge_buffer(OSST_buffer *, int);
static void normalize_buffer(OSST_buffer *); static void normalize_buffer(OSST_buffer *);
static int append_to_buffer(const char *, OSST_buffer *, int); static int append_to_buffer(const char __user *, OSST_buffer *, int);
static int from_buffer(OSST_buffer *, char *, int); static int from_buffer(OSST_buffer *, char __user *, int);
static int osst_zero_buffer_tail(OSST_buffer *); static int osst_zero_buffer_tail(OSST_buffer *);
static int osst_copy_to_buffer(OSST_buffer *, unsigned char *); static int osst_copy_to_buffer(OSST_buffer *, unsigned char *);
static int osst_copy_from_buffer(OSST_buffer *, unsigned char *); static int osst_copy_from_buffer(OSST_buffer *, unsigned char *);
...@@ -3157,13 +3157,13 @@ static void reset_state(OS_Scsi_Tape *STp) ...@@ -3157,13 +3157,13 @@ static void reset_state(OS_Scsi_Tape *STp)
/* Entry points to osst */ /* Entry points to osst */
/* Write command */ /* Write command */
static ssize_t osst_write(struct file * filp, const char * buf, size_t count, loff_t *ppos) static ssize_t osst_write(struct file * filp, const char __user * buf, size_t count, loff_t *ppos)
{ {
ssize_t total, retval = 0; ssize_t total, retval = 0;
ssize_t i, do_count, blks, transfer; ssize_t i, do_count, blks, transfer;
int write_threshold; int write_threshold;
int doing_write = 0; int doing_write = 0;
const char * b_point; const char __user * b_point;
Scsi_Request * SRpnt = NULL; Scsi_Request * SRpnt = NULL;
ST_mode * STm; ST_mode * STm;
ST_partstat * STps; ST_partstat * STps;
...@@ -3486,7 +3486,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name ...@@ -3486,7 +3486,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
/* Read command */ /* Read command */
static ssize_t osst_read(struct file * filp, char * buf, size_t count, loff_t *ppos) static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, loff_t *ppos)
{ {
ssize_t total, retval = 0; ssize_t total, retval = 0;
ssize_t i, transfer; ssize_t i, transfer;
...@@ -5189,7 +5189,7 @@ static void normalize_buffer(OSST_buffer *STbuffer) ...@@ -5189,7 +5189,7 @@ static void normalize_buffer(OSST_buffer *STbuffer)
/* Move data from the user buffer to the tape buffer. Returns zero (success) or /* Move data from the user buffer to the tape buffer. Returns zero (success) or
negative error code. */ negative error code. */
static int append_to_buffer(const char *ubp, OSST_buffer *st_bp, int do_count) static int append_to_buffer(const char __user *ubp, OSST_buffer *st_bp, int do_count)
{ {
int i, cnt, res, offset; int i, cnt, res, offset;
...@@ -5222,7 +5222,7 @@ static int append_to_buffer(const char *ubp, OSST_buffer *st_bp, int do_count) ...@@ -5222,7 +5222,7 @@ static int append_to_buffer(const char *ubp, OSST_buffer *st_bp, int do_count)
/* Move data from the tape buffer to the user buffer. Returns zero (success) or /* Move data from the tape buffer to the user buffer. Returns zero (success) or
negative error code. */ negative error code. */
static int from_buffer(OSST_buffer *st_bp, char *ubp, int do_count) static int from_buffer(OSST_buffer *st_bp, char __user *ubp, int do_count)
{ {
int i, cnt, res, offset; int i, cnt, res, offset;
......
...@@ -1461,7 +1461,7 @@ static ssize_t sdebug_add_host_store(struct device_driver * ddp, ...@@ -1461,7 +1461,7 @@ static ssize_t sdebug_add_host_store(struct device_driver * ddp,
DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show, DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show,
sdebug_add_host_store) sdebug_add_host_store)
static void do_create_driverfs_files() static void do_create_driverfs_files(void)
{ {
driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay); driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay);
driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts); driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts);
...@@ -1473,7 +1473,7 @@ static void do_create_driverfs_files() ...@@ -1473,7 +1473,7 @@ static void do_create_driverfs_files()
driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host); driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host);
} }
static void do_remove_driverfs_files() static void do_remove_driverfs_files(void)
{ {
driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host);
driver_remove_file(&sdebug_driverfs_driver, &driver_attr_scsi_level); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_scsi_level);
...@@ -1594,7 +1594,7 @@ static void sdebug_release_adapter(struct device * dev) ...@@ -1594,7 +1594,7 @@ static void sdebug_release_adapter(struct device * dev)
kfree(sdbg_host); kfree(sdbg_host);
} }
static int sdebug_add_adapter() static int sdebug_add_adapter(void)
{ {
int k, devs_per_host; int k, devs_per_host;
int error = 0; int error = 0;
...@@ -1657,7 +1657,7 @@ static int sdebug_add_adapter() ...@@ -1657,7 +1657,7 @@ static int sdebug_add_adapter()
return error; return error;
} }
static void sdebug_remove_adapter() static void sdebug_remove_adapter(void)
{ {
struct sdebug_host_info * sdbg_host = NULL; struct sdebug_host_info * sdbg_host = NULL;
......
...@@ -176,8 +176,8 @@ static int modes_defined; ...@@ -176,8 +176,8 @@ static int modes_defined;
static ST_buffer *new_tape_buffer(int, int, int); static ST_buffer *new_tape_buffer(int, int, int);
static int enlarge_buffer(ST_buffer *, int, int); static int enlarge_buffer(ST_buffer *, int, int);
static void normalize_buffer(ST_buffer *); static void normalize_buffer(ST_buffer *);
static int append_to_buffer(const char *, ST_buffer *, int); static int append_to_buffer(const char __user *, ST_buffer *, int);
static int from_buffer(ST_buffer *, char *, int); static int from_buffer(ST_buffer *, char __user *, int);
static void move_buffer_data(ST_buffer *, int); static void move_buffer_data(ST_buffer *, int);
static void buf_to_sg(ST_buffer *, unsigned int); static void buf_to_sg(ST_buffer *, unsigned int);
...@@ -1276,7 +1276,7 @@ static ssize_t rw_checks(Scsi_Tape *STp, struct file *filp, size_t count, loff_t ...@@ -1276,7 +1276,7 @@ static ssize_t rw_checks(Scsi_Tape *STp, struct file *filp, size_t count, loff_t
} }
static int setup_buffering(Scsi_Tape *STp, const char *buf, size_t count, int is_read) static int setup_buffering(Scsi_Tape *STp, const char __user *buf, size_t count, int is_read)
{ {
int i, bufsize, retval = 0; int i, bufsize, retval = 0;
ST_buffer *STbp = STp->buffer; ST_buffer *STbp = STp->buffer;
...@@ -1348,7 +1348,7 @@ static void release_buffering(Scsi_Tape *STp) ...@@ -1348,7 +1348,7 @@ static void release_buffering(Scsi_Tape *STp)
/* Write command */ /* Write command */
static ssize_t static ssize_t
st_write(struct file *filp, const char *buf, size_t count, loff_t * ppos) st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
{ {
ssize_t total; ssize_t total;
ssize_t i, do_count, blks, transfer; ssize_t i, do_count, blks, transfer;
...@@ -1356,7 +1356,7 @@ static ssize_t ...@@ -1356,7 +1356,7 @@ static ssize_t
int undone, retry_eot = 0, scode; int undone, retry_eot = 0, scode;
int async_write; int async_write;
unsigned char cmd[MAX_COMMAND_SIZE]; unsigned char cmd[MAX_COMMAND_SIZE];
const char *b_point; const char __user *b_point;
Scsi_Request *SRpnt = NULL; Scsi_Request *SRpnt = NULL;
Scsi_Tape *STp = filp->private_data; Scsi_Tape *STp = filp->private_data;
ST_mode *STm; ST_mode *STm;
...@@ -1817,7 +1817,7 @@ static long read_tape(Scsi_Tape *STp, long count, Scsi_Request ** aSRpnt) ...@@ -1817,7 +1817,7 @@ static long read_tape(Scsi_Tape *STp, long count, Scsi_Request ** aSRpnt)
/* Read command */ /* Read command */
static ssize_t static ssize_t
st_read(struct file *filp, char *buf, size_t count, loff_t * ppos) st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
{ {
ssize_t total; ssize_t total;
ssize_t retval = 0; ssize_t retval = 0;
...@@ -3527,7 +3527,7 @@ static void normalize_buffer(ST_buffer * STbuffer) ...@@ -3527,7 +3527,7 @@ static void normalize_buffer(ST_buffer * STbuffer)
/* Move data from the user buffer to the tape buffer. Returns zero (success) or /* Move data from the user buffer to the tape buffer. Returns zero (success) or
negative error code. */ negative error code. */
static int append_to_buffer(const char *ubp, ST_buffer * st_bp, int do_count) static int append_to_buffer(const char __user *ubp, ST_buffer * st_bp, int do_count)
{ {
int i, cnt, res, offset; int i, cnt, res, offset;
...@@ -3558,7 +3558,7 @@ static int append_to_buffer(const char *ubp, ST_buffer * st_bp, int do_count) ...@@ -3558,7 +3558,7 @@ static int append_to_buffer(const char *ubp, ST_buffer * st_bp, int do_count)
/* Move data from the tape buffer to the user buffer. Returns zero (success) or /* Move data from the tape buffer to the user buffer. Returns zero (success) or
negative error code. */ negative error code. */
static int from_buffer(ST_buffer * st_bp, char *ubp, int do_count) static int from_buffer(ST_buffer * st_bp, char __user *ubp, int do_count)
{ {
int i, cnt, res, offset; int i, cnt, res, offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment