Staging: hv: remove function pointer typedefs from NetVscApi.h

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

Gitweb:     http://git.kernel.org/linus/211ccd6e0b4b62abc0c93eeb671f5cd970b3c185
Commit:     211ccd6e0b4b62abc0c93eeb671f5cd970b3c185
Parent:     74982610d08e7687c435fa6f07245fdfb2362f6d
Author:     Greg Kroah-Hartman <gregkh@suse.de>
AuthorDate: Wed Sep 2 11:24:48 2009 -0700
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Sep 15 12:02:03 2009 -0700

    Staging: hv: remove function pointer typedefs from NetVscApi.h
    
    function pointer typedefs are allowed in the kernel, but only if they
    make sense, which they really do not here, as they are not passed around
    with any kind of frequency.  So just spell them all out, it makes the
    code smaller and easier to understand overall.
    
    Cc: Hank Janssen <hjanssen@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/hv/NetVscApi.h   |   32 ++++++++------------------------
 drivers/staging/hv/RndisFilter.c |    2 +-
 2 files changed, 9 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/hv/NetVscApi.h b/drivers/staging/hv/NetVscApi.h
index c53e417..1cf1287 100644
--- a/drivers/staging/hv/NetVscApi.h
+++ b/drivers/staging/hv/NetVscApi.h
@@ -35,19 +35,6 @@
 /* Fwd declaration */
 struct hv_netvsc_packet;
 
-/* Data types */
-typedef int (*PFN_ON_OPEN)(struct hv_device *Device);
-typedef int (*PFN_ON_CLOSE)(struct hv_device *Device);
-
-typedef void (*PFN_QUERY_LINKSTATUS)(struct hv_device *Device);
-typedef int (*PFN_ON_SEND)(struct hv_device *dev,
-			   struct hv_netvsc_packet *packet);
-typedef void (*PFN_ON_SENDRECVCOMPLETION)(void *Context);
-
-typedef int (*PFN_ON_RECVCALLBACK)(struct hv_device *dev,
-				   struct hv_netvsc_packet *packet);
-typedef void (*PFN_ON_LINKSTATUS_CHANGED)(struct hv_device *dev, u32 Status);
-
 /* Represent the xfer page packet which contains 1 or more netvsc packet */
 struct xferpage_packet {
 	LIST_ENTRY ListEntry;
@@ -80,12 +67,12 @@ struct hv_netvsc_packet {
 		struct{
 			u64 ReceiveCompletionTid;
 			void *ReceiveCompletionContext;
-			PFN_ON_SENDRECVCOMPLETION OnReceiveCompletion;
+			void (*OnReceiveCompletion)(void *context);
 		} Recv;
 		struct{
 			u64 SendCompletionTid;
 			void *SendCompletionContext;
-			PFN_ON_SENDRECVCOMPLETION OnSendCompletion;
+			void (*OnSendCompletion)(void *context);
 		} Send;
 	} Completion;
 
@@ -114,17 +101,14 @@ struct netvsc_driver {
 	 * This is set by the caller to allow us to callback when we
 	 * receive a packet from the "wire"
 	 */
-	PFN_ON_RECVCALLBACK OnReceiveCallback;
-
-	PFN_ON_LINKSTATUS_CHANGED OnLinkStatusChanged;
+	int (*OnReceiveCallback)(struct hv_device *dev,
+				 struct hv_netvsc_packet *packet);
+	void (*OnLinkStatusChanged)(struct hv_device *dev, u32 Status);
 
 	/* Specific to this driver */
-	PFN_ON_OPEN OnOpen;
-	PFN_ON_CLOSE OnClose;
-	PFN_ON_SEND OnSend;
-	/* PFN_ON_RECVCOMPLETION OnReceiveCompletion; */
-
-	/* PFN_QUERY_LINKSTATUS QueryLinkStatus; */
+	int (*OnOpen)(struct hv_device *dev);
+	int (*OnClose)(struct hv_device *dev);
+	int (*OnSend)(struct hv_device *dev, struct hv_netvsc_packet *packet);
 
 	void *Context;
 };
diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c
index 6ebe70e..cfe2f02 100644
--- a/drivers/staging/hv/RndisFilter.c
+++ b/drivers/staging/hv/RndisFilter.c
@@ -73,7 +73,7 @@ struct rndis_request {
 
 struct rndis_filter_packet {
 	void *CompletionContext;
-	PFN_ON_SENDRECVCOMPLETION OnCompletion;
+	void (*OnCompletion)(void *context);
 	struct rndis_message Message;
 };
 
--
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 function pointer typedefs from NetVscApi.h, Linux Kernel Mailing ..., (Wed Sep 16, 9:09 am)