staging: vc04_services: Remove function vchiu_queue_is_full()
Subsystems (2)
PATCH 1/9 staging: vc04_services: Remove function vchiu_queue_is_full()
Remove unused function vchiu_queue_is_full.
Issue found with Coccinelle.
--- .../staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 5 ----- .../staging/vc04_services/interface/vchiq_arm/vchiq_util.h | 1 - 2 files changed, 6 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c +0 -5
@@ -39,11 +39,6 @@ int vchiu_queue_is_empty(struct vchiu_queue *queue)return queue->read == queue->write; } -int vchiu_queue_is_full (struct vchiu_queue *queue) -{ -return queue->write == queue->read + queue->size; -} -void vchiu_queue_push (struct vchiu_queue *queue,struct vchiq_header *header) {if (!queue->initialized)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.h +0 -1
@@ -40,7 +40,6 @@ 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 (struct vchiu_queue *queue); -extern int vchiu_queue_is_full (struct vchiu_queue *queue);extern void vchiu_queue_push (struct vchiu_queue *queue,struct vchiq_header *header);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/9 staging: vc04_services: Remove function vchiq_arm_allow_resume()
Remove unused function vchiq_arm_allow_resume.
Issue found with Coccinelle.
--- .../interface/vchiq_arm/vchiq_arm.c | 43 ------------------- .../interface/vchiq_arm/vchiq_arm.h | 3 -- 2 files changed, 46 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +0 -43
@@ -2883,49 +2883,6 @@ vchiq_check_suspend(struct vchiq_state *state)vchiq_log_trace (vchiq_susp_log_level,"%s exit" , __func__); } -int -vchiq_arm_allow_resume (struct vchiq_state *state) -{ -struct vchiq_arm_state *arm_state =vchiq_platform_get_arm_state (state); -int resume =0 ; -int ret =-1 ; - -if (!arm_state) - goto out; - -vchiq_log_trace (vchiq_susp_log_level,"%s" , __func__); - -write_lock_bh (&arm_state->susp_res_lock); -unblock_resume (arm_state); - resume =vchiq_check_resume (state); -write_unlock_bh (&arm_state->susp_res_lock); - -if (resume) { -if (wait_for_completion_interruptible ( - &arm_state->vc_resume_complete) <0 ) { -vchiq_log_error (vchiq_susp_log_level, -"%s interrupted" , __func__); -/* failed, cannot accurately derive suspend -* state, so exit early. */ - goto out; - } - } - -read_lock_bh (&arm_state->susp_res_lock); -if (arm_state->vc_suspend_state ==VC_SUSPEND_SUSPENDED ) { -vchiq_log_info (vchiq_susp_log_level, -"%s: Videocore remains suspended" , __func__); - }else { -vchiq_log_info (vchiq_susp_log_level, -"%s: Videocore resumed" , __func__); - ret =0 ; - } -read_unlock_bh (&arm_state->susp_res_lock); -out: -vchiq_log_trace (vchiq_susp_log_level,"%s exit %d" , __func__, ret); -return ret; -} -/* This function should be called with the write lock held */ int vchiq_check_resume (struct vchiq_state *state)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +0 -3
@@ -115,9 +115,6 @@ vchiq_arm_vcsuspend(struct vchiq_state *state);extern VCHIQ_STATUS_T vchiq_arm_force_suspend (struct vchiq_state *state); -extern int -vchiq_arm_allow_resume (struct vchiq_state *state); -extern VCHIQ_STATUS_T vchiq_arm_vcresume (struct vchiq_state *state);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 3/9 staging: vc04_services: Remove vchiq_arm_force_suspend()
In reply to Nishka DasguptaRemove unused function vchiq_arm_force_suspend.
Issue found with Coccinelle.
--- .../interface/vchiq_arm/vchiq_arm.c | 120 ------------------ .../interface/vchiq_arm/vchiq_arm.h | 3 - 2 files changed, 123 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +0 -120
@@ -2741,126 +2741,6 @@ output_timeout_error(struct vchiq_state *state) } -/* Try to get videocore into suspended state, regardless of autosuspend state. -** We don't actually force suspend, since videocore may get into a bad state -** if we force suspend at a bad time. Instead, we wait for autosuspend to -** determine a good point to suspend. If this doesn't happen within 100ms we -** report failure. -** -** Returns VCHIQ_SUCCESS if videocore suspended successfully, VCHIQ_RETRY if -** videocore failed to suspend in time or VCHIQ_ERROR if interrupted. -*/ -VCHIQ_STATUS_T -vchiq_arm_force_suspend (struct vchiq_state *state) -{ -struct vchiq_arm_state *arm_state =vchiq_platform_get_arm_state (state); -VCHIQ_STATUS_T status =VCHIQ_ERROR ; -long rc =0 ; -int repeat =-1 ; - -if (!arm_state) - goto out; - -vchiq_log_trace (vchiq_susp_log_level,"%s" , __func__); - -write_lock_bh (&arm_state->susp_res_lock); - - status =block_resume (arm_state); -if (status !=VCHIQ_SUCCESS ) - goto unlock; -if (arm_state->vc_suspend_state ==VC_SUSPEND_SUSPENDED ) { -/* Already suspended - just block resume and exit */ -vchiq_log_info (vchiq_susp_log_level,"%s already suspended" , - __func__); - status =VCHIQ_SUCCESS ; - goto unlock; - }else if (arm_state->vc_suspend_state <=VC_SUSPEND_IDLE ) { -/* initiate suspend immediately in the case that we're waiting -* for the timeout */ -stop_suspend_timer (arm_state); -if (!vchiq_videocore_wanted (state)) { -vchiq_log_info (vchiq_susp_log_level,"%s videocore " -"idle, initiating suspend" , __func__); - status =vchiq_arm_vcsuspend (state); - }else if (arm_state->autosuspend_override < -FORCE_SUSPEND_FAIL_MAX ) { -vchiq_log_info (vchiq_susp_log_level,"%s letting " -"videocore go idle" , __func__); - status =VCHIQ_SUCCESS ; - }else { -vchiq_log_warning (vchiq_susp_log_level,"%s failed too " -"many times - attempting suspend" , __func__); - status =vchiq_arm_vcsuspend (state); - } - }else { -vchiq_log_info (vchiq_susp_log_level,"%s videocore suspend " -"in progress - wait for completion" , __func__); - status =VCHIQ_SUCCESS ; - } - -/* Wait for suspend to happen due to system idle (not forced..) */ -if (status !=VCHIQ_SUCCESS ) - goto unblock_resume; - -do { -write_unlock_bh (&arm_state->susp_res_lock); - - rc =wait_for_completion_interruptible_timeout ( - &arm_state->vc_suspend_complete, -msecs_to_jiffies (FORCE_SUSPEND_TIMEOUT_MS )); - -write_lock_bh (&arm_state->susp_res_lock); -if (rc <0 ) { -vchiq_log_warning (vchiq_susp_log_level,"%s " -"interrupted waiting for suspend" , __func__); - status =VCHIQ_ERROR ; - goto unblock_resume; - }else if (rc ==0 ) { -if (arm_state->vc_suspend_state >VC_SUSPEND_IDLE ) { -/* Repeat timeout once if in progress */ -if (repeat <0 ) { - repeat =1 ; -continue ; - } - } - arm_state->autosuspend_override++; -output_timeout_error (state); - - status =VCHIQ_RETRY ; - goto unblock_resume; - } - }while (0 < (repeat--)); - -/* Check and report state in case we need to abort ARM suspend */ -if (arm_state->vc_suspend_state !=VC_SUSPEND_SUSPENDED ) { - status =VCHIQ_RETRY ; -vchiq_log_error (vchiq_susp_log_level, -"%s videocore suspend failed (state %s)" , __func__, - suspend_state_names[arm_state->vc_suspend_state + -VC_SUSPEND_NUM_OFFSET ]); -/* Reset the state only if it's still in an error state. -* Something could have already initiated another suspend. */ -if (arm_state->vc_suspend_state <VC_SUSPEND_IDLE ) -set_suspend_state (arm_state,VC_SUSPEND_IDLE ); - - goto unblock_resume; - } - -/* successfully suspended - unlock and exit */ - goto unlock; - -unblock_resume: -/* all error states need to unblock resume before exit */ -unblock_resume (arm_state); - -unlock: -write_unlock_bh (&arm_state->susp_res_lock); - -out: -vchiq_log_trace (vchiq_susp_log_level,"%s exit %d" , __func__, status); -return status; -} -void vchiq_check_suspend (struct vchiq_state *state) {
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +0 -3
@@ -112,9 +112,6 @@ vchiq_get_state(void);extern VCHIQ_STATUS_T vchiq_arm_vcsuspend (struct vchiq_state *state); -extern VCHIQ_STATUS_T -vchiq_arm_force_suspend (struct vchiq_state *state); -extern VCHIQ_STATUS_T vchiq_arm_vcresume (struct vchiq_state *state);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 4/9 staging: vc04_services: Remove vchiq_pause_internal()
In reply to Nishka DasguptaRemove unused function vchiq_pause_internal.
Issue found with Coccinelle.
--- .../interface/vchiq_arm/vchiq_core.c | 23 ------------------- .../interface/vchiq_arm/vchiq_core.h | 3 --- 2 files changed, 26 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +0 -23
@@ -2830,29 +2830,6 @@ vchiq_shutdown_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance)return VCHIQ_SUCCESS ; } -VCHIQ_STATUS_T -vchiq_pause_internal (struct vchiq_state *state) -{ -VCHIQ_STATUS_T status =VCHIQ_SUCCESS ; - -switch (state->conn_state) { -case VCHIQ_CONNSTATE_CONNECTED : -/* Request a pause */ -vchiq_set_conn_state (state,VCHIQ_CONNSTATE_PAUSING ); -request_poll (state,NULL ,0 ); -break ; -default : -vchiq_log_error (vchiq_core_log_level, -"%s in state %s\n" , - __func__, conn_state_names[state->conn_state]); - status =VCHIQ_ERROR ; -VCHIQ_STATS_INC (state, error_count); -break ; - } - -return status; -} -VCHIQ_STATUS_T vchiq_resume_internal (struct vchiq_state *state) {
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +0 -3
@@ -518,9 +518,6 @@ vchiq_free_service_internal(struct vchiq_service *service);extern VCHIQ_STATUS_T vchiq_shutdown_internal (struct vchiq_state *state,VCHIQ_INSTANCE_T instance); -extern VCHIQ_STATUS_T -vchiq_pause_internal (struct vchiq_state *state); -extern VCHIQ_STATUS_T vchiq_resume_internal (struct vchiq_state *state);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 5/9 staging: vc04_services: Remove vchiq_resume_internal()
In reply to Nishka DasguptaRemove unused function vchiq_resume_internal.
Issue found with Coccinelle.
--- .../interface/vchiq_arm/vchiq_core.c | 16 ---------------- .../interface/vchiq_arm/vchiq_core.h | 3 --- 2 files changed, 19 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +0 -16
@@ -2830,22 +2830,6 @@ vchiq_shutdown_internal(struct vchiq_state *state, VCHIQ_INSTANCE_T instance)return VCHIQ_SUCCESS ; } -VCHIQ_STATUS_T -vchiq_resume_internal (struct vchiq_state *state) -{ -VCHIQ_STATUS_T status =VCHIQ_SUCCESS ; - -if (state->conn_state ==VCHIQ_CONNSTATE_PAUSED ) { -vchiq_set_conn_state (state,VCHIQ_CONNSTATE_RESUMING ); -request_poll (state,NULL ,0 ); - }else { - status =VCHIQ_ERROR ; -VCHIQ_STATS_INC (state, error_count); - } - -return status; -} -VCHIQ_STATUS_T vchiq_close_service (VCHIQ_SERVICE_HANDLE_T handle) {
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +0 -3
@@ -518,9 +518,6 @@ vchiq_free_service_internal(struct vchiq_service *service);extern VCHIQ_STATUS_T vchiq_shutdown_internal (struct vchiq_state *state,VCHIQ_INSTANCE_T instance); -extern VCHIQ_STATUS_T -vchiq_resume_internal (struct vchiq_state *state); -extern void remote_event_pollall (struct vchiq_state *state);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 6/9 staging: vc04_services: Remove vchiq_use_service_no_resume()
In reply to Nishka DasguptaRemove unused function vchiq_use_service_no_resume. Issue found with Coccinelle.
--- .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 14 -------------- .../vc04_services/interface/vchiq_arm/vchiq_if.h | 2 -- 2 files changed, 16 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +0 -14
@@ -3072,20 +3072,6 @@ static void suspend_timer_callback(struct timer_list *t)vchiq_check_suspend (state); } -VCHIQ_STATUS_T -vchiq_use_service_no_resume (VCHIQ_SERVICE_HANDLE_T handle) -{ -VCHIQ_STATUS_T ret =VCHIQ_ERROR ; -struct vchiq_service *service =find_service_by_handle (handle); - -if (service) { - ret =vchiq_use_internal (service->state, service, -USE_TYPE_SERVICE_NO_RESUME ); -unlock_service (service); - } -return ret; -} -VCHIQ_STATUS_T vchiq_use_service (VCHIQ_SERVICE_HANDLE_T handle) {
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_if.h +0 -2
@@ -107,8 +107,6 @@ extern VCHIQ_STATUS_T vchiq_open_service(VCHIQ_INSTANCE_T instance,extern VCHIQ_STATUS_T vchiq_close_service (VCHIQ_SERVICE_HANDLE_T service);extern VCHIQ_STATUS_T vchiq_remove_service (VCHIQ_SERVICE_HANDLE_T service);extern VCHIQ_STATUS_T vchiq_use_service (VCHIQ_SERVICE_HANDLE_T service); -extern VCHIQ_STATUS_T vchiq_use_service_no_resume ( -VCHIQ_SERVICE_HANDLE_T service);extern VCHIQ_STATUS_T vchiq_release_service (VCHIQ_SERVICE_HANDLE_T service); extern VCHIQ_STATUS_T vchiq_queue_message(VCHIQ_SERVICE_HANDLE_T handle,
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 7/9 staging: vc04_services: Remove vchiq_send_remote_release()
In reply to Nishka DasguptaRemove unused function vchiq_send_remote_release.
Issue found with Coccinelle.
--- .../vc04_services/interface/vchiq_arm/vchiq_core.c | 11 ----------- .../vc04_services/interface/vchiq_arm/vchiq_core.h | 3 --- 2 files changed, 14 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +0 -11
@@ -3538,17 +3538,6 @@ VCHIQ_STATUS_T vchiq_send_remote_use(struct vchiq_state *state)return status; } -VCHIQ_STATUS_T vchiq_send_remote_release (struct vchiq_state *state) -{ -VCHIQ_STATUS_T status =VCHIQ_RETRY ; - -if (state->conn_state !=VCHIQ_CONNSTATE_DISCONNECTED ) - status =queue_message (state,NULL , -VCHIQ_MAKE_MSG (VCHIQ_MSG_REMOTE_RELEASE ,0 ,0 ), -NULL ,NULL ,0 ,0 ); -return status; -} -VCHIQ_STATUS_T vchiq_send_remote_use_active (struct vchiq_state *state) {VCHIQ_STATUS_T status =VCHIQ_RETRY ;
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +0 -3
@@ -639,9 +639,6 @@ vchiq_on_remote_use_active(struct vchiq_state *state);extern VCHIQ_STATUS_T vchiq_send_remote_use (struct vchiq_state *state); -extern VCHIQ_STATUS_T -vchiq_send_remote_release (struct vchiq_state *state); -extern VCHIQ_STATUS_T vchiq_send_remote_use_active (struct vchiq_state *state);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 8/9 staging: vc04_services: Remove function output_timeout_error()
In reply to Nishka DasguptaRemove function output_timeout_error as it was only called by vchiq_arm_force_suspend, which was deleted in a previous patch. Issue found with Coccinelle.
--- .../interface/vchiq_arm/vchiq_arm.c | 36 ------------------- 1 file changed, 36 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +0 -36
@@ -2705,42 +2705,6 @@ vchiq_platform_check_suspend(struct vchiq_state *state)return ; } -static void -output_timeout_error (struct vchiq_state *state) -{ -struct vchiq_arm_state *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; -int i; - -if (!arm_state->videocore_use_count) { -snprintf (err,sizeof (err)," Videocore usecount is 0" ); - goto output_msg; - } -for (i =0 ; i < active_services; i++) { -struct vchiq_service *service_ptr = state->services[i]; - -if (service_ptr && service_ptr->service_use_count && - (service_ptr->srvstate !=VCHIQ_SRVSTATE_FREE )) { -snprintf (err,sizeof (err)," %c%c%c%c(%d) service has " -"use count %d%s" ,VCHIQ_FOURCC_AS_4CHARS ( - service_ptr->base.fourcc), - service_ptr->client_id, - service_ptr->service_use_count, - service_ptr->service_use_count == - vc_use_count ?"" :" (+ more)" ); -break ; - } - } - -output_msg: -vchiq_log_error (vchiq_susp_log_level, -"timed out waiting for vc suspend (%d).%s" , - arm_state->autosuspend_override, err); - -} -void vchiq_check_suspend (struct vchiq_state *state) {
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 9/9 staging: vc04_services: Remove function block_resume()
In reply to Nishka DasguptaRemove function block_resume as it was only called by vchiq_arm_force_suspend, which was removed in a previous patch. Issue found with Coccinelle.
--- .../interface/vchiq_arm/vchiq_arm.c | 66 ------------------- 1 file changed, 66 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +0 -66
@@ -2554,72 +2554,6 @@ need_resume(struct vchiq_state *state)vchiq_videocore_wanted (state); } -static int -block_resume (struct vchiq_arm_state *arm_state) -{ -int status =VCHIQ_SUCCESS ; -const unsigned long timeout_val = -msecs_to_jiffies (FORCE_SUSPEND_TIMEOUT_MS ); -int resume_count =0 ; - -/* Allow any threads which were blocked by the last force suspend to -* complete if they haven't already. Only give this one shot; if -* blocked_count is incremented after blocked_blocker is completed -* (which only happens when blocked_count hits 0) then those threads -* will have to wait until next time around */ -if (arm_state->blocked_count) { -reinit_completion (&arm_state->blocked_blocker); -write_unlock_bh (&arm_state->susp_res_lock); -vchiq_log_info (vchiq_susp_log_level,"%s wait for previously " -"blocked clients" , __func__); -if (wait_for_completion_interruptible_timeout ( - &arm_state->blocked_blocker, timeout_val) - <=0 ) { -vchiq_log_error (vchiq_susp_log_level,"%s wait for " -"previously blocked clients failed" , __func__); - status =VCHIQ_ERROR ; -write_lock_bh (&arm_state->susp_res_lock); - goto out; - } -vchiq_log_info (vchiq_susp_log_level,"%s previously blocked " -"clients resumed" , __func__); -write_lock_bh (&arm_state->susp_res_lock); - } - -/* We need to wait for resume to complete if it's in process */ -while (arm_state->vc_resume_state !=VC_RESUME_RESUMED && - arm_state->vc_resume_state >VC_RESUME_IDLE ) { -if (resume_count >1 ) { - status =VCHIQ_ERROR ; -vchiq_log_error (vchiq_susp_log_level,"%s waited too " -"many times for resume" , __func__); - goto out; - } -write_unlock_bh (&arm_state->susp_res_lock); -vchiq_log_info (vchiq_susp_log_level,"%s wait for resume" , - __func__); -if (wait_for_completion_interruptible_timeout ( - &arm_state->vc_resume_complete, timeout_val) - <=0 ) { -vchiq_log_error (vchiq_susp_log_level,"%s wait for " -"resume failed (%s)" , __func__, - resume_state_names[arm_state->vc_resume_state + -VC_RESUME_NUM_OFFSET ]); - status =VCHIQ_ERROR ; -write_lock_bh (&arm_state->susp_res_lock); - goto out; - } -vchiq_log_info (vchiq_susp_log_level,"%s resumed" , __func__); -write_lock_bh (&arm_state->susp_res_lock); - resume_count++; - } -reinit_completion (&arm_state->resume_blocker); - arm_state->resume_blocked =1 ; - -out: -return status; -} -static inline void unblock_resume (struct vchiq_arm_state *arm_state) {
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel