From 631c5a5312138adb47dd044ed21c8e76da731c69 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 3 Oct 2021 14:32:47 +0200 Subject: [PATCH] staging: vchiq_arm: re-order vchiq_arm_init_state This moves vchiq_arm_init_state() above its caller, so we can drop the now unnecessary forward declaration and make the function static. Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1633264369-998-2-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_arm.c | 34 +++++++++---------- .../interface/vchiq_arm/vchiq_arm.h | 4 --- 2 files changed, 17 insertions(+), 21 deletions(-) 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 fcff2e5bd73f..9c424e19fc1d 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -509,6 +509,23 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) return 0; } +static void +vchiq_arm_init_state(struct vchiq_state *state, + struct vchiq_arm_state *arm_state) +{ + if (arm_state) { + rwlock_init(&arm_state->susp_res_lock); + + init_completion(&arm_state->ka_evt); + atomic_set(&arm_state->ka_use_count, 0); + atomic_set(&arm_state->ka_use_ack_count, 0); + atomic_set(&arm_state->ka_release_count, 0); + + arm_state->state = state; + arm_state->first_connect = 0; + } +} + int vchiq_platform_init_state(struct vchiq_state *state) { @@ -1324,23 +1341,6 @@ exit: return 0; } -void -vchiq_arm_init_state(struct vchiq_state *state, - struct vchiq_arm_state *arm_state) -{ - if (arm_state) { - rwlock_init(&arm_state->susp_res_lock); - - init_completion(&arm_state->ka_evt); - atomic_set(&arm_state->ka_use_count, 0); - atomic_set(&arm_state->ka_use_ack_count, 0); - atomic_set(&arm_state->ka_release_count, 0); - - arm_state->state = state; - arm_state->first_connect = 0; - } -} - int vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, enum USE_TYPE_E use_type) 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 8f5182df17b6..28f94b67ae8d 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -127,10 +127,6 @@ int vchiq_platform_init(struct platform_device *pdev, extern struct vchiq_state * vchiq_get_state(void); -extern void -vchiq_arm_init_state(struct vchiq_state *state, - struct vchiq_arm_state *arm_state); - extern void vchiq_check_suspend(struct vchiq_state *state); enum vchiq_status