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>,
Greg KH <greg@kroah.com>,
Umang Jain <umang.jain@ideasonboard.com>,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: [PATCH v3 1/6] staging: vc04_services: Drop g_once_init global variable
Date: Thu, 21 Mar 2024 16:07:35 +0530 [thread overview]
Message-ID: <20240321103740.808561-2-umang.jain@ideasonboard.com> (raw)
In-Reply-To: <20240321103740.808561-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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Kieran Bingham <kieran.bingham@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
next prev parent reply other threads:[~2024-03-21 10:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 10:37 [PATCH v3 0/6] staging: vc04_services: Drop non-essential global members Umang Jain
2024-03-21 10:37 ` Umang Jain [this message]
2024-03-21 10:37 ` [PATCH v3 2/6] staging: vc04_services: vchiq_arm: Split driver static and runtime data Umang Jain
2024-03-21 18:46 ` Laurent Pinchart
2024-03-21 10:37 ` [PATCH v3 3/6] staging: vc04_services: vchiq_arm: Drop g_cache_line_size Umang Jain
2024-03-21 19:04 ` Laurent Pinchart
2024-03-21 19:10 ` Laurent Pinchart
2024-03-21 10:37 ` [PATCH v3 4/6] staging: vc04_services: Drop global members for tracking connections Umang Jain
2024-03-21 19:12 ` Laurent Pinchart
2024-03-22 4:55 ` Umang Jain
2024-03-22 8:17 ` Laurent Pinchart
2024-03-21 10:37 ` [PATCH v3 5/6] staging: vc04_services: Drop global variables tracking allocated pages Umang Jain
2024-03-21 19:50 ` Laurent Pinchart
2024-03-22 9:15 ` Umang Jain
2024-03-22 11:44 ` Laurent Pinchart
2024-03-23 13:58 ` Umang Jain
2024-03-21 10:37 ` [PATCH v3 6/6] 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=20240321103740.808561-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=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