aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-11-27 05:43:42 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:12 -0500
commit7dc951aefdc1dc20228691b04867fb6195864d67 (patch)
treeb2c3c1213831593feaf16c9fdc0c88f26d3c10f2 /drivers
parent9d3501ab962b1506d93974faf8509251b4a85fbc (diff)
libata: xfer_mask is unsigned long not unsigned int
Jeff says xfer_mask is unsigned long not unsigned int. Convert all xfermask fields and handling functions to deal with unsigned longs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-core.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ab84772235c9..711595390996 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -454,8 +454,9 @@ int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
454 * RETURNS: 454 * RETURNS:
455 * Packed xfer_mask. 455 * Packed xfer_mask.
456 */ 456 */
457unsigned int ata_pack_xfermask(unsigned int pio_mask, 457unsigned long ata_pack_xfermask(unsigned long pio_mask,
458 unsigned int mwdma_mask, unsigned int udma_mask) 458 unsigned long mwdma_mask,
459 unsigned long udma_mask)
459{ 460{
460 return ((pio_mask << ATA_SHIFT_PIO) & ATA_MASK_PIO) | 461 return ((pio_mask << ATA_SHIFT_PIO) & ATA_MASK_PIO) |
461 ((mwdma_mask << ATA_SHIFT_MWDMA) & ATA_MASK_MWDMA) | 462 ((mwdma_mask << ATA_SHIFT_MWDMA) & ATA_MASK_MWDMA) |
@@ -472,8 +473,8 @@ unsigned int ata_pack_xfermask(unsigned int pio_mask,
472 * Unpack @xfer_mask into @pio_mask, @mwdma_mask and @udma_mask. 473 * Unpack @xfer_mask into @pio_mask, @mwdma_mask and @udma_mask.
473 * Any NULL distination masks will be ignored. 474 * Any NULL distination masks will be ignored.
474 */ 475 */
475void ata_unpack_xfermask(unsigned int xfer_mask, unsigned int *pio_mask, 476void ata_unpack_xfermask(unsigned long xfer_mask, unsigned long *pio_mask,
476 unsigned int *mwdma_mask, unsigned int *udma_mask) 477 unsigned long *mwdma_mask, unsigned long *udma_mask)
477{ 478{
478 if (pio_mask) 479 if (pio_mask)
479 *pio_mask = (xfer_mask & ATA_MASK_PIO) >> ATA_SHIFT_PIO; 480 *pio_mask = (xfer_mask & ATA_MASK_PIO) >> ATA_SHIFT_PIO;
@@ -506,7 +507,7 @@ static const struct ata_xfer_ent {
506 * RETURNS: 507 * RETURNS:
507 * Matching XFER_* value, 0xff if no match found. 508 * Matching XFER_* value, 0xff if no match found.
508 */ 509 */
509u8 ata_xfer_mask2mode(unsigned int xfer_mask) 510u8 ata_xfer_mask2mode(unsigned long xfer_mask)
510{ 511{
511 int highbit = fls(xfer_mask) - 1; 512 int highbit = fls(xfer_mask) - 1;
512 const struct ata_xfer_ent *ent; 513 const struct ata_xfer_ent *ent;
@@ -529,7 +530,7 @@ u8 ata_xfer_mask2mode(unsigned int xfer_mask)
529 * RETURNS: 530 * RETURNS:
530 * Matching xfer_mask, 0 if no match found. 531 * Matching xfer_mask, 0 if no match found.
531 */ 532 */
532unsigned int ata_xfer_mode2mask(u8 xfer_mode) 533unsigned long ata_xfer_mode2mask(u8 xfer_mode)
533{ 534{
534 const struct ata_xfer_ent *ent; 535 const struct ata_xfer_ent *ent;
535 536
@@ -552,7 +553,7 @@ unsigned int ata_xfer_mode2mask(u8 xfer_mode)
552 * RETURNS: 553 * RETURNS:
553 * Matching xfer_shift, -1 if no match found. 554 * Matching xfer_shift, -1 if no match found.
554 */ 555 */
555int ata_xfer_mode2shift(unsigned int xfer_mode) 556int ata_xfer_mode2shift(unsigned long xfer_mode)
556{ 557{
557 const struct ata_xfer_ent *ent; 558 const struct ata_xfer_ent *ent;
558 559
@@ -576,7 +577,7 @@ int ata_xfer_mode2shift(unsigned int xfer_mode)
576 * Constant C string representing highest speed listed in 577 * Constant C string representing highest speed listed in
577 * @mode_mask, or the constant C string "<n/a>". 578 * @mode_mask, or the constant C string "<n/a>".
578 */ 579 */
579const char *ata_mode_string(unsigned int xfer_mask) 580const char *ata_mode_string(unsigned long xfer_mask)
580{ 581{
581 static const char * const xfer_mode_str[] = { 582 static const char * const xfer_mode_str[] = {
582 "PIO0", 583 "PIO0",
@@ -1424,9 +1425,9 @@ static inline void ata_dump_id(const u16 *id)
1424 * RETURNS: 1425 * RETURNS:
1425 * Computed xfermask 1426 * Computed xfermask
1426 */ 1427 */
1427unsigned int ata_id_xfermask(const u16 *id) 1428unsigned long ata_id_xfermask(const u16 *id)
1428{ 1429{
1429 unsigned int pio_mask, mwdma_mask, udma_mask; 1430 unsigned long pio_mask, mwdma_mask, udma_mask;
1430 1431
1431 /* Usual case. Word 53 indicates word 64 is valid */ 1432 /* Usual case. Word 53 indicates word 64 is valid */
1432 if (id[ATA_ID_FIELD_VALID] & (1 << 1)) { 1433 if (id[ATA_ID_FIELD_VALID] & (1 << 1)) {
@@ -2050,7 +2051,7 @@ int ata_dev_configure(struct ata_device *dev)
2050 struct ata_eh_context *ehc = &dev->link->eh_context; 2051 struct ata_eh_context *ehc = &dev->link->eh_context;
2051 int print_info = ehc->i.flags & ATA_EHI_PRINTINFO; 2052 int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
2052 const u16 *id = dev->id; 2053 const u16 *id = dev->id;
2053 unsigned int xfer_mask; 2054 unsigned long xfer_mask;
2054 char revbuf[7]; /* XYZ-99\0 */ 2055 char revbuf[7]; /* XYZ-99\0 */
2055 char fwrevbuf[ATA_ID_FW_REV_LEN+1]; 2056 char fwrevbuf[ATA_ID_FW_REV_LEN+1];
2056 char modelbuf[ATA_ID_PROD_LEN+1]; 2057 char modelbuf[ATA_ID_PROD_LEN+1];
@@ -2907,8 +2908,8 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,
2907int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel) 2908int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
2908{ 2909{
2909 char buf[32]; 2910 char buf[32];
2910 unsigned int orig_mask, xfer_mask; 2911 unsigned long orig_mask, xfer_mask;
2911 unsigned int pio_mask, mwdma_mask, udma_mask; 2912 unsigned long pio_mask, mwdma_mask, udma_mask;
2912 int quiet, highbit; 2913 int quiet, highbit;
2913 2914
2914 quiet = !!(sel & ATA_DNXFER_QUIET); 2915 quiet = !!(sel & ATA_DNXFER_QUIET);
@@ -3052,7 +3053,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
3052 3053
3053 /* step 1: calculate xfer_mask */ 3054 /* step 1: calculate xfer_mask */
3054 ata_link_for_each_dev(dev, link) { 3055 ata_link_for_each_dev(dev, link) {
3055 unsigned int pio_mask, dma_mask; 3056 unsigned long pio_mask, dma_mask;
3056 unsigned int mode_mask; 3057 unsigned int mode_mask;
3057 3058
3058 if (!ata_dev_enabled(dev)) 3059 if (!ata_dev_enabled(dev))