Commit 3a79c899 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: aacraid annotation

parent 816deba5
...@@ -1080,7 +1080,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) ...@@ -1080,7 +1080,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
} }
} }
static int query_disk(struct aac_dev *dev, void *arg) static int query_disk(struct aac_dev *dev, void __user *arg)
{ {
struct aac_query_disk qd; struct aac_query_disk qd;
struct fsa_scsi_hba *fsa_dev_ptr; struct fsa_scsi_hba *fsa_dev_ptr;
...@@ -1117,7 +1117,7 @@ static int query_disk(struct aac_dev *dev, void *arg) ...@@ -1117,7 +1117,7 @@ static int query_disk(struct aac_dev *dev, void *arg)
return 0; return 0;
} }
static int force_delete_disk(struct aac_dev *dev, void *arg) static int force_delete_disk(struct aac_dev *dev, void __user *arg)
{ {
struct aac_delete_disk dd; struct aac_delete_disk dd;
struct fsa_scsi_hba *fsa_dev_ptr; struct fsa_scsi_hba *fsa_dev_ptr;
...@@ -1140,7 +1140,7 @@ static int force_delete_disk(struct aac_dev *dev, void *arg) ...@@ -1140,7 +1140,7 @@ static int force_delete_disk(struct aac_dev *dev, void *arg)
return 0; return 0;
} }
static int delete_disk(struct aac_dev *dev, void *arg) static int delete_disk(struct aac_dev *dev, void __user *arg)
{ {
struct aac_delete_disk dd; struct aac_delete_disk dd;
struct fsa_scsi_hba *fsa_dev_ptr; struct fsa_scsi_hba *fsa_dev_ptr;
...@@ -1167,7 +1167,7 @@ static int delete_disk(struct aac_dev *dev, void *arg) ...@@ -1167,7 +1167,7 @@ static int delete_disk(struct aac_dev *dev, void *arg)
} }
} }
int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg) int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg)
{ {
switch (cmd) { switch (cmd) {
case FSACTL_QUERY_DISK: case FSACTL_QUERY_DISK:
......
...@@ -1237,7 +1237,7 @@ struct fib_ioctl ...@@ -1237,7 +1237,7 @@ struct fib_ioctl
{ {
u32 fibctx; u32 fibctx;
s32 wait; s32 wait;
char *fib; char __user *fib;
}; };
struct revision struct revision
...@@ -1448,8 +1448,8 @@ int fib_complete(struct fib * context); ...@@ -1448,8 +1448,8 @@ int fib_complete(struct fib * context);
struct aac_dev *aac_init_adapter(struct aac_dev *dev); struct aac_dev *aac_init_adapter(struct aac_dev *dev);
int aac_get_containers(struct aac_dev *dev); int aac_get_containers(struct aac_dev *dev);
int aac_scsi_cmd(struct scsi_cmnd *cmd); int aac_scsi_cmd(struct scsi_cmnd *cmd);
int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg); int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg);
int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg); int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg);
int aac_rx_init(struct aac_dev *dev); int aac_rx_init(struct aac_dev *dev);
int aac_rkt_init(struct aac_dev *dev); int aac_rkt_init(struct aac_dev *dev);
int aac_sa_init(struct aac_dev *dev); int aac_sa_init(struct aac_dev *dev);
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
* program. * program.
*/ */
static int ioctl_send_fib(struct aac_dev * dev, void *arg) static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
{ {
struct hw_fib * kfib; struct hw_fib * kfib;
struct fib *fibptr; struct fib *fibptr;
...@@ -127,7 +127,7 @@ static int ioctl_send_fib(struct aac_dev * dev, void *arg) ...@@ -127,7 +127,7 @@ static int ioctl_send_fib(struct aac_dev * dev, void *arg)
* passed in from the user. * passed in from the user.
*/ */
static int open_getadapter_fib(struct aac_dev * dev, void *arg) static int open_getadapter_fib(struct aac_dev * dev, void __user *arg)
{ {
struct aac_fib_context * fibctx; struct aac_fib_context * fibctx;
int status; int status;
...@@ -199,7 +199,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void *arg) ...@@ -199,7 +199,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void *arg)
* passed in from the user. * passed in from the user.
*/ */
static int next_getadapter_fib(struct aac_dev * dev, void *arg) static int next_getadapter_fib(struct aac_dev * dev, void __user *arg)
{ {
struct fib_ioctl f; struct fib_ioctl f;
struct fib *fib; struct fib *fib;
...@@ -332,7 +332,7 @@ int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context * fibctx) ...@@ -332,7 +332,7 @@ int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context * fibctx)
* This routine will close down the fibctx passed in from the user. * This routine will close down the fibctx passed in from the user.
*/ */
static int close_getadapter_fib(struct aac_dev * dev, void *arg) static int close_getadapter_fib(struct aac_dev * dev, void __user *arg)
{ {
struct aac_fib_context *fibctx; struct aac_fib_context *fibctx;
int status; int status;
...@@ -384,7 +384,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void *arg) ...@@ -384,7 +384,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void *arg)
* simple! * simple!
*/ */
static int check_revision(struct aac_dev *dev, void *arg) static int check_revision(struct aac_dev *dev, void __user *arg)
{ {
struct revision response; struct revision response;
...@@ -403,20 +403,20 @@ static int check_revision(struct aac_dev *dev, void *arg) ...@@ -403,20 +403,20 @@ static int check_revision(struct aac_dev *dev, void *arg)
* *
*/ */
int aac_send_raw_srb(struct aac_dev* dev, void* arg) int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
{ {
struct fib* srbfib; struct fib* srbfib;
int status; int status;
struct aac_srb *srbcmd; struct aac_srb *srbcmd;
struct aac_srb *user_srb = arg; struct aac_srb __user *user_srb = arg;
struct aac_srb_reply* user_reply; struct aac_srb_reply __user *user_reply;
struct aac_srb_reply* reply; struct aac_srb_reply* reply;
u32 fibsize = 0; u32 fibsize = 0;
u32 flags = 0; u32 flags = 0;
s32 rcode = 0; s32 rcode = 0;
u32 data_dir; u32 data_dir;
ulong sg_user[32]; void __user *sg_user[32];
ulong sg_list[32]; void *sg_list[32];
u32 sg_indx = 0; u32 sg_indx = 0;
u32 byte_count = 0; u32 byte_count = 0;
u32 actual_fibsize = 0; u32 actual_fibsize = 0;
...@@ -437,7 +437,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -437,7 +437,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
srbcmd = (struct aac_srb*) fib_data(srbfib); srbcmd = (struct aac_srb*) fib_data(srbfib);
if(copy_from_user((void*)&fibsize, (void*)&user_srb->count,sizeof(u32))){ if(copy_from_user(&fibsize, &user_srb->count,sizeof(u32))){
printk(KERN_DEBUG"aacraid: Could not copy data size from user\n"); printk(KERN_DEBUG"aacraid: Could not copy data size from user\n");
rcode = -EFAULT; rcode = -EFAULT;
goto cleanup; goto cleanup;
...@@ -512,12 +512,12 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -512,12 +512,12 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
rcode = -ENOMEM; rcode = -ENOMEM;
goto cleanup; goto cleanup;
} }
sg_user[i] = (ulong)psg->sg[i].addr; sg_user[i] = (void __user *)psg->sg[i].addr;
sg_list[i] = (ulong)p; // save so we can clean up later sg_list[i] = p; // save so we can clean up later
sg_indx = i; sg_indx = i;
if( flags & SRB_DataOut ){ if( flags & SRB_DataOut ){
if(copy_from_user(p,psg->sg[i].addr,psg->sg[i].count)){ if(copy_from_user(p,sg_user[i],psg->sg[i].count)){
printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n");
rcode = -EFAULT; rcode = -EFAULT;
goto cleanup; goto cleanup;
...@@ -533,7 +533,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -533,7 +533,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
} }
srbcmd->count = cpu_to_le32(byte_count); srbcmd->count = cpu_to_le32(byte_count);
status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,0,0); status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
} else { } else {
struct sgmap* psg = &srbcmd->sg; struct sgmap* psg = &srbcmd->sg;
byte_count = 0; byte_count = 0;
...@@ -559,12 +559,12 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -559,12 +559,12 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
rcode = -ENOMEM; rcode = -ENOMEM;
goto cleanup; goto cleanup;
} }
sg_user[i] = (ulong)(psg->sg[i].addr); sg_user[i] = (void __user *)(psg->sg[i].addr);
sg_list[i] = (ulong)p; // save so we can clean up later sg_list[i] = p; // save so we can clean up later
sg_indx = i; sg_indx = i;
if( flags & SRB_DataOut ){ if( flags & SRB_DataOut ){
if(copy_from_user((void*)p,(void*)(ulong)(psg->sg[i].addr),psg->sg[i].count)){ if(copy_from_user(p,sg_user[i],psg->sg[i].count)){
printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n");
rcode = -EFAULT; rcode = -EFAULT;
goto cleanup; goto cleanup;
...@@ -577,7 +577,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -577,7 +577,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
byte_count += psg->sg[i].count; byte_count += psg->sg[i].count;
} }
srbcmd->count = cpu_to_le32(byte_count); srbcmd->count = cpu_to_le32(byte_count);
status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, 0, 0); status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
} }
if (status != 0){ if (status != 0){
...@@ -588,7 +588,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -588,7 +588,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
if( flags & SRB_DataIn ) { if( flags & SRB_DataIn ) {
for(i = 0 ; i <= sg_indx; i++){ for(i = 0 ; i <= sg_indx; i++){
if(copy_to_user((void*)(sg_user[i]),(void*)(sg_list[i]),le32_to_cpu(srbcmd->sg.sg[i].count))){ if(copy_to_user(sg_user[i],sg_list[i],le32_to_cpu(srbcmd->sg.sg[i].count))){
printk(KERN_DEBUG"aacraid: Could not copy sg data to user\n"); printk(KERN_DEBUG"aacraid: Could not copy sg data to user\n");
rcode = -EFAULT; rcode = -EFAULT;
goto cleanup; goto cleanup;
...@@ -606,7 +606,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg) ...@@ -606,7 +606,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
cleanup: cleanup:
for(i=0; i <= sg_indx; i++){ for(i=0; i <= sg_indx; i++){
kfree((void*)sg_list[i]); kfree(sg_list[i]);
} }
fib_complete(srbfib); fib_complete(srbfib);
fib_free(srbfib); fib_free(srbfib);
...@@ -621,14 +621,14 @@ struct aac_pci_info { ...@@ -621,14 +621,14 @@ struct aac_pci_info {
}; };
int aac_get_pci_info(struct aac_dev* dev, void* arg) int aac_get_pci_info(struct aac_dev* dev, void __user *arg)
{ {
struct aac_pci_info pci_info; struct aac_pci_info pci_info;
pci_info.bus = dev->pdev->bus->number; pci_info.bus = dev->pdev->bus->number;
pci_info.slot = PCI_SLOT(dev->pdev->devfn); pci_info.slot = PCI_SLOT(dev->pdev->devfn);
if(copy_to_user( arg, (void*)&pci_info, sizeof(struct aac_pci_info))){ if (copy_to_user(arg, &pci_info, sizeof(struct aac_pci_info))) {
printk(KERN_DEBUG "aacraid: Could not copy pci info\n"); printk(KERN_DEBUG "aacraid: Could not copy pci info\n");
return -EFAULT; return -EFAULT;
} }
...@@ -636,7 +636,7 @@ int aac_get_pci_info(struct aac_dev* dev, void* arg) ...@@ -636,7 +636,7 @@ int aac_get_pci_info(struct aac_dev* dev, void* arg)
} }
int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg) int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
{ {
int status; int status;
......
...@@ -356,7 +356,7 @@ static int aac_slave_configure(struct scsi_device *sdev) ...@@ -356,7 +356,7 @@ static int aac_slave_configure(struct scsi_device *sdev)
return 0; return 0;
} }
static int aac_ioctl(struct scsi_device *sdev, int cmd, void * arg) static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg)
{ {
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
return aac_do_ioctl(dev, cmd, arg); return aac_do_ioctl(dev, cmd, arg);
...@@ -463,7 +463,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file) ...@@ -463,7 +463,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
static int aac_cfg_ioctl(struct inode *inode, struct file *file, static int aac_cfg_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
return aac_do_ioctl(file->private_data, cmd, (void *)arg); return aac_do_ioctl(file->private_data, cmd, (void __user *)arg);
} }
static struct file_operations aac_cfg_fops = { static struct file_operations aac_cfg_fops = {
......
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