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_2835_arm.c | 4 +- .../interface/vchiq_arm/vchiq_arm.c | 72 ++++++++++++------- .../interface/vchiq_arm/vchiq_arm.h | 19 ++--- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 76e87cda130c..eab05ead2d67 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -61,7 +61,7 @@ struct vchiq_2835_state { int inited; - VCHIQ_ARM_STATE_T arm_state; + struct vchiq_arm_state_struct arm_state; }; struct vchiq_pagelist_info { @@ -221,7 +221,7 @@ vchiq_platform_init_state(VCHIQ_STATE_T *state) return status; } -VCHIQ_ARM_STATE_T* +struct vchiq_arm_state_struct* vchiq_platform_get_arm_state(VCHIQ_STATE_T *state) { struct vchiq_2835_state *platform_state; diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index ed4336f2072d..43ce8137a198 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2293,7 +2293,8 @@ vchiq_fops = { int vchiq_videocore_wanted(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); if (!arm_state) /* autosuspend not supported - always return wanted */ @@ -2326,7 +2327,8 @@ static int vchiq_keepalive_thread_func(void *v) { VCHIQ_STATE_T *state = (VCHIQ_STATE_T *) v; - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); VCHIQ_STATUS_T status; VCHIQ_INSTANCE_T instance; @@ -2404,7 +2406,8 @@ vchiq_keepalive_thread_func(void *v) } VCHIQ_STATUS_T -vchiq_arm_init_state(VCHIQ_STATE_T *state, VCHIQ_ARM_STATE_T *arm_state) +vchiq_arm_init_state(VCHIQ_STATE_T *state, + struct vchiq_arm_state_struct *arm_state) { if (arm_state) { rwlock_init(&arm_state->susp_res_lock); @@ -2500,8 +2503,8 @@ vchiq_arm_init_state(VCHIQ_STATE_T *state, VCHIQ_ARM_STATE_T *arm_state) */ void -set_suspend_state(VCHIQ_ARM_STATE_T *arm_state, - enum vc_suspend_status new_state) +set_suspend_state(struct vchiq_arm_state_struct *arm_state, + enum vc_suspend_status new_state) { /* set the state in all cases */ arm_state->vc_suspend_state = new_state; @@ -2537,8 +2540,8 @@ set_suspend_state(VCHIQ_ARM_STATE_T *arm_state, } void -set_resume_state(VCHIQ_ARM_STATE_T *arm_state, - enum vc_resume_status new_state) +set_resume_state(struct vchiq_arm_state_struct *arm_state, + enum vc_resume_status new_state) { /* set the state in all cases */ arm_state->vc_resume_state = new_state; @@ -2566,7 +2569,7 @@ set_resume_state(VCHIQ_ARM_STATE_T *arm_state, /* should be called with the write lock held */ inline void -start_suspend_timer(VCHIQ_ARM_STATE_T *arm_state) +start_suspend_timer(struct vchiq_arm_state_struct *arm_state) { del_timer(&arm_state->suspend_timer); arm_state->suspend_timer.expires = jiffies + @@ -2577,7 +2580,7 @@ start_suspend_timer(VCHIQ_ARM_STATE_T *arm_state) /* should be called with the write lock held */ static inline void -stop_suspend_timer(VCHIQ_ARM_STATE_T *arm_state) +stop_suspend_timer(struct vchiq_arm_state_struct *arm_state) { if (arm_state->suspend_timer_running) { del_timer(&arm_state->suspend_timer); @@ -2588,7 +2591,8 @@ stop_suspend_timer(VCHIQ_ARM_STATE_T *arm_state) static inline int need_resume(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); return (arm_state->vc_suspend_state > VC_SUSPEND_IDLE) && (arm_state->vc_resume_state < VC_RESUME_REQUESTED) && @@ -2596,7 +2600,7 @@ need_resume(VCHIQ_STATE_T *state) } static int -block_resume(VCHIQ_ARM_STATE_T *arm_state) +block_resume(struct vchiq_arm_state_struct *arm_state) { int status = VCHIQ_SUCCESS; const unsigned long timeout_val = @@ -2662,7 +2666,7 @@ block_resume(VCHIQ_ARM_STATE_T *arm_state) } static inline void -unblock_resume(VCHIQ_ARM_STATE_T *arm_state) +unblock_resume(struct vchiq_arm_state_struct *arm_state) { complete_all(&arm_state->resume_blocker); arm_state->resume_blocked = 0; @@ -2674,7 +2678,8 @@ VCHIQ_STATUS_T vchiq_arm_vcsuspend(VCHIQ_STATE_T *state) { VCHIQ_STATUS_T status = VCHIQ_ERROR; - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); if (!arm_state) goto out; @@ -2722,7 +2727,8 @@ vchiq_arm_vcsuspend(VCHIQ_STATE_T *state) void vchiq_platform_check_suspend(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); int susp = 0; if (!arm_state) @@ -2749,7 +2755,8 @@ vchiq_platform_check_suspend(VCHIQ_STATE_T *state) static void output_timeout_error(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); char err[50] = ""; int vc_use_count = arm_state->videocore_use_count; int active_services = state->unused_service; @@ -2794,7 +2801,8 @@ output_timeout_error(VCHIQ_STATE_T *state) VCHIQ_STATUS_T vchiq_arm_force_suspend(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); VCHIQ_STATUS_T status = VCHIQ_ERROR; long rc = 0; int repeat = -1; @@ -2905,7 +2913,8 @@ vchiq_arm_force_suspend(VCHIQ_STATE_T *state) void vchiq_check_suspend(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); if (!arm_state) goto out; @@ -2927,7 +2936,8 @@ vchiq_check_suspend(VCHIQ_STATE_T *state) int vchiq_arm_allow_resume(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); int resume = 0; int ret = -1; @@ -2971,7 +2981,8 @@ vchiq_arm_allow_resume(VCHIQ_STATE_T *state) int vchiq_check_resume(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); int resume = 0; if (!arm_state) @@ -2994,7 +3005,8 @@ VCHIQ_STATUS_T vchiq_use_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service, enum USE_TYPE_E use_type) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); VCHIQ_STATUS_T ret = VCHIQ_SUCCESS; char entity[16]; int *entity_uc; @@ -3126,7 +3138,8 @@ vchiq_use_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service, VCHIQ_STATUS_T vchiq_release_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); VCHIQ_STATUS_T ret = VCHIQ_SUCCESS; char entity[16]; int *entity_uc; @@ -3188,7 +3201,8 @@ vchiq_release_internal(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service) void vchiq_on_remote_use(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); vchiq_log_trace(vchiq_susp_log_level, "%s", __func__); atomic_inc(&arm_state->ka_use_count); @@ -3198,7 +3212,8 @@ vchiq_on_remote_use(VCHIQ_STATE_T *state) void vchiq_on_remote_release(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); vchiq_log_trace(vchiq_susp_log_level, "%s", __func__); atomic_inc(&arm_state->ka_release_count); @@ -3267,7 +3282,8 @@ vchiq_instance_set_trace(VCHIQ_INSTANCE_T instance, int trace) static void suspend_timer_callback(struct timer_list *t) { - VCHIQ_ARM_STATE_T *arm_state = from_timer(arm_state, t, suspend_timer); + struct vchiq_arm_state_struct *arm_state = + from_timer(arm_state, t, suspend_timer); VCHIQ_STATE_T *state = arm_state->state; vchiq_log_info(vchiq_susp_log_level, @@ -3325,7 +3341,8 @@ struct service_data_struct { void vchiq_dump_service_use_state(VCHIQ_STATE_T *state) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); struct service_data_struct *service_data; int i, found = 0; /* If there's more than 64 services, only dump ones with @@ -3411,7 +3428,7 @@ vchiq_dump_service_use_state(VCHIQ_STATE_T *state) VCHIQ_STATUS_T vchiq_check_service(VCHIQ_SERVICE_T *service) { - VCHIQ_ARM_STATE_T *arm_state; + struct vchiq_arm_state_struct *arm_state; VCHIQ_STATUS_T ret = VCHIQ_ERROR; if (!service || !service->state) @@ -3450,7 +3467,8 @@ void vchiq_on_remote_use_active(VCHIQ_STATE_T *state) void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state, VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate) { - VCHIQ_ARM_STATE_T *arm_state = vchiq_platform_get_arm_state(state); + struct vchiq_arm_state_struct *arm_state = + vchiq_platform_get_arm_state(state); vchiq_log_info(vchiq_susp_log_level, "%d: %s->%s", state->id, get_conn_state_name(oldstate), get_conn_state_name(newstate)); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h index 2f3ebc99cbcf..ab8eec845568 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -66,7 +66,7 @@ enum USE_TYPE_E { USE_TYPE_VCHIQ }; -typedef struct vchiq_arm_state_struct { +struct vchiq_arm_state_struct { /* Keepalive-related data */ struct task_struct *ka_thread; struct completion ka_evt; @@ -121,7 +121,7 @@ typedef struct vchiq_arm_state_struct { unsigned long long resume_start_time; unsigned long long last_wake_time; -} VCHIQ_ARM_STATE_T; +}; struct vchiq_drvdata { const unsigned int cache_line_size; @@ -149,7 +149,8 @@ extern VCHIQ_STATUS_T vchiq_arm_vcresume(VCHIQ_STATE_T *state); extern VCHIQ_STATUS_T -vchiq_arm_init_state(VCHIQ_STATE_T *state, VCHIQ_ARM_STATE_T *arm_state); +vchiq_arm_init_state(VCHIQ_STATE_T *state, + struct vchiq_arm_state_struct *arm_state); extern int vchiq_check_resume(VCHIQ_STATE_T *state); @@ -180,7 +181,7 @@ vchiq_dump_platform_use_state(VCHIQ_STATE_T *state); extern void vchiq_dump_service_use_state(VCHIQ_STATE_T *state); -extern VCHIQ_ARM_STATE_T* +extern struct vchiq_arm_state_struct* vchiq_platform_get_arm_state(VCHIQ_STATE_T *state); extern int @@ -208,14 +209,14 @@ extern void vchiq_instance_set_trace(VCHIQ_INSTANCE_T instance, int trace); extern void -set_suspend_state(VCHIQ_ARM_STATE_T *arm_state, - enum vc_suspend_status new_state); +set_suspend_state(struct vchiq_arm_state_struct *arm_state, + enum vc_suspend_status new_state); extern void -set_resume_state(VCHIQ_ARM_STATE_T *arm_state, - enum vc_resume_status new_state); +set_resume_state(struct vchiq_arm_state_struct *arm_state, + enum vc_resume_status new_state); extern void -start_suspend_timer(VCHIQ_ARM_STATE_T *arm_state); +start_suspend_timer(struct vchiq_arm_state_struct *arm_state); #endif /* VCHIQ_ARM_H */ -- 2.17.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel