Staging: hv: remove wrapper functions for bit operations

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, September 16, 2009 - 9:07 am

Gitweb:     http://git.kernel.org/linus/7c369f405bc918f3245c7ee0b0ad6c6b6c750166
Commit:     7c369f405bc918f3245c7ee0b0ad6c6b6c750166
Parent:     420beac4fcc9efd6f7d838ef7cc5693c58c98015
Author:     Bill Pemberton <wfp5p@virginia.edu>
AuthorDate: Wed Jul 29 17:00:11 2009 -0400
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Sep 15 12:01:53 2009 -0700

    Staging: hv: remove wrapper functions for bit operations
    
    There were several Bit* functions that did nothing but call the kernel
    functions with the parameters reversed.  Remove these and call the
    functions directly.
    
    Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
    Cc: Hank Janssen <hjanssen@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/hv/Channel.c     |   14 ++++++++++----
 drivers/staging/hv/Connection.c  |    6 ++++--
 drivers/staging/hv/Vmbus.c       |    2 +-
 drivers/staging/hv/include/osd.h |    6 ------
 drivers/staging/hv/osd.c         |   27 ---------------------------
 5 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index e633741..4b5e3e4 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -104,12 +104,16 @@ VmbusChannelSetEvent(
 	if (Channel->OfferMsg.MonitorAllocated)
 	{
 		/* Each u32 represents 32 channels */
-		BitSet((u32*)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5), Channel->OfferMsg.ChildRelId & 31);
+		set_bit(Channel->OfferMsg.ChildRelId & 31,
+			(unsigned long *) gVmbusConnection.SendInterruptPage +
+			(Channel->OfferMsg.ChildRelId >> 5) );
 
 		monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages;
 		monitorPage++; /* Get the child to parent monitor page */
 
-		BitSet((u32*) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending, Channel->MonitorBit);
+		set_bit(Channel->MonitorBit,
+			(unsigned long *) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending);
+
 	}
 	else
 	{
@@ -132,12 +136,14 @@ VmbusChannelClearEvent(
 	if (Channel->OfferMsg.MonitorAllocated)
 	{
 		/* Each u32 represents 32 channels */
-		BitClear((u32*)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5), Channel->OfferMsg.ChildRelId & 31);
+		clear_bit(Channel->OfferMsg.ChildRelId & 31,
+			  (unsigned long *) gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >> 5));
 
 		monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages;
 		monitorPage++; /* Get the child to parent monitor page */
 
-		BitClear((u32*) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending, Channel->MonitorBit);
+		clear_bit(Channel->MonitorBit,
+			  (unsigned long *) &monitorPage->TriggerGroup[Channel->MonitorGroup].Pending);
 	}
 
 	DPRINT_EXIT(VMBUS);
diff --git a/drivers/staging/hv/Connection.c b/drivers/staging/hv/Connection.c
index 8d76bd4..b7df7e7 100644
--- a/drivers/staging/hv/Connection.c
+++ b/drivers/staging/hv/Connection.c
@@ -358,7 +358,7 @@ VmbusOnEvents(
 			{
 				for (bit = 0; bit < 32; bit++)
 				{
-					if (BitTestAndClear(&recvInterruptPage[dword], bit))
+					if (test_and_clear_bit(bit, (unsigned long *) &recvInterruptPage[dword]))
 					{
 						relid = (dword << 5) + bit;
 
@@ -432,7 +432,9 @@ VmbusSetEvent(u32 childRelId)
 	DPRINT_ENTER(VMBUS);
 
 	/* Each u32 represents 32 channels */
-	BitSet((u32*)gVmbusConnection.SendInterruptPage + (childRelId >> 5), childRelId & 31);
+	set_bit(childRelId & 31,
+		(unsigned long *) gVmbusConnection.SendInterruptPage + (childRelId >> 5));
+
 	ret = HvSignalEvent();
 
 	DPRINT_EXIT(VMBUS);
diff --git a/drivers/staging/hv/Vmbus.c b/drivers/staging/hv/Vmbus.c
index 13d7ac8..fa8c58f 100644
--- a/drivers/staging/hv/Vmbus.c
+++ b/drivers/staging/hv/Vmbus.c
@@ -511,7 +511,7 @@ VmbusOnISR(
 	event = (HV_SYNIC_EVENT_FLAGS*)page_addr + VMBUS_MESSAGE_SINT;
 
 	/* Since we are a child, we only need to check bit 0 */
-	if (BitTestAndClear(&event->Flags32[0], 0))
+	if (test_and_clear_bit(0, (unsigned long *) &event->Flags32[0]))
 	{
 		DPRINT_DBG(VMBUS, "received event %d", event->Flags32[0]);
 		ret |= 0x2;
diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h
index e1f3787..ee44e7e 100644
--- a/drivers/staging/hv/include/osd.h
+++ b/drivers/staging/hv/include/osd.h
@@ -109,12 +109,6 @@ static inline void do_cpuid(unsigned int op, unsigned int *eax, unsigned int *eb
 
 /* Osd routines */
 
-extern void BitSet(unsigned int* addr, int value);
-extern void BitClear(unsigned int* addr, int value);
-extern int BitTest(unsigned int* addr, int value);
-extern int BitTestAndClear(unsigned int* addr, int value);
-extern int BitTestAndSet(unsigned int* addr, int value);
-
 extern int InterlockedIncrement(int *val);
 extern int InterlockedDecrement(int *val);
 extern int InterlockedCompareExchange(int *val, int new, int curr);
diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index 8ca56a4..ff01a7b 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -56,33 +56,6 @@ struct osd_callback_struct {
 	void *data;
 };
 
-
-void BitSet(unsigned int* addr, int bit)
-{
-	set_bit(bit, (unsigned long*)addr);
-}
-
-int BitTest(unsigned int* addr, int bit)
-{
-	return test_bit(bit, (unsigned long*)addr);
-}
-
-void BitClear(unsigned int* addr, int bit)
-{
-	clear_bit(bit, (unsigned long*)addr);
-}
-
-int BitTestAndClear(unsigned int* addr, int bit)
-{
-	return test_and_clear_bit(bit, (unsigned long*)addr);
-}
-
-int BitTestAndSet(unsigned int* addr, int bit)
-{
-	return test_and_set_bit(bit, (unsigned long*)addr);
-}
-
-
 int InterlockedIncrement(int *val)
 {
 	return atomic_inc_return((atomic_t*)val);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Staging: hv: remove wrapper functions for bit operations, Linux Kernel Mailing ..., (Wed Sep 16, 9:07 am)