Commit 5e081c91 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Get rid of dead code in storvsc.c

Get rid of some "dead code" from storvsc.c
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent afa3f3d7
...@@ -65,7 +65,6 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device) ...@@ -65,7 +65,6 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
static inline void free_stor_device(struct storvsc_device *device) static inline void free_stor_device(struct storvsc_device *device)
{ {
/* ASSERT(atomic_read(&device->ref_count) == 0); */
kfree(device); kfree(device);
} }
...@@ -103,10 +102,8 @@ static inline void put_stor_device(struct hv_device *device) ...@@ -103,10 +102,8 @@ static inline void put_stor_device(struct hv_device *device)
struct storvsc_device *stor_device; struct storvsc_device *stor_device;
stor_device = (struct storvsc_device *)device->ext; stor_device = (struct storvsc_device *)device->ext;
/* ASSERT(stor_device); */
atomic_dec(&stor_device->ref_count); atomic_dec(&stor_device->ref_count);
/* ASSERT(atomic_read(&stor_device->ref_count)); */
} }
/* Drop ref count to 1 to effectively disable get_stor_device() */ /* Drop ref count to 1 to effectively disable get_stor_device() */
...@@ -116,7 +113,6 @@ static inline struct storvsc_device *release_stor_device( ...@@ -116,7 +113,6 @@ static inline struct storvsc_device *release_stor_device(
struct storvsc_device *stor_device; struct storvsc_device *stor_device;
stor_device = (struct storvsc_device *)device->ext; stor_device = (struct storvsc_device *)device->ext;
/* ASSERT(stor_device); */
/* Busy wait until the ref drop to 2, then set it to 1 */ /* Busy wait until the ref drop to 2, then set it to 1 */
while (atomic_cmpxchg(&stor_device->ref_count, 2, 1) != 2) while (atomic_cmpxchg(&stor_device->ref_count, 2, 1) != 2)
...@@ -132,7 +128,6 @@ static inline struct storvsc_device *final_release_stor_device( ...@@ -132,7 +128,6 @@ static inline struct storvsc_device *final_release_stor_device(
struct storvsc_device *stor_device; struct storvsc_device *stor_device;
stor_device = (struct storvsc_device *)device->ext; stor_device = (struct storvsc_device *)device->ext;
/* ASSERT(stor_device); */
/* Busy wait until the ref drop to 1, then set it to 0 */ /* Busy wait until the ref drop to 1, then set it to 0 */
while (atomic_cmpxchg(&stor_device->ref_count, 1, 0) != 1) while (atomic_cmpxchg(&stor_device->ref_count, 1, 0) != 1)
...@@ -341,12 +336,8 @@ static void stor_vsc_on_io_completion(struct hv_device *device, ...@@ -341,12 +336,8 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
"completed bytes xfer %u", request_ext, "completed bytes xfer %u", request_ext,
vstor_packet->vm_srb.data_transfer_length); vstor_packet->vm_srb.data_transfer_length);
/* ASSERT(request_ext != NULL); */
/* ASSERT(request_ext->request != NULL); */
request = request_ext->request; request = request_ext->request;
/* ASSERT(request->OnIOCompletion != NULL); */
/* Copy over the status...etc */ /* Copy over the status...etc */
request->status = vstor_packet->vm_srb.scsi_status; request->status = vstor_packet->vm_srb.scsi_status;
...@@ -366,8 +357,6 @@ static void stor_vsc_on_io_completion(struct hv_device *device, ...@@ -366,8 +357,6 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
"valid - len %d\n", request_ext, "valid - len %d\n", request_ext,
vstor_packet->vm_srb.sense_info_length); vstor_packet->vm_srb.sense_info_length);
/* ASSERT(vstor_packet->vm_srb.sense_info_length <= */
/* request->SenseBufferSize); */
memcpy(request->sense_buffer, memcpy(request->sense_buffer,
vstor_packet->vm_srb.sense_data, vstor_packet->vm_srb.sense_data,
vstor_packet->vm_srb.sense_info_length); vstor_packet->vm_srb.sense_info_length);
...@@ -418,7 +407,6 @@ static void stor_vsc_on_channel_callback(void *context) ...@@ -418,7 +407,6 @@ static void stor_vsc_on_channel_callback(void *context)
struct storvsc_request_extension *request; struct storvsc_request_extension *request;
int ret; int ret;
/* ASSERT(device); */
stor_device = must_get_stor_device(device); stor_device = must_get_stor_device(device);
if (!stor_device) { if (!stor_device) {
...@@ -435,21 +423,12 @@ static void stor_vsc_on_channel_callback(void *context) ...@@ -435,21 +423,12 @@ static void stor_vsc_on_channel_callback(void *context)
DPRINT_DBG(STORVSC, "receive %d bytes - tid %llx", DPRINT_DBG(STORVSC, "receive %d bytes - tid %llx",
bytes_recvd, request_id); bytes_recvd, request_id);
/* ASSERT(bytes_recvd ==
sizeof(struct vstor_packet)); */
request = (struct storvsc_request_extension *) request = (struct storvsc_request_extension *)
(unsigned long)request_id; (unsigned long)request_id;
/* ASSERT(request);c */
/* if (vstor_packet.Flags & SYNTHETIC_FLAG) */
if ((request == &stor_device->init_request) || if ((request == &stor_device->init_request) ||
(request == &stor_device->reset_request)) { (request == &stor_device->reset_request)) {
/* DPRINT_INFO(STORVSC,
* "reset completion - operation "
* "%u status %u",
* vstor_packet.Operation,
* vstor_packet.Status); */
memcpy(&request->vstor_packet, packet, memcpy(&request->vstor_packet, packet,
sizeof(struct vstor_packet)); sizeof(struct vstor_packet));
...@@ -461,7 +440,6 @@ static void stor_vsc_on_channel_callback(void *context) ...@@ -461,7 +440,6 @@ static void stor_vsc_on_channel_callback(void *context)
request); request);
} }
} else { } else {
/* DPRINT_DBG(STORVSC, "nothing else to read..."); */
break; break;
} }
} while (1); } while (1);
...@@ -508,7 +486,6 @@ int stor_vsc_on_device_add(struct hv_device *device, ...@@ -508,7 +486,6 @@ int stor_vsc_on_device_add(struct hv_device *device,
void *additional_info) void *additional_info)
{ {
struct storvsc_device *stor_device; struct storvsc_device *stor_device;
/* struct vmstorage_channel_properties *props; */
struct storvsc_device_info *device_info; struct storvsc_device_info *device_info;
int ret = 0; int ret = 0;
...@@ -520,8 +497,6 @@ int stor_vsc_on_device_add(struct hv_device *device, ...@@ -520,8 +497,6 @@ int stor_vsc_on_device_add(struct hv_device *device,
} }
/* Save the channel properties to our storvsc channel */ /* Save the channel properties to our storvsc channel */
/* props = (struct vmstorage_channel_properties *)
* channel->offerMsg.Offer.u.Standard.UserDefined; */
/* FIXME: */ /* FIXME: */
/* /*
...@@ -530,15 +505,10 @@ int stor_vsc_on_device_add(struct hv_device *device, ...@@ -530,15 +505,10 @@ int stor_vsc_on_device_add(struct hv_device *device,
* scsi channel prior to the bus scan * scsi channel prior to the bus scan
*/ */
/* storChannel->PortNumber = 0;
storChannel->PathId = props->PathId;
storChannel->TargetId = props->TargetId; */
stor_device->port_number = device_info->port_number; stor_device->port_number = device_info->port_number;
/* Send it back up */ /* Send it back up */
ret = stor_vsc_connect_to_vsp(device); ret = stor_vsc_connect_to_vsp(device);
/* device_info->PortNumber = stor_device->PortNumber; */
device_info->path_id = stor_device->path_id; device_info->path_id = stor_device->path_id;
device_info->target_id = stor_device->target_id; device_info->target_id = stor_device->target_id;
...@@ -673,8 +643,6 @@ int stor_vsc_on_io_request(struct hv_device *device, ...@@ -673,8 +643,6 @@ int stor_vsc_on_io_request(struct hv_device *device,
return -2; return -2;
} }
/* print_hex_dump_bytes("", DUMP_PREFIX_NONE, request->Cdb,
* request->CdbLen); */
request_extension->request = request; request_extension->request = request;
request_extension->device = device; request_extension->device = device;
...@@ -762,7 +730,6 @@ int stor_vsc_initialize(struct hv_driver *driver) ...@@ -762,7 +730,6 @@ int stor_vsc_initialize(struct hv_driver *driver)
sizeof(struct vmscsi_request)); sizeof(struct vmscsi_request));
/* Make sure we are at least 2 pages since 1 page is used for control */ /* Make sure we are at least 2 pages since 1 page is used for control */
/* ASSERT(stor_driver->RingBufferSize >= (PAGE_SIZE << 1)); */
driver->name = g_driver_name; driver->name = g_driver_name;
memcpy(&driver->dev_type, &gStorVscDeviceType, memcpy(&driver->dev_type, &gStorVscDeviceType,
......
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