aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
diff options
context:
space:
mode:
authorAdrien Thierry <athierry@redhat.com>2022-05-18 15:11:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-06 08:03:46 +0200
commited57d93e7752c6347d7d5336509ee72d5d6368a4 (patch)
treefa96088d3bbda77783e481eca85d31c19301b7fd /drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
parentstaging: vchiq_arm: pass vchiq instance to 'handle_to_service' (diff)
downloadlinux-dev-ed57d93e7752c6347d7d5336509ee72d5d6368a4.tar.xz
linux-dev-ed57d93e7752c6347d7d5336509ee72d5d6368a4.zip
staging: vchiq_arm: use state from vchiq instance
In 'handle_to_service', access the vchiq state from the vchiq instance instead of the global 'vchiq_states' array. This will allow getting rid of the global 'vchiq_states' array. Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220518191126.60396-9-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h')
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 3eb70d688c4e..bdd4611005e0 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -508,17 +508,7 @@ extern void
request_poll(struct vchiq_state *state, struct vchiq_service *service,
int poll_type);
-static inline struct vchiq_service *
-handle_to_service(struct vchiq_instance *instance, unsigned int handle)
-{
- int idx = handle & (VCHIQ_MAX_SERVICES - 1);
- struct vchiq_state *state = vchiq_states[(handle / VCHIQ_MAX_SERVICES) &
- (VCHIQ_MAX_STATES - 1)];
-
- if (!state)
- return NULL;
- return rcu_dereference(state->services[idx]);
-}
+struct vchiq_service *handle_to_service(struct vchiq_instance *instance, unsigned int handle);
extern struct vchiq_service *
find_service_by_handle(struct vchiq_instance *instance, unsigned int handle);