]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
libata: Use integer return value for atapi_command_packet_set
authorShan Hai <shan.hai@windriver.com>
Mon, 18 Mar 2013 02:30:43 +0000 (10:30 +0800)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 3 Apr 2013 23:33:40 +0000 (19:33 -0400)
The function returns type of ATAPI drives so it should return integer value.
The commit 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) since
v2.6.39 changed the type of return value from int to bool, the change would
cause all of the ATAPI class drives to be treated as TYPE_TAPE and the
max_sectors of the drives to be set to 65535 because of the commit
f8d8e5799b7(libata: increase 128 KB / cmd limit for ATAPI tape drives), for the
function would return true for all ATAPI class drives and the TYPE_TAPE is
defined as 0x01.

Cc: stable@vger.kernel.org
Signed-off-by: Shan Hai <shan.hai@windriver.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
include/linux/ata.h

index 8f7a3d68371a37314ab8263c078674fd79a8c5b5..ee0bd95240553576bf51672015c756aa0dea3b94 100644 (file)
@@ -954,7 +954,7 @@ static inline int atapi_cdb_len(const u16 *dev_id)
        }
 }
 
-static inline bool atapi_command_packet_set(const u16 *dev_id)
+static inline int atapi_command_packet_set(const u16 *dev_id)
 {
        return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f;
 }