aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wahren <[email protected]>2021-04-11 20:11:36 +0200
committerGreg Kroah-Hartman <[email protected]>2021-04-12 11:41:22 +0200
commit0e345d97730678d526bed36947beda4eb15642de (patch)
tree2b6178543fb6bc79b3c7bb8dcd0813e3ba679feb
parent63276d45bac52bd0ecfc35f613b81522fadf26c1 (diff)
staging: vchiq_core: improve readability of request_poll
Storing the index for poll services in a local var will increase the readability of the second loop. Also we get the rid off the checkpatch issue about the line ending with a square bracket. Signed-off-by: Stefan Wahren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index be0ea1e29569..22989866ff70 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -537,6 +537,7 @@ request_poll(struct vchiq_state *state, struct vchiq_service *service,
int poll_type)
{
u32 value;
+ int index;
if (!service)
goto skip_service;
@@ -546,12 +547,11 @@ request_poll(struct vchiq_state *state, struct vchiq_service *service,
} while (atomic_cmpxchg(&service->poll_flags, value,
value | BIT(poll_type)) != value);
+ index = service->localport >> 5;
do {
- value = atomic_read(&state->poll_services[
- service->localport>>5]);
- } while (atomic_cmpxchg(
- &state->poll_services[service->localport>>5], value,
- value | BIT(service->localport & 0x1f)) != value);
+ value = atomic_read(&state->poll_services[index]);
+ } while (atomic_cmpxchg(&state->poll_services[index],
+ value, value | BIT(service->localport & 0x1f)) != value);
skip_service:
state->poll_needed = 1;