g_once_init is not used in a meaningful way anywhere. Drop it along with connected_init() which sets it. Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Umang Jain <umang.jain@xxxxxxxxxxxxxxxx> Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Reviewed-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx> --- .../interface/vchiq_arm/vchiq_connected.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c index 3cad13f09e37..4604a2f4d2de 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c @@ -11,16 +11,8 @@ static int g_connected; static int g_num_deferred_callbacks; static void (*g_deferred_callback[MAX_CALLBACKS])(void); -static int g_once_init; static DEFINE_MUTEX(g_connected_mutex); -/* Function to initialize our lock */ -static void connected_init(void) -{ - if (!g_once_init) - g_once_init = 1; -} - /* * This function is used to defer initialization until the vchiq stack is * initialized. If the stack is already initialized, then the callback will @@ -29,8 +21,6 @@ static void connected_init(void) */ void vchiq_add_connected_callback(struct vchiq_device *device, void (*callback)(void)) { - connected_init(); - if (mutex_lock_killable(&g_connected_mutex)) return; @@ -60,8 +50,6 @@ void vchiq_call_connected_callbacks(void) { int i; - connected_init(); - if (mutex_lock_killable(&g_connected_mutex)) return; -- 2.43.0