From: Tejun Heo Date: Tue, 11 Mar 2008 02:35:00 +0000 (+0900) Subject: pata_ali: use atapi_cmd_type() to determine cmd type instead of transfer size X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a38e733a75d52e84772fc00d88e32032a235e75;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git pata_ali: use atapi_cmd_type() to determine cmd type instead of transfer 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 Cc: Alan Cox Cc: Rafael J. Wysocki Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index 7e68edf3c0f3..8786455c901d 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c @@ -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; }