staging: vc04_services: Remove VCHIU_QUEUE_T typedef

Typedefing structs is not encouraged in the kernel.

Signed-off-by: Dominic Braun <inf.braun@fau.de>
Signed-off-by: Tobias Büttner <tobias.buettner@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dominic Braun 2018-12-14 13:05:10 +01:00 committed by Greg Kroah-Hartman
parent 2d0a029113
commit 2074e8a7d0
3 changed files with 18 additions and 17 deletions

View File

@ -44,7 +44,7 @@
struct shim_service { struct shim_service {
VCHIQ_SERVICE_HANDLE_T handle; VCHIQ_SERVICE_HANDLE_T handle;
VCHIU_QUEUE_T queue; struct vchiu_queue queue;
VCHI_CALLBACK_T callback; VCHI_CALLBACK_T callback;
void *callback_param; void *callback_param;

View File

@ -38,7 +38,7 @@ static inline int is_pow2(int i)
return i && !(i & (i - 1)); 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)); WARN_ON(!is_pow2(size));
@ -59,22 +59,22 @@ int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
return 1; return 1;
} }
void vchiu_queue_delete(VCHIU_QUEUE_T *queue) void vchiu_queue_delete(struct vchiu_queue *queue)
{ {
kfree(queue->storage); 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; 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; 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) if (!queue->initialized)
return; return;
@ -90,7 +90,7 @@ void vchiu_queue_push(VCHIU_QUEUE_T *queue, struct vchiq_header *header)
complete(&queue->push); 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) { while (queue->write == queue->read) {
if (wait_for_completion_killable(&queue->push)) if (wait_for_completion_killable(&queue->push))
@ -102,7 +102,7 @@ struct vchiq_header *vchiu_queue_peek(VCHIU_QUEUE_T *queue)
return queue->storage[queue->read & (queue->size - 1)]; 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; struct vchiq_header *header;

View File

@ -54,7 +54,7 @@
#include "vchiq_if.h" #include "vchiq_if.h"
typedef struct { struct vchiu_queue {
int size; int size;
int read; int read;
int write; int write;
@ -64,17 +64,18 @@ typedef struct {
struct completion push; struct completion push;
struct vchiq_header **storage; struct vchiq_header **storage;
} VCHIU_QUEUE_T; };
extern int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size); extern int vchiu_queue_init(struct vchiu_queue *queue, int size);
extern void vchiu_queue_delete(VCHIU_QUEUE_T *queue); extern void vchiu_queue_delete(struct vchiu_queue *queue);
extern int vchiu_queue_is_empty(VCHIU_QUEUE_T *queue); extern int vchiu_queue_is_empty(struct vchiu_queue *queue);
extern int vchiu_queue_is_full(VCHIU_QUEUE_T *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_peek(struct vchiu_queue *queue);
extern struct vchiq_header *vchiu_queue_pop(VCHIU_QUEUE_T *queue); extern struct vchiq_header *vchiu_queue_pop(struct vchiu_queue *queue);
#endif #endif