Commit 1916c835 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] fix return value for idedisk_*_max_address_* functions

From Andries.Brouwer@cwi.nl:

- these functions should return 0 not 1 on error
parent 4ffc562a
......@@ -964,8 +964,8 @@ static unsigned long idedisk_read_native_max_address(ide_drive_t *drive)
| ((args.tfRegister[ IDE_HCYL_OFFSET] ) << 16)
| ((args.tfRegister[ IDE_LCYL_OFFSET] ) << 8)
| ((args.tfRegister[IDE_SECTOR_OFFSET] ));
}
addr++; /* since the return value is (maxlba - 1), we add 1 */
}
return addr;
}
......@@ -992,8 +992,8 @@ static unsigned long long idedisk_read_native_max_address_ext(ide_drive_t *drive
((args.tfRegister[IDE_LCYL_OFFSET])<<8) |
(args.tfRegister[IDE_SECTOR_OFFSET]);
addr = ((__u64)high << 24) | low;
}
addr++; /* since the return value is (maxlba - 1), we add 1 */
}
return addr;
}
......@@ -1024,8 +1024,8 @@ static unsigned long idedisk_set_max_address(ide_drive_t *drive, unsigned long a
| ((args.tfRegister[ IDE_HCYL_OFFSET] ) << 16)
| ((args.tfRegister[ IDE_LCYL_OFFSET] ) << 8)
| ((args.tfRegister[IDE_SECTOR_OFFSET] ));
}
addr_set++;
}
return addr_set;
}
......@@ -1059,6 +1059,7 @@ static unsigned long long idedisk_set_max_address_ext(ide_drive_t *drive, unsign
((args.tfRegister[IDE_LCYL_OFFSET])<<8) |
(args.tfRegister[IDE_SECTOR_OFFSET]);
addr_set = ((__u64)high << 24) | low;
addr_set++;
}
return addr_set;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment