Commit e276a3a5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: osd: remove MemAllocZeroed wrapper

Use the "real" kzalloc call instead of a wrapper function.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e40d37cc
...@@ -226,7 +226,7 @@ VmbusChannelOpen( ...@@ -226,7 +226,7 @@ VmbusChannelOpen(
// Allocate the ring buffer // Allocate the ring buffer
out = PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT); out = PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT);
//out = MemAllocZeroed(sendRingBufferSize + recvRingBufferSize); //out = kzalloc(sendRingBufferSize + recvRingBufferSize, GFP_KERNEL);
ASSERT(out); ASSERT(out);
ASSERT(((unsigned long)out & (PAGE_SIZE-1)) == 0); ASSERT(((unsigned long)out & (PAGE_SIZE-1)) == 0);
...@@ -421,7 +421,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -421,7 +421,7 @@ VmbusChannelCreateGpadlHeader(
{ {
// fill in the header // fill in the header
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64); msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64);
msgHeader = MemAllocZeroed(msgSize); msgHeader = kzalloc(msgSize, GFP_KERNEL);
INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList); INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList);
msgHeader->MessageSize=msgSize; msgHeader->MessageSize=msgSize;
...@@ -458,7 +458,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -458,7 +458,7 @@ VmbusChannelCreateGpadlHeader(
} }
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64); msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64);
msgBody = MemAllocZeroed(msgSize); msgBody = kzalloc(msgSize, GFP_KERNEL);
ASSERT(msgBody); ASSERT(msgBody);
msgBody->MessageSize = msgSize; msgBody->MessageSize = msgSize;
(*MessageCount)++; (*MessageCount)++;
...@@ -481,7 +481,7 @@ VmbusChannelCreateGpadlHeader( ...@@ -481,7 +481,7 @@ VmbusChannelCreateGpadlHeader(
{ {
// everything fits in a header // everything fits in a header
msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64); msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64);
msgHeader = MemAllocZeroed(msgSize); msgHeader = kzalloc(msgSize, GFP_KERNEL);
msgHeader->MessageSize=msgSize; msgHeader->MessageSize=msgSize;
gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg; gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg;
......
...@@ -89,7 +89,7 @@ VmbusConnect( ...@@ -89,7 +89,7 @@ VmbusConnect(
goto Cleanup; goto Cleanup;
} }
msgInfo = (VMBUS_CHANNEL_MSGINFO*)MemAllocZeroed(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT)); msgInfo = kzalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_INITIATE_CONTACT), GFP_KERNEL);
if (msgInfo == NULL) if (msgInfo == NULL)
{ {
ret = -1; ret = -1;
...@@ -207,7 +207,7 @@ VmbusDisconnect( ...@@ -207,7 +207,7 @@ VmbusDisconnect(
if (gVmbusConnection.ConnectState != Connected) if (gVmbusConnection.ConnectState != Connected)
return -1; return -1;
msg = MemAllocZeroed(sizeof(VMBUS_CHANNEL_UNLOAD)); msg = kzalloc(sizeof(VMBUS_CHANNEL_UNLOAD), GFP_KERNEL);
msg->MessageType = ChannelMessageUnload; msg->MessageType = ChannelMessageUnload;
......
...@@ -122,7 +122,7 @@ static inline NETVSC_DEVICE* AllocNetDevice(DEVICE_OBJECT *Device) ...@@ -122,7 +122,7 @@ static inline NETVSC_DEVICE* AllocNetDevice(DEVICE_OBJECT *Device)
{ {
NETVSC_DEVICE *netDevice; NETVSC_DEVICE *netDevice;
netDevice = MemAllocZeroed(sizeof(NETVSC_DEVICE)); netDevice = kzalloc(sizeof(NETVSC_DEVICE), GFP_KERNEL);
if (!netDevice) if (!netDevice)
return NULL; return NULL;
...@@ -815,7 +815,7 @@ NetVscOnDeviceAdd( ...@@ -815,7 +815,7 @@ NetVscOnDeviceAdd(
for (i=0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) for (i=0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++)
{ {
packet = MemAllocZeroed(sizeof(NETVSC_PACKET) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER))); packet = kzalloc(sizeof(NETVSC_PACKET) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER)), GFP_KERNEL);
if (!packet) if (!packet)
{ {
DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts for receive pool (wanted %d got %d)", NETVSC_RECEIVE_PACKETLIST_COUNT, i); DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts for receive pool (wanted %d got %d)", NETVSC_RECEIVE_PACKETLIST_COUNT, i);
......
...@@ -210,7 +210,7 @@ static inline RNDIS_DEVICE* GetRndisDevice(void) ...@@ -210,7 +210,7 @@ static inline RNDIS_DEVICE* GetRndisDevice(void)
{ {
RNDIS_DEVICE *device; RNDIS_DEVICE *device;
device = MemAllocZeroed(sizeof(RNDIS_DEVICE)); device = kzalloc(sizeof(RNDIS_DEVICE), GFP_KERNEL);
if (!device) if (!device)
{ {
return NULL; return NULL;
...@@ -242,7 +242,7 @@ static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageTy ...@@ -242,7 +242,7 @@ static inline RNDIS_REQUEST* GetRndisRequest(RNDIS_DEVICE *Device, u32 MessageTy
RNDIS_MESSAGE *rndisMessage; RNDIS_MESSAGE *rndisMessage;
RNDIS_SET_REQUEST *set; RNDIS_SET_REQUEST *set;
request = MemAllocZeroed(sizeof(RNDIS_REQUEST)); request = kzalloc(sizeof(RNDIS_REQUEST), GFP_KERNEL);
if (!request) if (!request)
{ {
return NULL; return NULL;
......
...@@ -147,7 +147,7 @@ static inline STORVSC_DEVICE* AllocStorDevice(DEVICE_OBJECT *Device) ...@@ -147,7 +147,7 @@ static inline STORVSC_DEVICE* AllocStorDevice(DEVICE_OBJECT *Device)
{ {
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
storDevice = MemAllocZeroed(sizeof(STORVSC_DEVICE)); storDevice = kzalloc(sizeof(STORVSC_DEVICE), GFP_KERNEL);
if (!storDevice) if (!storDevice)
return NULL; return NULL;
......
...@@ -121,7 +121,6 @@ extern void PageFree(void* page, unsigned int count); ...@@ -121,7 +121,6 @@ extern void PageFree(void* page, unsigned int count);
extern void* MemMapIO(unsigned long phys, unsigned long size); extern void* MemMapIO(unsigned long phys, unsigned long size);
extern void MemUnmapIO(void* virt); extern void MemUnmapIO(void* virt);
extern void* MemAllocZeroed(unsigned int size);
extern void* MemAllocAtomic(unsigned int size); extern void* MemAllocAtomic(unsigned int size);
extern void MemFree(void* buf); extern void MemFree(void* buf);
extern void MemoryFence(void); extern void MemoryFence(void);
......
...@@ -189,13 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr) ...@@ -189,13 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr)
kunmap_atomic(VirtAddr, KM_IRQ0); kunmap_atomic(VirtAddr, KM_IRQ0);
} }
void* MemAllocZeroed(unsigned int size)
{
void *p = kmalloc(size, GFP_KERNEL);
if (p) memset(p, 0, size);
return p;
}
void* MemAllocAtomic(unsigned int size) void* MemAllocAtomic(unsigned int size)
{ {
return kmalloc(size, GFP_ATOMIC); return kmalloc(size, GFP_ATOMIC);
......
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