提交 0a72f3cf 编写于 作者: G Greg Kroah-Hartman

Staging: hv: osd: remove MemAllocAtomic wrapper

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

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e276a3a5
...@@ -143,13 +143,12 @@ VMBUS_CHANNEL* AllocVmbusChannel(void) ...@@ -143,13 +143,12 @@ VMBUS_CHANNEL* AllocVmbusChannel(void)
{ {
VMBUS_CHANNEL* channel; VMBUS_CHANNEL* channel;
channel = (VMBUS_CHANNEL*) MemAllocAtomic(sizeof(VMBUS_CHANNEL)); channel = kzalloc(sizeof(VMBUS_CHANNEL), GFP_ATOMIC);
if (!channel) if (!channel)
{ {
return NULL; return NULL;
} }
memset(channel, 0,sizeof(VMBUS_CHANNEL));
channel->InboundLock = SpinlockCreate(); channel->InboundLock = SpinlockCreate();
if (!channel->InboundLock) if (!channel->InboundLock)
{ {
......
...@@ -414,7 +414,7 @@ HvPostMessage( ...@@ -414,7 +414,7 @@ HvPostMessage(
return -1; return -1;
} }
addr = (unsigned long)MemAllocAtomic(sizeof(struct alignedInput)); addr = (unsigned long)kmalloc(sizeof(struct alignedInput), GFP_ATOMIC);
if (!addr) if (!addr)
{ {
......
...@@ -1480,7 +1480,7 @@ NetVscOnChannelCallback( ...@@ -1480,7 +1480,7 @@ NetVscOnChannelCallback(
} }
else if (ret == -2) // Handle large packet else if (ret == -2) // Handle large packet
{ {
buffer = MemAllocAtomic(bytesRecvd); buffer = kmalloc(bytesRecvd, GFP_ATOMIC);
if (buffer == NULL) if (buffer == NULL)
{ {
// Try again next time around // Try again next time around
......
...@@ -411,7 +411,7 @@ VmbusOnMsgDPC( ...@@ -411,7 +411,7 @@ VmbusOnMsgDPC(
} }
else else
{ {
copied = MemAllocAtomic(sizeof(HV_MESSAGE)); copied = kmalloc(sizeof(HV_MESSAGE), GFP_ATOMIC);
if (copied == NULL) if (copied == NULL)
{ {
continue; continue;
......
...@@ -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* MemAllocAtomic(unsigned int size);
extern void MemFree(void* buf); extern void MemFree(void* buf);
extern void MemoryFence(void); extern void MemoryFence(void);
......
...@@ -189,11 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr) ...@@ -189,11 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr)
kunmap_atomic(VirtAddr, KM_IRQ0); kunmap_atomic(VirtAddr, KM_IRQ0);
} }
void* MemAllocAtomic(unsigned int size)
{
return kmalloc(size, GFP_ATOMIC);
}
void MemFree(void* buf) void MemFree(void* buf)
{ {
kfree(buf); kfree(buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册