mpt(4): Fix a porting mistake I did in 6d259fc1.
authorSascha Wildner <saw@online.de>
Tue, 7 Aug 2012 07:16:38 +0000 (09:16 +0200)
committerSascha Wildner <saw@online.de>
Tue, 7 Aug 2012 07:17:30 +0000 (09:17 +0200)
I left in both the code of the "#if __FreeBSD_version" as well as that of
its "#else". This caused the geometry to be calculated twice.

sys/dev/disk/mpt/mpt_cam.c

index 46a7700..bd8b108 100644 (file)
@@ -3931,24 +3931,6 @@ static void
 mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
 {
        cam_calc_geometry(ccg, extended);
 mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
 {
        cam_calc_geometry(ccg, extended);
-       uint32_t size_mb;
-       uint32_t secs_per_cylinder;
-
-       if (ccg->block_size == 0) {
-               ccg->ccb_h.status = CAM_REQ_INVALID;
-               return;
-       }
-       size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size);
-       if (size_mb > 1024 && extended) {
-               ccg->heads = 255;
-               ccg->secs_per_track = 63;
-       } else {
-               ccg->heads = 64;
-               ccg->secs_per_track = 32;
-       }
-       secs_per_cylinder = ccg->heads * ccg->secs_per_track;
-       ccg->cylinders = ccg->volume_size / secs_per_cylinder;
-       ccg->ccb_h.status = CAM_REQ_CMP;
 }
 
 /****************************** Timeout Recovery ******************************/
 }
 
 /****************************** Timeout Recovery ******************************/