Skip to content

Commit

Permalink
staging: vc04_services: Drop g_once_init global variable
Browse files Browse the repository at this point in the history
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@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/r/20240412075743.60712-2-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Umang Jain authored and Greg Kroah-Hartman committed Apr 18, 2024
1 parent e0279bb commit e82b225
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down Expand Up @@ -60,8 +50,6 @@ void vchiq_call_connected_callbacks(void)
{
int i;

connected_init();

if (mutex_lock_killable(&g_connected_mutex))
return;

Expand Down

0 comments on commit e82b225

Please sign in to comment.