public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Umang Jain <umang.jain@ideasonboard.com>
To: linux-staging@lists.linux.dev
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	Dan Carpenter <error27@gmail.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Phil Elwell <phil@raspberrypi.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Umang Jain <umang.jain@ideasonboard.com>,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: [PATCH v2 1/6] staging: vc04_services: Drop g_once_init global variable
Date: Thu, 14 Mar 2024 15:36:02 +0530	[thread overview]
Message-ID: <20240314100607.336009-2-umang.jain@ideasonboard.com> (raw)
In-Reply-To: <20240314100607.336009-1-umang.jain@ideasonboard.com>

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>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 .../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


  reply	other threads:[~2024-03-14 10:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 10:06 [PATCH v2 0/6] staging: vc04_services: Drop non-essential global members Umang Jain
2024-03-14 10:06 ` Umang Jain [this message]
2024-03-14 13:00   ` [PATCH v2 1/6] staging: vc04_services: Drop g_once_init global variable Kieran Bingham
2024-03-15 10:58   ` Laurent Pinchart
2024-03-14 10:06 ` [PATCH v2 2/6] staging: vc04_services: vchiq_arm: Move struct vchiq_drvdata to header Umang Jain
2024-03-14 13:05   ` Kieran Bingham
2024-03-14 10:06 ` [PATCH v2 3/6] staging: vc04_services: Drop global members for tracking connections Umang Jain
2024-03-14 13:16   ` Kieran Bingham
2024-03-15 11:50     ` Laurent Pinchart
2024-03-14 10:06 ` [PATCH v2 4/6] staging: vc04_services: vchiq_arm: Drop g_cache_line_size Umang Jain
2024-03-14 14:51   ` Kieran Bingham
2024-03-14 15:39     ` Dan Carpenter
2024-03-14 10:06 ` [PATCH v2 5/6] staging: vc04_services: Drop global variables tracking allocated pages Umang Jain
2024-03-14 14:54   ` Kieran Bingham
2024-03-14 15:45     ` Dan Carpenter
2024-03-15  5:47     ` Umang Jain
2024-03-16  8:41       ` Dan Carpenter
2024-03-16 10:13         ` Kieran Bingham
2024-03-14 10:06 ` [PATCH v2 6/6] staging: vc04_services: Drop completed TODO item Umang Jain
2024-03-14 11:19 ` [PATCH v2 0/6] staging: vc04_services: Drop non-essential global members Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240314100607.336009-2-umang.jain@ideasonboard.com \
    --to=umang.jain@ideasonboard.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=error27@gmail.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@raspberrypi.com \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox