[PATCH 227/641] Staging: hv: Remove WORKQUEUE typedef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bill Pemberton <wfp5p@xxxxxxxxxxxx>

WORKQUEUE was a wrapper around struct workqueue_struct so just use
that instead.

Signed-off-by: Bill Pemberton <wfp5p@xxxxxxxxxxxx>
Cc: Hank Janssen <hjanssen@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/hv/ChannelMgmt.h  |    2 +-
 drivers/staging/hv/VmbusPrivate.h |    2 +-
 drivers/staging/hv/include/osd.h  |    8 +++++---
 drivers/staging/hv/osd.c          |   30 ++++++++++--------------------
 4 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/hv/ChannelMgmt.h b/drivers/staging/hv/ChannelMgmt.h
index c4aa95c..5831d19 100644
--- a/drivers/staging/hv/ChannelMgmt.h
+++ b/drivers/staging/hv/ChannelMgmt.h
@@ -64,7 +64,7 @@ typedef struct _VMBUS_CHANNEL {
 	RING_BUFFER_INFO			Outbound;	/* send to parent */
 	RING_BUFFER_INFO			Inbound;	/* receive from parent */
 	spinlock_t inbound_lock;
-	HANDLE						ControlWQ;
+	struct workqueue_struct *ControlWQ;
 
 	/* Channel callback are invoked in this workqueue context */
 	/* HANDLE						dataWorkQueue; */
diff --git a/drivers/staging/hv/VmbusPrivate.h b/drivers/staging/hv/VmbusPrivate.h
index 40e5962..7182d4d 100644
--- a/drivers/staging/hv/VmbusPrivate.h
+++ b/drivers/staging/hv/VmbusPrivate.h
@@ -93,7 +93,7 @@ struct VMBUS_CONNECTION {
 	LIST_ENTRY							ChannelList;
 	spinlock_t channel_lock;
 
-	HANDLE								WorkQueue;
+	struct workqueue_struct *WorkQueue;
 };
 
 
diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h
index faae7cc..6a5675f 100644
--- a/drivers/staging/hv/include/osd.h
+++ b/drivers/staging/hv/include/osd.h
@@ -143,9 +143,11 @@ void* PageMapVirtualAddress(unsigned long Pfn);
 void PageUnmapVirtualAddress(void* VirtAddr);
 
 
-extern HANDLE WorkQueueCreate(char* name);
-extern void WorkQueueClose(HANDLE hWorkQueue);
-extern int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, void* context);
+extern struct workqueue_struct *WorkQueueCreate(char* name);
+extern void WorkQueueClose(struct workqueue_struct *hWorkQueue);
+extern int WorkQueueQueueWorkItem(struct workqueue_struct *hWorkQueue,
+				  PFN_WORKITEM_CALLBACK workItem,
+				  void *context);
 
 extern void QueueWorkItem(PFN_WORKITEM_CALLBACK workItem, void* context);
 
diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index e683735..4cee746 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -61,10 +61,6 @@ typedef struct _WAITEVENT {
 	wait_queue_head_t event;
 } WAITEVENT;
 
-typedef struct _WORKQUEUE {
-	struct workqueue_struct *queue;
-} WORKQUEUE;
-
 typedef struct _WORKITEM {
 	struct work_struct work;
 	PFN_WORKITEM_CALLBACK callback;
@@ -303,31 +299,25 @@ void WorkItemCallback(struct work_struct *work)
 	kfree(w);
 }
 
-HANDLE WorkQueueCreate(char* name)
+struct workqueue_struct *WorkQueueCreate(char *name)
 {
-	WORKQUEUE *wq = kmalloc(sizeof(WORKQUEUE), GFP_KERNEL);
-	if (!wq)
-	{
+	struct workqueue_struct *wq;
+	wq = create_workqueue(name);
+	if (unlikely(!wq))
 		return NULL;
-	}
-	wq->queue = create_workqueue(name);
-
 	return wq;
 }
 
-void WorkQueueClose(HANDLE hWorkQueue)
+void WorkQueueClose(struct workqueue_struct *hWorkQueue)
 {
-	WORKQUEUE *wq = (WORKQUEUE *)hWorkQueue;
-
-	destroy_workqueue(wq->queue);
-
+	destroy_workqueue(hWorkQueue);
 	return;
 }
 
-int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, void* context)
+int WorkQueueQueueWorkItem(struct workqueue_struct *hWorkQueue,
+			   PFN_WORKITEM_CALLBACK workItem,
+			   void* context)
 {
-	WORKQUEUE *wq = (WORKQUEUE *)hWorkQueue;
-
 	WORKITEM* w = kmalloc(sizeof(WORKITEM), GFP_ATOMIC);
 	if (!w)
 	{
@@ -337,7 +327,7 @@ int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, vo
 	w->callback = workItem,
 	w->context = context;
 	INIT_WORK(&w->work, WorkItemCallback);
-	return queue_work(wq->queue, &w->work);
+	return queue_work(hWorkQueue, &w->work);
 }
 
 void QueueWorkItem(PFN_WORKITEM_CALLBACK workItem, void* context)
-- 
1.6.4.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux