Patchwork [1/2] libata: Use integer return value for atapi_command_packet_set

login
register
mail settings
Submitter Shan Hai
Date March 18, 2013, 2:30 a.m.
Message ID <1363573844-12729-2-git-send-email-shan.hai@windriver.com>
Download mbox | patch
Permalink /patch/228342/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Shan Hai - March 18, 2013, 2:30 a.m.
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>
---
 include/linux/ata.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jeff Garzik - April 3, 2013, 11:35 p.m.
On 03/17/2013 10:30 PM, Shan Hai wrote:
> 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>
> ---
>   include/linux/ata.h |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)

applied 1-2



--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/include/linux/ata.h b/include/linux/ata.h
index 8f7a3d6..ee0bd95 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -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;
 }