hyperv: Remove extra allocated space for recv_pkt_list elements
authorHaiyang Zhang <haiyangz@microsoft.com>
Tue, 2 Oct 2012 05:30:22 +0000 (05:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2012 18:39:30 +0000 (14:39 -0400)
The receive code path doesn't use the page buffer, so remove the
extra allocated space here.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c

index 95ceb35930437be5103e23ac99b83becfdd669bc..d58f28c463862a4a5bf89fa1d014d6ff485eb9b5 100644 (file)
@@ -465,8 +465,6 @@ struct nvsp_message {
 
 #define NETVSC_RECEIVE_BUFFER_ID               0xcafe
 
-#define NETVSC_RECEIVE_SG_COUNT                        1
-
 /* Preallocated receive packets */
 #define NETVSC_RECEIVE_PACKETLIST_COUNT                256
 
index 4a1a5f58fa73ffd7899429bcaf28062e29f83dc3..d9c4c0399c88d9a9d6034f35cc67a1ba138a713c 100644 (file)
@@ -904,9 +904,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
        INIT_LIST_HEAD(&net_device->recv_pkt_list);
 
        for (i = 0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) {
-               packet = kzalloc(sizeof(struct hv_netvsc_packet) +
-                                (NETVSC_RECEIVE_SG_COUNT *
-                                 sizeof(struct hv_page_buffer)), GFP_KERNEL);
+               packet = kzalloc(sizeof(struct hv_netvsc_packet), GFP_KERNEL);
                if (!packet)
                        break;