From: Brian King <brking@us.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 05/15] libata: Add __ata_scsi_ioctl
Date: Wed, 22 Mar 2006 17:22:29 -0600 [thread overview]
Message-ID: <4421DC35.6090109@us.ibm.com> (raw)
In-Reply-To: <4420AE54.6090603@pobox.com>
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libata_scsi_ioctl.patch --]
[-- Type: text/x-patch; name="libata_scsi_ioctl.patch", Size: 1141 bytes --]
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@us.ibm.com>
---
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;
}
_
next prev parent reply other threads:[~2006-03-22 23:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-17 23:04 [PATCH 05/15] libata: Add __ata_scsi_ioctl Brian King
2006-03-22 1:54 ` Jeff Garzik
2006-03-22 23:22 ` Brian King [this message]
2006-03-22 23:35 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4421DC35.6090109@us.ibm.com \
--to=brking@us.ibm.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).