Linux kernel staging patches
 help / color / mirror / Atom feed
From: Umang Jain <umang.jain@ideasonboard.com>
To: linux-staging@lists.linux.dev
Cc: Dan Carpenter <error27@gmail.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Phil Elwell <phil@raspberrypi.com>, Greg KH <greg@kroah.com>,
	Stefan Wahren <wahrenst@gmx.net>,
	Umang Jain <umang.jain@ideasonboard.com>,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: [PATCH v5 01/11] staging: vc04_services: Drop g_once_init global variable
Date: Fri, 12 Apr 2024 13:27:33 +0530	[thread overview]
Message-ID: <20240412075743.60712-2-umang.jain@ideasonboard.com> (raw)
In-Reply-To: <20240412075743.60712-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>
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>
---
 .../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.44.0


  reply	other threads:[~2024-04-12  7:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12  7:57 [PATCH v5 00/11] staging: vc04_services: Drop non-essential global members Umang Jain
2024-04-12  7:57 ` Umang Jain [this message]
2024-04-14 10:23   ` [PATCH v5 01/11] staging: vc04_services: Drop g_once_init global variable Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 02/11] staging: vc04_services: vchiq_arm: Split driver static and runtime data Umang Jain
2024-04-14 12:04   ` Stefan Wahren
2024-04-19 13:58   ` Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 03/11] staging: vc04_services: vchiq_arm: Drop g_cache_line_size Umang Jain
2024-04-14 12:09   ` Stefan Wahren
2024-04-19 14:04   ` Stefan Wahren
2024-04-21  8:58     ` Umang Jain
2024-04-12  7:57 ` [PATCH v5 04/11] staging: vc04_services: Move variables for tracking connections Umang Jain
2024-04-14 10:41   ` Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 05/11] staging: vc04_services: Drop vchiq_connected.[ch] files Umang Jain
2024-04-12  7:57 ` [PATCH v5 06/11] staging: vc04_services: Move global variables tracking allocated pages Umang Jain
2024-04-14 11:45   ` Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 07/11] staging: vc04_services: Move global memory mapped pointer Umang Jain
2024-04-14 11:58   ` Stefan Wahren
2024-04-16  6:42     ` Laurent Pinchart
2024-04-12  7:57 ` [PATCH v5 08/11] staging: vc04_services: Move spinlocks to vchiq_state Umang Jain
2024-04-14 11:59   ` Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 09/11] staging: vc04_services: vchiq_mmal: Rename service_callback() Umang Jain
2024-04-14 11:06   ` Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 10/11] staging: vc04_services: Move global g_state to vchiq_state Umang Jain
2024-04-14 11:26   ` Stefan Wahren
2024-04-12  7:57 ` [PATCH v5 11/11] staging: vc04_services: Drop completed TODO item Umang Jain

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=20240412075743.60712-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=greg@kroah.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@raspberrypi.com \
    --cc=wahrenst@gmx.net \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).