Jeff Garzik wrote: > Brian King wrote: >> >> -int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) >> +int __ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) >> { >> - struct ata_port *ap; >> - struct ata_device *dev; >> int val = -EINVAL, rc = -EINVAL; >> >> - ap = (struct ata_port *) &scsidev->host->hostdata[0]; >> - if (!ap) >> - goto out; >> - >> - dev = ata_scsi_find_dev(ap, scsidev); >> - if (!dev) { >> - rc = -ENODEV; >> - goto out; >> - } >> - >> switch (cmd) { > > > Rather than create a new function, it looks like the above code can > simply be removed. I don't see anything that uses 'ap' or 'dev'. > Sounds good to me. Patch below. -- Brian King eServer Storage I/O IBM Linux Technology Center
In preparation for SAS, kill some unnecessary code in ata_scsi_ioctl to find the ATA port and device given the scsi_device. Neither local is used in the function. Signed-off-by: Brian King <brking@xxxxxxxxxx> --- libata-dev-bjking1/drivers/scsi/libata-scsi.c | 13 ------------- 1 files changed, 13 deletions(-) diff -puN drivers/scsi/libata-scsi.c~libata_scsi_ioctl drivers/scsi/libata-scsi.c --- libata-dev/drivers/scsi/libata-scsi.c~libata_scsi_ioctl 2006-03-22 11:16:33.000000000 -0600 +++ libata-dev-bjking1/drivers/scsi/libata-scsi.c 2006-03-22 11:16:33.000000000 -0600 @@ -257,20 +257,8 @@ int ata_task_ioctl(struct scsi_device *s int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) { - struct ata_port *ap; - struct ata_device *dev; int val = -EINVAL, rc = -EINVAL; - ap = (struct ata_port *) &scsidev->host->hostdata[0]; - if (!ap) - goto out; - - dev = ata_scsi_find_dev(ap, scsidev); - if (!dev) { - rc = -ENODEV; - goto out; - } - switch (cmd) { case ATA_IOC_GET_IO32: val = 0; @@ -299,7 +287,6 @@ int ata_scsi_ioctl(struct scsi_device *s break; } -out: return rc; } _