From 0a72f3cf9f53ae0f4f1c6e05bb081d99b5d72db2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 15 Jul 2009 12:48:01 -0700 Subject: [PATCH] Staging: hv: osd: remove MemAllocAtomic wrapper Use the "real" kmalloc call instead of a wrapper function. Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/ChannelMgmt.c | 3 +-- drivers/staging/hv/Hv.c | 2 +- drivers/staging/hv/NetVsc.c | 2 +- drivers/staging/hv/Vmbus.c | 2 +- drivers/staging/hv/include/osd.h | 1 - drivers/staging/hv/osd.c | 5 ----- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c index eafc938cd22e..44bc61ef47df 100644 --- a/drivers/staging/hv/ChannelMgmt.c +++ b/drivers/staging/hv/ChannelMgmt.c @@ -143,13 +143,12 @@ VMBUS_CHANNEL* AllocVmbusChannel(void) { VMBUS_CHANNEL* channel; - channel = (VMBUS_CHANNEL*) MemAllocAtomic(sizeof(VMBUS_CHANNEL)); + channel = kzalloc(sizeof(VMBUS_CHANNEL), GFP_ATOMIC); if (!channel) { return NULL; } - memset(channel, 0,sizeof(VMBUS_CHANNEL)); channel->InboundLock = SpinlockCreate(); if (!channel->InboundLock) { diff --git a/drivers/staging/hv/Hv.c b/drivers/staging/hv/Hv.c index 4ddaf6e3ac17..5ac9006672e3 100644 --- a/drivers/staging/hv/Hv.c +++ b/drivers/staging/hv/Hv.c @@ -414,7 +414,7 @@ HvPostMessage( return -1; } - addr = (unsigned long)MemAllocAtomic(sizeof(struct alignedInput)); + addr = (unsigned long)kmalloc(sizeof(struct alignedInput), GFP_ATOMIC); if (!addr) { diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c index 61132e48fef8..3fb44cd895d0 100644 --- a/drivers/staging/hv/NetVsc.c +++ b/drivers/staging/hv/NetVsc.c @@ -1480,7 +1480,7 @@ NetVscOnChannelCallback( } else if (ret == -2) // Handle large packet { - buffer = MemAllocAtomic(bytesRecvd); + buffer = kmalloc(bytesRecvd, GFP_ATOMIC); if (buffer == NULL) { // Try again next time around diff --git a/drivers/staging/hv/Vmbus.c b/drivers/staging/hv/Vmbus.c index 080594dcbbb1..4ad40be0bdfc 100644 --- a/drivers/staging/hv/Vmbus.c +++ b/drivers/staging/hv/Vmbus.c @@ -411,7 +411,7 @@ VmbusOnMsgDPC( } else { - copied = MemAllocAtomic(sizeof(HV_MESSAGE)); + copied = kmalloc(sizeof(HV_MESSAGE), GFP_ATOMIC); if (copied == NULL) { continue; diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h index 9ee98d87a84a..586e8881114f 100644 --- a/drivers/staging/hv/include/osd.h +++ b/drivers/staging/hv/include/osd.h @@ -121,7 +121,6 @@ extern void PageFree(void* page, unsigned int count); extern void* MemMapIO(unsigned long phys, unsigned long size); extern void MemUnmapIO(void* virt); -extern void* MemAllocAtomic(unsigned int size); extern void MemFree(void* buf); extern void MemoryFence(void); diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c index 02eb11d1f7d5..7a90c37c04f9 100644 --- a/drivers/staging/hv/osd.c +++ b/drivers/staging/hv/osd.c @@ -189,11 +189,6 @@ void PageUnmapVirtualAddress(void* VirtAddr) kunmap_atomic(VirtAddr, KM_IRQ0); } -void* MemAllocAtomic(unsigned int size) -{ - return kmalloc(size, GFP_ATOMIC); -} - void MemFree(void* buf) { kfree(buf); -- 2.30.2