From b4362c9c1fe8bec487e275f92fdf57c585ac236a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 Jul 2009 11:50:41 -0700 Subject: [PATCH] Staging: hv: osd: remove Sleep wrapper Use the "real" udelay call instead of a wrapper function. Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/NetVsc.c | 9 +++++---- drivers/staging/hv/StorVsc.c | 7 ++++--- drivers/staging/hv/include/osd.h | 2 -- drivers/staging/hv/osd.c | 5 ----- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c index 7a7a382a45a2..3039812a17cb 100644 --- a/drivers/staging/hv/NetVsc.c +++ b/drivers/staging/hv/NetVsc.c @@ -24,6 +24,7 @@ #include #include +#include #include "include/logging.h" #include "NetVsc.h" #include "RndisFilter.h" @@ -200,7 +201,7 @@ static inline NETVSC_DEVICE* ReleaseOutboundNetDevice(DEVICE_OBJECT *Device) // Busy wait until the ref drop to 2, then set it to 1 while (InterlockedCompareExchange(&netDevice->RefCount, 1, 2) != 2) { - Sleep(100); + udelay(100); } return netDevice; @@ -217,7 +218,7 @@ static inline NETVSC_DEVICE* ReleaseInboundNetDevice(DEVICE_OBJECT *Device) // Busy wait until the ref drop to 1, then set it to 0 while (InterlockedCompareExchange(&netDevice->RefCount, 0, 1) != 1) { - Sleep(100); + udelay(100); } Device->Extension = NULL; @@ -923,7 +924,7 @@ NetVscOnDeviceRemove( { DPRINT_INFO(NETVSC, "waiting for %d requests to complete...", netDevice->NumOutstandingSends); - Sleep(100); + udelay(100); } DPRINT_INFO(NETVSC, "Disconnecting from netvsp..."); @@ -1318,7 +1319,7 @@ retry_send_cmplt: if (retries < 4) { - Sleep(100); + udelay(100); goto retry_send_cmplt; } else diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c index 2cf496359794..e15f57067b98 100644 --- a/drivers/staging/hv/StorVsc.c +++ b/drivers/staging/hv/StorVsc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "include/logging.h" #include "include/StorVscApi.h" @@ -225,7 +226,7 @@ static inline STORVSC_DEVICE* ReleaseStorDevice(DEVICE_OBJECT *Device) // Busy wait until the ref drop to 2, then set it to 1 while (InterlockedCompareExchange(&storDevice->RefCount, 1, 2) != 2) { - Sleep(100); + udelay(100); } return storDevice; @@ -242,7 +243,7 @@ static inline STORVSC_DEVICE* FinalReleaseStorDevice(DEVICE_OBJECT *Device) // Busy wait until the ref drop to 1, then set it to 0 while (InterlockedCompareExchange(&storDevice->RefCount, 0, 1) != 1) { - Sleep(100); + udelay(100); } Device->Extension = NULL; @@ -582,7 +583,7 @@ StorVscOnDeviceRemove( { DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", storDevice->NumOutstandingRequests); - Sleep(100); + udelay(100); } DPRINT_INFO(STORVSC, "removing storage device (%p)...", Device->Extension); diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h index d6568f510297..504d585e713e 100644 --- a/drivers/staging/hv/include/osd.h +++ b/drivers/staging/hv/include/osd.h @@ -110,8 +110,6 @@ extern int InterlockedIncrement(int *val); extern int InterlockedDecrement(int *val); extern int InterlockedCompareExchange(int *val, int new, int curr); -extern void Sleep(unsigned long usecs); - extern void* VirtualAllocExec(unsigned int size); extern void VirtualFree(void* VirtAddr); diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c index 27408277b13e..0c2ad4916cb2 100644 --- a/drivers/staging/hv/osd.c +++ b/drivers/staging/hv/osd.c @@ -131,11 +131,6 @@ int InterlockedCompareExchange(int *val, int new, int curr) } -void Sleep(unsigned long usecs) -{ - udelay(usecs); -} - void* VirtualAllocExec(unsigned int size) { #ifdef __x86_64__ -- 2.34.1