Commit 20ebcf0b authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman
Browse files

staging: vchiq_core: introduce poll_services_of_group



The function poll_services() has too many indention levels. So keep only
the group iteration loop and move the rest into a new function
poll_services_of_group().

Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-7-git-send-email-stefan.wahren@i2se.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0705a939
Loading
Loading
Loading
Loading
+65 −60
Original line number Diff line number Diff line
@@ -1318,16 +1318,12 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue,
	return status;
}

/* Called by the slot handler thread */
static void
poll_services(struct vchiq_state *state)
poll_services_of_group(struct vchiq_state *state, int group)
{
	int group, i;

	for (group = 0; group < BITSET_SIZE(state->unused_service); group++) {
		u32 flags;
	u32 flags = atomic_xchg(&state->poll_services[group], 0);
	int i;

		flags = atomic_xchg(&state->poll_services[group], 0);
	for (i = 0; flags; i++) {
		if (flags & BIT(i)) {
			struct vchiq_service *service =
@@ -1384,6 +1380,15 @@ poll_services(struct vchiq_state *state)
		}
	}
}

/* Called by the slot handler thread */
static void
poll_services(struct vchiq_state *state)
{
	int group;

	for (group = 0; group < BITSET_SIZE(state->unused_service); group++)
		poll_services_of_group(state, group);
}

/* Called with the bulk_mutex held */