Staging: hv: storvsc_drv: Get rid of some unnecessary DPRINTs
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / hv / storvsc_drv.c
index caa1f3655d2d8ed55018d4e166b9c003c2989110..07db877ff18125f4552e1f858dd313e1c4da82e6 100644 (file)
@@ -103,10 +103,6 @@ static int storvsc_initialize(struct hv_driver *driver)
                           sizeof(struct vstor_packet) + sizeof(u64),
                           sizeof(u64)));
 
-       DPRINT_INFO(STORVSC, "max io %u, currently %u\n",
-                   stor_driver->max_outstanding_req_per_channel,
-                   STORVSC_MAX_IO_REQUESTS);
-
 
        return 0;
 }
@@ -381,79 +377,25 @@ static int storvsc_remove(struct hv_device *dev)
 static int storvsc_get_chs(struct scsi_device *sdev, struct block_device * bdev,
                           sector_t capacity, int *info)
 {
-       sector_t total_sectors = capacity;
-       sector_t cylinder_times_heads = 0;
-       sector_t temp = 0;
-
-       int sectors_per_track = 0;
-       int heads = 0;
-       int cylinders = 0;
-       int rem = 0;
-
-       if (total_sectors > (65535 * 16 * 255))
-               total_sectors = (65535 * 16 * 255);
-
-       if (total_sectors >= (65535 * 16 * 63)) {
-               sectors_per_track = 255;
-               heads = 16;
-
-               cylinder_times_heads = total_sectors;
-               /* sector_div stores the quotient in cylinder_times_heads */
-               rem = sector_div(cylinder_times_heads, sectors_per_track);
-       } else {
-               sectors_per_track = 17;
-
-               cylinder_times_heads = total_sectors;
-               /* sector_div stores the quotient in cylinder_times_heads */
-               rem = sector_div(cylinder_times_heads, sectors_per_track);
-
-               temp = cylinder_times_heads + 1023;
-               /* sector_div stores the quotient in temp */
-               rem = sector_div(temp, 1024);
+       sector_t nsect = capacity;
+       sector_t cylinders = nsect;
+       int heads, sectors_pt;
 
-               heads = temp;
-
-               if (heads < 4)
-                       heads = 4;
-
-               if (cylinder_times_heads >= (heads * 1024) || (heads > 16)) {
-                       sectors_per_track = 31;
-                       heads = 16;
-
-                       cylinder_times_heads = total_sectors;
-                       /*
-                        * sector_div stores the quotient in
-                        * cylinder_times_heads
-                        */
-                       rem = sector_div(cylinder_times_heads,
-                                        sectors_per_track);
-               }
-
-               if (cylinder_times_heads >= (heads * 1024)) {
-                       sectors_per_track = 63;
-                       heads = 16;
-
-                       cylinder_times_heads = total_sectors;
-                       /*
-                        * sector_div stores the quotient in
-                        * cylinder_times_heads
-                        */
-                       rem = sector_div(cylinder_times_heads,
-                                        sectors_per_track);
-               }
-       }
-
-       temp = cylinder_times_heads;
-       /* sector_div stores the quotient in temp */
-       rem = sector_div(temp, heads);
-       cylinders = temp;
+       /*
+        * We are making up these values; let us keep it simple.
+        */
+       heads = 0xff;
+       sectors_pt = 0x3f;      /* Sectors per track */
+       sector_div(cylinders, heads * sectors_pt);
+       if ((sector_t)(cylinders + 1) * heads * sectors_pt < nsect)
+               cylinders = 0xffff;
 
        info[0] = heads;
-       info[1] = sectors_per_track;
-       info[2] = cylinders;
+       info[1] = sectors_pt;
+       info[2] = (int)cylinders;
 
-       DPRINT_INFO(STORVSC_DRV, "CHS (%d, %d, %d)", cylinders, heads,
-                   sectors_per_track);
+       DPRINT_INFO(STORVSC_DRV, "CHS (%d, %d, %d)", (int)cylinders, heads,
+                       sectors_pt);
 
        return 0;
 }
@@ -861,10 +803,6 @@ static int storvsc_drv_init(void)
        /* Callback to client driver to complete the initialization */
        storvsc_initialize(&storvsc_drv_obj->base);
 
-       DPRINT_INFO(STORVSC_DRV,
-                   "max outstanding reqs %u",
-                   storvsc_drv_obj->max_outstanding_req_per_channel);
-
        if (storvsc_drv_obj->max_outstanding_req_per_channel <
            STORVSC_MAX_IO_REQUESTS)
                return -1;
@@ -887,7 +825,6 @@ static int storvsc_drv_exit_cb(struct device *dev, void *data)
 
 static void storvsc_drv_exit(void)
 {
-       struct storvsc_driver *storvsc_drv_obj = &storvsc_drv;
        struct hv_driver *drv = &storvsc_drv.base;
        struct device *current_dev = NULL;
        int ret;
@@ -908,9 +845,6 @@ static void storvsc_drv_exit(void)
                device_unregister(current_dev);
        }
 
-       if (storvsc_drv_obj->base.cleanup)
-               storvsc_drv_obj->base.cleanup(&storvsc_drv_obj->base);
-
        vmbus_child_driver_unregister(&drv->driver);
        return;
 }