mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
staging: hv: remove ASSERT()s
These ASSERT()s serve no purpose other than for debugging. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hank Janssen <hjanssen@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a3810b0ef6
commit
972b9529cc
3 changed files with 26 additions and 27 deletions
|
@ -78,7 +78,7 @@ int BlkVscInitialize(struct hv_driver *Driver)
|
||||||
storDriver = (struct storvsc_driver_object *)Driver;
|
storDriver = (struct storvsc_driver_object *)Driver;
|
||||||
|
|
||||||
/* 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(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
|
/* ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); */
|
||||||
|
|
||||||
Driver->name = gBlkDriverName;
|
Driver->name = gBlkDriverName;
|
||||||
memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(struct hv_guid));
|
memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(struct hv_guid));
|
||||||
|
|
|
@ -254,7 +254,7 @@ static void VmbusProcessChannelEvent(void *context)
|
||||||
struct vmbus_channel *channel;
|
struct vmbus_channel *channel;
|
||||||
u32 relId = (u32)(unsigned long)context;
|
u32 relId = (u32)(unsigned long)context;
|
||||||
|
|
||||||
ASSERT(relId > 0);
|
/* ASSERT(relId > 0); */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the channel based on this relid and invokes the
|
* Find the channel based on this relid and invokes the
|
||||||
|
|
|
@ -131,7 +131,7 @@ static void PutNetDevice(struct hv_device *Device)
|
||||||
struct netvsc_device *netDevice;
|
struct netvsc_device *netDevice;
|
||||||
|
|
||||||
netDevice = Device->Extension;
|
netDevice = Device->Extension;
|
||||||
ASSERT(netDevice);
|
/* ASSERT(netDevice); */
|
||||||
|
|
||||||
atomic_dec(&netDevice->RefCount);
|
atomic_dec(&netDevice->RefCount);
|
||||||
}
|
}
|
||||||
|
@ -184,14 +184,15 @@ int NetVscInitialize(struct hv_driver *drv)
|
||||||
sizeof(struct vmtransfer_page_packet_header));
|
sizeof(struct vmtransfer_page_packet_header));
|
||||||
|
|
||||||
/* 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(driver->RingBufferSize >= (PAGE_SIZE << 1));
|
/* ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1)); */
|
||||||
|
|
||||||
drv->name = gDriverName;
|
drv->name = gDriverName;
|
||||||
memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(struct hv_guid));
|
memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(struct hv_guid));
|
||||||
|
|
||||||
/* Make sure it is set by the caller */
|
/* Make sure it is set by the caller */
|
||||||
ASSERT(driver->OnReceiveCallback);
|
/* FIXME: These probably should still be tested in some way */
|
||||||
ASSERT(driver->OnLinkStatusChanged);
|
/* ASSERT(driver->OnReceiveCallback); */
|
||||||
|
/* ASSERT(driver->OnLinkStatusChanged); */
|
||||||
|
|
||||||
/* Setup the dispatch table */
|
/* Setup the dispatch table */
|
||||||
driver->Base.OnDeviceAdd = NetVscOnDeviceAdd;
|
driver->Base.OnDeviceAdd = NetVscOnDeviceAdd;
|
||||||
|
@ -222,9 +223,9 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *Device)
|
||||||
DPRINT_EXIT(NETVSC);
|
DPRINT_EXIT(NETVSC);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ASSERT(netDevice->ReceiveBufferSize > 0);
|
/* ASSERT(netDevice->ReceiveBufferSize > 0); */
|
||||||
/* page-size grandularity */
|
/* page-size grandularity */
|
||||||
ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE - 1)) == 0);
|
/* ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE - 1)) == 0); */
|
||||||
|
|
||||||
netDevice->ReceiveBuffer =
|
netDevice->ReceiveBuffer =
|
||||||
osd_PageAlloc(netDevice->ReceiveBufferSize >> PAGE_SHIFT);
|
osd_PageAlloc(netDevice->ReceiveBufferSize >> PAGE_SHIFT);
|
||||||
|
@ -236,8 +237,8 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *Device)
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
/* page-aligned buffer */
|
/* page-aligned buffer */
|
||||||
ASSERT(((unsigned long)netDevice->ReceiveBuffer & (PAGE_SIZE - 1)) ==
|
/* ASSERT(((unsigned long)netDevice->ReceiveBuffer & (PAGE_SIZE - 1)) == */
|
||||||
0);
|
/* 0); */
|
||||||
|
|
||||||
DPRINT_INFO(NETVSC, "Establishing receive buffer's GPADL...");
|
DPRINT_INFO(NETVSC, "Establishing receive buffer's GPADL...");
|
||||||
|
|
||||||
|
@ -294,8 +295,8 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *Device)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the response */
|
/* Parse the response */
|
||||||
ASSERT(netDevice->ReceiveSectionCount == 0);
|
/* ASSERT(netDevice->ReceiveSectionCount == 0); */
|
||||||
ASSERT(netDevice->ReceiveSections == NULL);
|
/* ASSERT(netDevice->ReceiveSections == NULL); */
|
||||||
|
|
||||||
netDevice->ReceiveSectionCount = initPacket->Messages.Version1Messages.SendReceiveBufferComplete.NumSections;
|
netDevice->ReceiveSectionCount = initPacket->Messages.Version1Messages.SendReceiveBufferComplete.NumSections;
|
||||||
|
|
||||||
|
@ -355,7 +356,7 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *Device)
|
||||||
}
|
}
|
||||||
ASSERT(netDevice->SendBufferSize > 0);
|
ASSERT(netDevice->SendBufferSize > 0);
|
||||||
/* page-size grandularity */
|
/* page-size grandularity */
|
||||||
ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0);
|
/* ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0); */
|
||||||
|
|
||||||
netDevice->SendBuffer =
|
netDevice->SendBuffer =
|
||||||
osd_PageAlloc(netDevice->SendBufferSize >> PAGE_SHIFT);
|
osd_PageAlloc(netDevice->SendBufferSize >> PAGE_SHIFT);
|
||||||
|
@ -366,7 +367,7 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *Device)
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
/* page-aligned buffer */
|
/* page-aligned buffer */
|
||||||
ASSERT(((unsigned long)netDevice->SendBuffer & (PAGE_SIZE - 1)) == 0);
|
/* ASSERT(((unsigned long)netDevice->SendBuffer & (PAGE_SIZE - 1)) == 0); */
|
||||||
|
|
||||||
DPRINT_INFO(NETVSC, "Establishing send buffer's GPADL...");
|
DPRINT_INFO(NETVSC, "Establishing send buffer's GPADL...");
|
||||||
|
|
||||||
|
@ -912,7 +913,7 @@ static void NetVscOnSendCompletion(struct hv_device *Device,
|
||||||
NvspMessage1TypeSendRNDISPacketComplete) {
|
NvspMessage1TypeSendRNDISPacketComplete) {
|
||||||
/* Get the send context */
|
/* Get the send context */
|
||||||
nvscPacket = (struct hv_netvsc_packet *)(unsigned long)Packet->TransactionId;
|
nvscPacket = (struct hv_netvsc_packet *)(unsigned long)Packet->TransactionId;
|
||||||
ASSERT(nvscPacket);
|
/* ASSERT(nvscPacket); */
|
||||||
|
|
||||||
/* Notify the layer above us */
|
/* Notify the layer above us */
|
||||||
nvscPacket->Completion.Send.OnSendCompletion(nvscPacket->Completion.Send.SendCompletionContext);
|
nvscPacket->Completion.Send.OnSendCompletion(nvscPacket->Completion.Send.SendCompletionContext);
|
||||||
|
@ -1096,8 +1097,8 @@ static void NetVscOnReceive(struct hv_device *Device,
|
||||||
|
|
||||||
/* This is how much we can satisfy */
|
/* This is how much we can satisfy */
|
||||||
xferpagePacket->Count = count - 1;
|
xferpagePacket->Count = count - 1;
|
||||||
ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <=
|
/* ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= */
|
||||||
vmxferpagePacket->RangeCount);
|
/* vmxferpagePacket->RangeCount); */
|
||||||
|
|
||||||
if (xferpagePacket->Count != vmxferpagePacket->RangeCount) {
|
if (xferpagePacket->Count != vmxferpagePacket->RangeCount) {
|
||||||
DPRINT_INFO(NETVSC, "Needed %d netvsc pkts to satisy this xfer "
|
DPRINT_INFO(NETVSC, "Needed %d netvsc pkts to satisy this xfer "
|
||||||
|
@ -1125,9 +1126,9 @@ static void NetVscOnReceive(struct hv_device *Device,
|
||||||
vmxferpagePacket->Ranges[i].ByteCount;
|
vmxferpagePacket->Ranges[i].ByteCount;
|
||||||
netvscPacket->PageBufferCount = 1;
|
netvscPacket->PageBufferCount = 1;
|
||||||
|
|
||||||
ASSERT(vmxferpagePacket->Ranges[i].ByteOffset +
|
/* ASSERT(vmxferpagePacket->Ranges[i].ByteOffset + */
|
||||||
vmxferpagePacket->Ranges[i].ByteCount <
|
/* vmxferpagePacket->Ranges[i].ByteCount < */
|
||||||
netDevice->ReceiveBufferSize);
|
/* netDevice->ReceiveBufferSize); */
|
||||||
|
|
||||||
netvscPacket->PageBuffers[0].Length =
|
netvscPacket->PageBuffers[0].Length =
|
||||||
vmxferpagePacket->Ranges[i].ByteCount;
|
vmxferpagePacket->Ranges[i].ByteCount;
|
||||||
|
@ -1165,7 +1166,7 @@ static void NetVscOnReceive(struct hv_device *Device,
|
||||||
if (bytesRemain == 0)
|
if (bytesRemain == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ASSERT(bytesRemain == 0);
|
/* ASSERT(bytesRemain == 0); */
|
||||||
}
|
}
|
||||||
DPRINT_DBG(NETVSC, "[%d] - (abs offset %u len %u) => "
|
DPRINT_DBG(NETVSC, "[%d] - (abs offset %u len %u) => "
|
||||||
"(pfn %llx, offset %u, len %u)", i,
|
"(pfn %llx, offset %u, len %u)", i,
|
||||||
|
@ -1181,7 +1182,7 @@ static void NetVscOnReceive(struct hv_device *Device,
|
||||||
NetVscOnReceiveCompletion(netvscPacket->Completion.Recv.ReceiveCompletionContext);
|
NetVscOnReceiveCompletion(netvscPacket->Completion.Recv.ReceiveCompletionContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(list_empty(&listHead));
|
/* ASSERT(list_empty(&listHead)); */
|
||||||
|
|
||||||
PutNetDevice(Device);
|
PutNetDevice(Device);
|
||||||
DPRINT_EXIT(NETVSC);
|
DPRINT_EXIT(NETVSC);
|
||||||
|
@ -1245,7 +1246,7 @@ static void NetVscOnReceiveCompletion(void *Context)
|
||||||
|
|
||||||
DPRINT_ENTER(NETVSC);
|
DPRINT_ENTER(NETVSC);
|
||||||
|
|
||||||
ASSERT(packet->XferPagePacket);
|
/* ASSERT(packet->XferPagePacket); */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Even though it seems logical to do a GetOutboundNetDevice() here to
|
* Even though it seems logical to do a GetOutboundNetDevice() here to
|
||||||
|
@ -1263,7 +1264,7 @@ static void NetVscOnReceiveCompletion(void *Context)
|
||||||
/* Overloading use of the lock. */
|
/* Overloading use of the lock. */
|
||||||
spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
|
spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
|
||||||
|
|
||||||
ASSERT(packet->XferPagePacket->Count > 0);
|
/* ASSERT(packet->XferPagePacket->Count > 0); */
|
||||||
packet->XferPagePacket->Count--;
|
packet->XferPagePacket->Count--;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1305,7 +1306,7 @@ static void NetVscOnChannelCallback(void *Context)
|
||||||
|
|
||||||
DPRINT_ENTER(NETVSC);
|
DPRINT_ENTER(NETVSC);
|
||||||
|
|
||||||
ASSERT(device);
|
/* ASSERT(device); */
|
||||||
|
|
||||||
packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
|
packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
@ -1377,8 +1378,6 @@ static void NetVscOnChannelCallback(void *Context)
|
||||||
}
|
}
|
||||||
|
|
||||||
bufferlen = bytesRecvd;
|
bufferlen = bytesRecvd;
|
||||||
} else {
|
|
||||||
ASSERT(0);
|
|
||||||
}
|
}
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue