From: Greg Kroah-Hartman Date: Wed, 15 Jul 2009 19:48:01 +0000 (-0700) Subject: Staging: hv: osd: remove MemAllocAtomic wrapper X-Git-Tag: firefly_0821_release~12948^2~454 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0a72f3cf9f53ae0f4f1c6e05bb081d99b5d72db2;p=firefly-linux-kernel-4.4.55.git 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 --- 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);