[PATCH 33/33] staging: vc04_services: Remove VCHIU_QUEUE_T typedef

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

 



Typedefing structs is not encouraged in the kernel.

The removal of typedefs was requested in interface/vchi/TODO in commit
7626e002225a4c1b9455689b1f22909dfeff43ca.

Signed-off-by: Dominic Braun <inf.braun@xxxxxx>
Signed-off-by: Tobias Büttner <tobias.buettner@xxxxxx>
---
 .../interface/vchiq_arm/vchiq_shim.c          |  2 +-
 .../interface/vchiq_arm/vchiq_util.c          | 15 ++++++-------
 .../interface/vchiq_arm/vchiq_util.h          | 21 +++++++++++--------
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
index 350d9fd2d944..0fc560d663cd 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
@@ -44,7 +44,7 @@
 struct shim_service {
 	VCHIQ_SERVICE_HANDLE_T handle;
 
-	VCHIU_QUEUE_T queue;
+	struct vchiu_queue_struct queue;
 
 	VCHI_CALLBACK_T callback;
 	void *callback_param;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
index 3fddd47aac58..94777cbf5fc6 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
@@ -39,7 +39,7 @@ static inline int is_pow2(int i)
 	return i && !(i & (i - 1));
 }
 
-int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
+int vchiu_queue_init(struct vchiu_queue_struct *queue, int size)
 {
 	WARN_ON(!is_pow2(size));
 
@@ -60,22 +60,23 @@ int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
 	return 1;
 }
 
-void vchiu_queue_delete(VCHIU_QUEUE_T *queue)
+void vchiu_queue_delete(struct vchiu_queue_struct *queue)
 {
 	kfree(queue->storage);
 }
 
-int vchiu_queue_is_empty(VCHIU_QUEUE_T *queue)
+int vchiu_queue_is_empty(struct vchiu_queue_struct *queue)
 {
 	return queue->read == queue->write;
 }
 
-int vchiu_queue_is_full(VCHIU_QUEUE_T *queue)
+int vchiu_queue_is_full(struct vchiu_queue_struct *queue)
 {
 	return queue->write == queue->read + queue->size;
 }
 
-void vchiu_queue_push(VCHIU_QUEUE_T *queue, struct vchiq_header_struct *header)
+void vchiu_queue_push(struct vchiu_queue_struct *queue,
+		      struct vchiq_header_struct *header)
 {
 	if (!queue->initialized)
 		return;
@@ -91,7 +92,7 @@ void vchiu_queue_push(VCHIU_QUEUE_T *queue, struct vchiq_header_struct *header)
 	complete(&queue->push);
 }
 
-struct vchiq_header_struct *vchiu_queue_peek(VCHIU_QUEUE_T *queue)
+struct vchiq_header_struct *vchiu_queue_peek(struct vchiu_queue_struct *queue)
 {
 	while (queue->write == queue->read) {
 		if (wait_for_completion_interruptible(&queue->push))
@@ -103,7 +104,7 @@ struct vchiq_header_struct *vchiu_queue_peek(VCHIU_QUEUE_T *queue)
 	return queue->storage[queue->read & (queue->size - 1)];
 }
 
-struct vchiq_header_struct *vchiu_queue_pop(VCHIU_QUEUE_T *queue)
+struct vchiq_header_struct *vchiu_queue_pop(struct vchiu_queue_struct *queue)
 {
 	struct vchiq_header_struct *header;
 
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.h
index 7fb8746c0e1b..1e5a9696262a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.h
@@ -54,7 +54,7 @@
 
 #include "vchiq_if.h"
 
-typedef struct {
+struct vchiu_queue_struct {
 	int size;
 	int read;
 	int write;
@@ -64,18 +64,21 @@ typedef struct {
 	struct completion push;
 
 	struct vchiq_header_struct **storage;
-} VCHIU_QUEUE_T;
+};
 
-extern int  vchiu_queue_init(VCHIU_QUEUE_T *queue, int size);
-extern void vchiu_queue_delete(VCHIU_QUEUE_T *queue);
+extern int  vchiu_queue_init(struct vchiu_queue_struct *queue, int size);
+extern void vchiu_queue_delete(struct vchiu_queue_struct *queue);
 
-extern int vchiu_queue_is_empty(VCHIU_QUEUE_T *queue);
-extern int vchiu_queue_is_full(VCHIU_QUEUE_T *queue);
+extern int vchiu_queue_is_empty(struct vchiu_queue_struct *queue);
+extern int vchiu_queue_is_full(struct vchiu_queue_struct *queue);
 
-extern void vchiu_queue_push(VCHIU_QUEUE_T *queue,
+extern void vchiu_queue_push(struct vchiu_queue_struct *queue,
 			     struct vchiq_header_struct *header);
 
-extern struct vchiq_header_struct *vchiu_queue_peek(VCHIU_QUEUE_T *queue);
-extern struct vchiq_header_struct *vchiu_queue_pop(VCHIU_QUEUE_T *queue);
+extern struct vchiq_header_struct
+*vchiu_queue_peek(struct vchiu_queue_struct *queue);
+
+extern struct vchiq_header_struct
+*vchiu_queue_pop(struct vchiu_queue_struct *queue);
 
 #endif
-- 
2.17.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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