Typedefing structs is not encouraged in the kernel.
Signed-off-by: Dominic Braun <[email protected]>
Signed-off-by: Tobias Büttner <[email protected]>
---
.../interface/vchiq_arm/vchiq_shim.c | 2 +-
.../interface/vchiq_arm/vchiq_util.c | 14 +++++++-------
.../interface/vchiq_arm/vchiq_util.h | 19 ++++++++++---------
3 files changed, 18 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 0a4e379da03e..ab6ca8fd6f14 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 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 61381a6c256e..a5db1c39bd2d 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 *queue, int size)
{
WARN_ON(!is_pow2(size));
@@ -60,22 +60,22 @@ 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 *queue)
{
kfree(queue->storage);
}
-int vchiu_queue_is_empty(VCHIU_QUEUE_T *queue)
+int vchiu_queue_is_empty(struct vchiu_queue *queue)
{
return queue->read == queue->write;
}
-int vchiu_queue_is_full(VCHIU_QUEUE_T *queue)
+int vchiu_queue_is_full(struct vchiu_queue *queue)
{
return queue->write == queue->read + queue->size;
}
-void vchiu_queue_push(VCHIU_QUEUE_T *queue, struct vchiq_header *header)
+void vchiu_queue_push(struct vchiu_queue *queue, struct vchiq_header *header)
{
if (!queue->initialized)
return;
@@ -91,7 +91,7 @@ void vchiu_queue_push(VCHIU_QUEUE_T *queue, struct
vchiq_header *header)
complete(&queue->push);
}
-struct vchiq_header *vchiu_queue_peek(VCHIU_QUEUE_T *queue)
+struct vchiq_header *vchiu_queue_peek(struct vchiu_queue *queue)
{
while (queue->write == queue->read) {
if (wait_for_completion_interruptible(&queue->push))
@@ -103,7 +103,7 @@ struct vchiq_header *vchiu_queue_peek(VCHIU_QUEUE_T *queue)
return queue->storage[queue->read & (queue->size - 1)];
}
-struct vchiq_header *vchiu_queue_pop(VCHIU_QUEUE_T *queue)
+struct vchiq_header *vchiu_queue_pop(struct vchiu_queue *queue)
{
struct vchiq_header *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 ba8d5f778426..d842194b4023 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 {
int size;
int read;
int write;
@@ -64,17 +64,18 @@ typedef struct {
struct completion push;
struct vchiq_header **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 *queue, int size);
+extern void vchiu_queue_delete(struct vchiu_queue *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 *queue);
+extern int vchiu_queue_is_full(struct vchiu_queue *queue);
-extern void vchiu_queue_push(VCHIU_QUEUE_T *queue, struct vchiq_header
*header);
+extern void vchiu_queue_push(struct vchiu_queue *queue,
+ struct vchiq_header *header);
-extern struct vchiq_header *vchiu_queue_peek(VCHIU_QUEUE_T *queue);
-extern struct vchiq_header *vchiu_queue_pop(VCHIU_QUEUE_T *queue);
+extern struct vchiq_header *vchiu_queue_peek(struct vchiu_queue *queue);
+extern struct vchiq_header *vchiu_queue_pop(struct vchiu_queue *queue);
#endif
--
2.17.1
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel