Haiyang Zhang
2011-Feb-14 22:51 UTC
[PATCH 1/2] staging: hv: Remove dead code from netvsc.c
Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> --- drivers/staging/hv/netvsc.c | 34 ---------------------------------- 1 files changed, 0 insertions(+), 34 deletions(-) diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index fa46a7e..8c6d4ae 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c @@ -134,7 +134,6 @@ static void put_net_device(struct hv_device *device) struct netvsc_device *net_device; net_device = device->ext; - /* ASSERT(netDevice); */ atomic_dec(&net_device->refcnt); } @@ -186,9 +185,6 @@ int netvsc_initialize(struct hv_driver *drv) sizeof(struct nvsp_message), sizeof(struct vmtransfer_page_packet_header)); - /* Make sure we are at least 2 pages since 1 page is used for control */ - /* ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1)); */ - drv->name = driver_name; memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid)); @@ -220,9 +216,6 @@ static int netvsc_init_recv_buf(struct hv_device *device) "device being destroyed?"); return -1; } - /* ASSERT(netDevice->ReceiveBufferSize > 0); */ - /* page-size grandularity */ - /* ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE - 1)) == 0); */ net_device->recv_buf (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, @@ -234,9 +227,6 @@ static int netvsc_init_recv_buf(struct hv_device *device) ret = -1; goto cleanup; } - /* page-aligned buffer */ - /* ASSERT(((unsigned long)netDevice->ReceiveBuffer & (PAGE_SIZE - 1)) == */ - /* 0); */ DPRINT_INFO(NETVSC, "Establishing receive buffer's GPADL..."); @@ -299,8 +289,6 @@ static int netvsc_init_recv_buf(struct hv_device *device) } /* Parse the response */ - /* ASSERT(netDevice->ReceiveSectionCount == 0); */ - /* ASSERT(netDevice->ReceiveSections == NULL); */ net_device->recv_section_cnt = init_packet->msg. v1_msg.send_recv_buf_complete.num_sections; @@ -363,9 +351,6 @@ static int netvsc_init_send_buf(struct hv_device *device) goto cleanup; } - /* page-size grandularity */ - /* ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0); */ - net_device->send_buf (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, get_order(net_device->send_buf_size)); @@ -375,8 +360,6 @@ static int netvsc_init_send_buf(struct hv_device *device) ret = -1; goto cleanup; } - /* page-aligned buffer */ - /* ASSERT(((unsigned long)netDevice->SendBuffer & (PAGE_SIZE - 1)) == 0); */ DPRINT_INFO(NETVSC, "Establishing send buffer's GPADL..."); @@ -639,8 +622,6 @@ static int netvsc_connect_vsp(struct hv_device *device) goto cleanup; } - /* Now, check the response */ - /* ASSERT(initPacket->Messages.InitMessages.InitComplete.MaximumMdlChainLength <= MAX_MULTIPAGE_BUFFER_COUNT); */ DPRINT_INFO(NETVSC, "NvspMessageTypeInit status(%d) max mdl chain (%d)", init_packet->msg.init_msg.init_complete.status, init_packet->msg.init_msg. @@ -895,7 +876,6 @@ static void netvsc_send_completion(struct hv_device *device, /* Get the send context */ nvsc_packet = (struct hv_netvsc_packet *)(unsigned long) packet->trans_id; - /* ASSERT(nvscPacket); */ /* Notify the layer above us */ nvsc_packet->completion.send.send_completion( @@ -1072,8 +1052,6 @@ static void netvsc_receive(struct hv_device *device, /* This is how much we can satisfy */ xferpage_packet->count = count - 1; - /* ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= */ - /* vmxferpagePacket->RangeCount); */ if (xferpage_packet->count != vmxferpage_packet->range_cnt) { DPRINT_INFO(NETVSC, "Needed %d netvsc pkts to satisy this xfer " @@ -1101,10 +1079,6 @@ static void netvsc_receive(struct hv_device *device, vmxferpage_packet->ranges[i].byte_count; netvsc_packet->page_buf_cnt = 1; - /* ASSERT(vmxferpagePacket->Ranges[i].ByteOffset + */ - /* vmxferpagePacket->Ranges[i].ByteCount < */ - /* netDevice->ReceiveBufferSize); */ - netvsc_packet->page_buf[0].len vmxferpage_packet->ranges[i].byte_count; @@ -1147,7 +1121,6 @@ static void netvsc_receive(struct hv_device *device, if (bytes_remain == 0) break; } - /* ASSERT(bytesRemain == 0); */ } DPRINT_DBG(NETVSC, "[%d] - (abs offset %u len %u) => " "(pfn %llx, offset %u, len %u)", i, @@ -1165,8 +1138,6 @@ static void netvsc_receive(struct hv_device *device, completion.recv.recv_completion_ctx); } - /* ASSERT(list_empty(&listHead)); */ - put_net_device(device); } @@ -1225,8 +1196,6 @@ static void netvsc_receive_completion(void *context) bool fsend_receive_comp = false; unsigned long flags; - /* ASSERT(packet->XferPagePacket); */ - /* * Even though it seems logical to do a GetOutboundNetDevice() here to * send out receive completion, we are using GetInboundNetDevice() @@ -1242,7 +1211,6 @@ static void netvsc_receive_completion(void *context) /* Overloading use of the lock. */ spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags); - /* ASSERT(packet->XferPagePacket->Count > 0); */ packet->xfer_page_pkt->count--; /* @@ -1280,8 +1248,6 @@ static void netvsc_channel_cb(void *context) unsigned char *buffer; int bufferlen = NETVSC_PACKET_SIZE; - /* ASSERT(device); */ - packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), GFP_ATOMIC); if (!packet) -- 1.6.3.2
Haiyang Zhang
2011-Feb-14 22:51 UTC
[PATCH 2/2] staging: hv: Remove dead code from rndis_filter.c
Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> --- drivers/staging/hv/rndis_filter.c | 15 --------------- 1 files changed, 0 insertions(+), 15 deletions(-) diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c index 9dde936..e7189cd 100644 --- a/drivers/staging/hv/rndis_filter.c +++ b/drivers/staging/hv/rndis_filter.c @@ -355,10 +355,6 @@ static void rndis_filter_receive_data(struct rndis_device *dev, struct rndis_packet *rndis_pkt; u32 data_offset; - /* empty ethernet frame ?? */ - /* ASSERT(Packet->PageBuffers[0].Length > */ - /* RNDIS_MESSAGE_SIZE(struct rndis_packet)); */ - rndis_pkt = &msg->msg.pkt; /* @@ -455,8 +451,6 @@ static int rndis_filter_receive(struct hv_device *dev, case REMOTE_NDIS_INITIALIZE_CMPLT: case REMOTE_NDIS_QUERY_CMPLT: case REMOTE_NDIS_SET_CMPLT: - /* case REMOTE_NDIS_RESET_CMPLT: */ - /* case REMOTE_NDIS_KEEPALIVE_CMPLT: */ /* completion msgs */ rndis_filter_receive_response(rndis_dev, &rndis_msg); break; @@ -563,9 +557,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 status; int ret; - /* ASSERT(RNDIS_MESSAGE_SIZE(struct rndis_set_request) + sizeof(u32) <= */ - /* sizeof(struct rndis_message)); */ - request = get_rndis_request(dev, REMOTE_NDIS_SET_MSG, RNDIS_MESSAGE_SIZE(struct rndis_set_request) + sizeof(u32)); @@ -634,8 +625,6 @@ int rndis_filter_init(struct netvsc_driver *drv) drv->base.dev_rm; rndis_filter.inner_drv.base.cleanup = drv->base.cleanup; - /* ASSERT(Driver->OnSend); */ - /* ASSERT(Driver->OnReceiveCallback); */ rndis_filter.inner_drv.send = drv->send; rndis_filter.inner_drv.recv_cb = drv->recv_cb; rndis_filter.inner_drv.link_status_change @@ -646,7 +635,6 @@ int rndis_filter_init(struct netvsc_driver *drv) drv->base.dev_rm = rndis_filter_device_remove; drv->base.cleanup = rndis_filter_cleanup; drv->send = rndis_filter_send; - /* Driver->QueryLinkStatus = RndisFilterQueryDeviceLinkStatus; */ drv->recv_cb = rndis_filter_receive; return 0; @@ -793,8 +781,6 @@ static int rndis_filte_device_add(struct hv_device *dev, /* Initialize the rndis device */ netDevice = dev->ext; - /* ASSERT(netDevice); */ - /* ASSERT(netDevice->Device); */ netDevice->extension = rndisDevice; rndisDevice->net_dev = netDevice; @@ -882,7 +868,6 @@ static int rndis_filter_send(struct hv_device *dev, /* Add the rndis header */ filterPacket = (struct rndis_filter_packet *)pkt->extension; - /* ASSERT(filterPacket); */ memset(filterPacket, 0, sizeof(struct rndis_filter_packet)); -- 1.6.3.2
On Mon, 14 Feb 2011, Haiyang Zhang wrote:> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> > Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> > --- > drivers/staging/hv/netvsc.c | 34 ---------------------------------- > 1 files changed, 0 insertions(+), 34 deletions(-) >... Reviewed-by: Jesper Juhl <jj at chaosbits.net> -- Jesper Juhl <jj at chaosbits.net> http://www.chaosbits.net/ Plain text mails only, please. Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Maybe Matching Threads
- [PATCH 1/2] staging: hv: Remove dead code from netvsc.c
- [PATCH 1/7] staging: hv: Convert camel cased variables in netvsc.c to lower cases
- [PATCH 1/7] staging: hv: Convert camel cased variables in netvsc.c to lower cases
- [PATCH 1/5] staging: hv: fix some white spaces in netvsc driver
- [PATCH 1/5] staging: hv: fix some white spaces in netvsc driver