Skip to content

Commit

Permalink
pata_ali: use atapi_cmd_type() to determine cmd type instead of trans…
Browse files Browse the repository at this point in the history
…fer size

pata_ali was using qc->nbytes to determine whether a command is
data transfer type or not.  As now qc->nbytes can be extended by
padding and draining buffers, these tests are not useful anymore.

Use atapi_cmd_type() instead.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 17, 2008
1 parent a22e644 commit 4a38e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/pata_ali.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static void ali_lock_sectors(struct ata_device *adev)
static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
{
/* If its not a media command, its not worth it */
if (qc->nbytes < 2048)
if (atapi_cmd_type(qc->cdb[0]) == ATAPI_MISC)
return -EOPNOTSUPP;
return 0;
}
Expand Down

0 comments on commit 4a38e73

Please sign in to comment.