patch-2.4.27 linux-2.4.27/drivers/ide/ide-disk.c

Next file: linux-2.4.27/drivers/ide/ide.c
Previous file: linux-2.4.27/drivers/ide/Config.in
Back to the patch index
Back to the overall index

diff -urN linux-2.4.26/drivers/ide/ide-disk.c linux-2.4.27/drivers/ide/ide-disk.c
@@ -1161,15 +1161,15 @@
 {
 	struct hd_driveid *id = drive->id;
 	unsigned long capacity = drive->cyl * drive->head * drive->sect;
-	unsigned long set_max = idedisk_read_native_max_address(drive);
+	int have_setmax = idedisk_supports_host_protected_area(drive);
+	unsigned long set_max =
+		(have_setmax ? idedisk_read_native_max_address(drive) : 0);
 	unsigned long long capacity_2 = capacity;
 	unsigned long long set_max_ext;
 
 	drive->capacity48 = 0;
 	drive->select.b.lba = 0;
 
-	(void) idedisk_supports_host_protected_area(drive);
-
 	if (id->cfs_enable_2 & 0x0400) {
 		capacity_2 = id->lba_capacity_2;
 		drive->head		= drive->bios_head = 255;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)